From: Andreas Schneider Date: Wed, 16 May 2018 14:54:47 +0000 (+0200) Subject: libcli: Fix coverity warning in smb2cli_notify_send() X-Git-Url: http://git.samba.org/?p=metze%2Fsamba%2Fwip.git;a=commitdiff_plain;h=25c4f8c561edb83054218d1eba9f92e41a6573c5 libcli: Fix coverity warning in smb2cli_notify_send() result_independent_of_operands: "(uint16_t)(recursive ? 1 : 0) >> 8" is 0 regardless of the values of its operands. This occurs as the operand of assignment. Found by Coverity. Pair-Programmed-With: Ralph Boehme Signed-off-by: Andreas Schneider Signed-off-by: Ralph Boehme Reviewed-by: Andrew Bartlett --- diff --git a/libcli/smb/smb2cli_notify.c b/libcli/smb/smb2cli_notify.c index 34329ba16ccc..1a2a2793a32b 100644 --- a/libcli/smb/smb2cli_notify.c +++ b/libcli/smb/smb2cli_notify.c @@ -52,15 +52,18 @@ struct tevent_req *smb2cli_notify_send(TALLOC_CTX *mem_ctx, struct tevent_req *req, *subreq; struct smb2cli_notify_state *state; uint8_t *fixed; + uint16_t watch_tree; req = tevent_req_create(mem_ctx, &state, struct smb2cli_notify_state); if (req == NULL) { return NULL; } + + watch_tree = recursive ? SMB2_WATCH_TREE : 0; fixed = state->fixed; SSVAL(fixed, 0, 32); - SSVAL(fixed, 2, recursive ? SMB2_WATCH_TREE : 0); + SSVAL(fixed, 2, watch_tree); SIVAL(fixed, 4, output_buffer_length); SBVAL(fixed, 8, fid_persistent); SBVAL(fixed, 16, fid_volatile);