diff options
author | Noel Power <noel.power@suse.com> | 2019-07-10 10:37:34 +0000 |
---|---|---|
committer | Gary Lockyer <gary@samba.org> | 2019-07-16 22:52:24 +0000 |
commit | 3594c3ae202688fd8aae5f7f5e20464cb23feea9 (patch) | |
tree | 201db9e2989d3677a8d8a64a9e7f6b0f021cfce8 /libcli/smb | |
parent | 7a86c99ccb6912effdbb0ffbdc5c66eccf8c1aa2 (diff) | |
download | samba-3594c3ae202688fd8aae5f7f5e20464cb23feea9.tar.gz |
libcli/smb: clang: Fix 'Array access results in a null pointer deref'
Fixes:
smbXcli_base.c:4393:10: warning: Array access (from variable 'inhdr') results in a null pointer dereference <--[clang]
flags = CVAL(inhdr, HDR_FLG);
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'libcli/smb')
-rw-r--r-- | libcli/smb/smbXcli_base.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index 37ae0a0e0e1..b0e8aabb72e 100644 --- a/libcli/smb/smbXcli_base.c +++ b/libcli/smb/smbXcli_base.c @@ -4327,7 +4327,7 @@ static void smbXcli_negprot_smb1_done(struct tevent_req *subreq) struct smbXcli_negprot_state); struct smbXcli_conn *conn = state->conn; struct iovec *recv_iov = NULL; - uint8_t *inhdr; + uint8_t *inhdr = NULL; uint8_t wct; uint16_t *vwv; uint32_t num_bytes; @@ -4387,7 +4387,7 @@ static void smbXcli_negprot_smb1_done(struct tevent_req *subreq) NULL, /* pinbuf */ expected, ARRAY_SIZE(expected)); TALLOC_FREE(subreq); - if (tevent_req_nterror(req, status)) { + if (inhdr == NULL || tevent_req_nterror(req, status)) { return; } |