1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

libcli/smb: clang: Fix 'Dereference of null pointer'

Fixes:

smbXcli_base.c:4885:20: warning: Dereference of null pointer <--[clang]
        body = (uint8_t *)iov[1].iov_base;
                          ^~~~~~~~~~~~~~~

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
This commit is contained in:
Noel Power 2019-07-10 10:41:29 +00:00 committed by Gary Lockyer
parent 3594c3ae20
commit fb49e411aa

View File

@ -4851,7 +4851,7 @@ static void smbXcli_negprot_smb2_done(struct tevent_req *subreq)
size_t security_offset, security_length;
DATA_BLOB blob;
NTSTATUS status;
struct iovec *iov;
struct iovec *iov = NULL;
uint8_t *body;
size_t i;
uint16_t dialect_revision;
@ -4879,7 +4879,7 @@ static void smbXcli_negprot_smb2_done(struct tevent_req *subreq)
status = smb2cli_req_recv(subreq, state, &iov,
expected, ARRAY_SIZE(expected));
if (tevent_req_nterror(req, status)) {
if (tevent_req_nterror(req, status) || iov == NULL) {
return;
}