Skip to content

Commit

Permalink
libsmb: Use smb2 tcon if conn_protocol >= SMB2_02
Browse files Browse the repository at this point in the history
When the connection protocol is SMB2 the tid from the smb1 member is
used instead of smb2 in cli_state_set_tid which often results in a null
deref.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13310

Signed-off-by: Dan Robertson <[email protected]>
Reviewed-by: Jeremy Allison <[email protected]>
Reviewed-by: Andreas Schneider <[email protected]>
  • Loading branch information
dlrobertson authored and jrasamba committed Mar 1, 2018
1 parent 426e4a5 commit b67ffaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source3/libsmb/clientgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ uint32_t cli_state_set_tid(struct cli_state *cli, uint32_t tid)
uint32_t ret;
if (smbXcli_conn_protocol(cli->conn) >= PROTOCOL_SMB2_02) {
ret = smb2cli_tcon_current_id(cli->smb2.tcon);
smb2cli_tcon_set_id(cli->smb1.tcon, tid);
smb2cli_tcon_set_id(cli->smb2.tcon, tid);
} else {
ret = smb1cli_tcon_current_id(cli->smb1.tcon);
smb1cli_tcon_set_id(cli->smb1.tcon, tid);
Expand Down

0 comments on commit b67ffaf

Please sign in to comment.