From f6afc5b35e733b757be8b3c16cff1c872014c8c2 Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Mon, 22 Aug 2022 16:56:46 +1200 Subject: [PATCH] libcli/smb: Set error status if 'iov' pointer is NULL BUG: https://bugzilla.samba.org/show_bug.cgi?id=15152 Signed-off-by: Joseph Sutton Reviewed-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Mon Aug 22 09:03:29 UTC 2022 on sn-devel-184 (cherry picked from commit 75e03ea021afa66842b6e0dea21072b1b8026d58) --- libcli/smb/smbXcli_base.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libcli/smb/smbXcli_base.c b/libcli/smb/smbXcli_base.c index 125a33ccbf8..5d5b5ac45fd 100644 --- a/libcli/smb/smbXcli_base.c +++ b/libcli/smb/smbXcli_base.c @@ -5013,7 +5013,11 @@ 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) || iov == NULL) { + if (tevent_req_nterror(req, status)) { + return; + } + if (iov == NULL) { + tevent_req_nterror(req, NT_STATUS_INTERNAL_ERROR); return; }