]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3: smbd: Ensure srvstr_pull_req_talloc() always NULLs out *dest.
authorJeremy Allison <jra@samba.org>
Fri, 11 Aug 2023 17:42:41 +0000 (10:42 -0700)
committerJule Anger <janger@samba.org>
Wed, 16 Aug 2023 08:47:14 +0000 (08:47 +0000)
Robert Morris <rtm@lcs.mit.edu> noticed that in the case
where srvstr_pull_req_talloc() is being called with
buffer remaining == 0, we don't NULL out the destination
pointed which is *always* done in the codepaths inside
pull_string_talloc(). This prevents a crash in the caller.

Remove knownfail.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
(cherry picked from commit 9220c45cc191b34e293190f6a923ba463edd5db9)

selftest/knownfail.d/smb1_truncated_sessetup [deleted file]
source3/smbd/smb2_reply.c

diff --git a/selftest/knownfail.d/smb1_truncated_sessetup b/selftest/knownfail.d/smb1_truncated_sessetup
deleted file mode 100644 (file)
index 2ecdbd8..0000000
+++ /dev/null
@@ -1 +0,0 @@
-^samba3.smbtorture_s3.smb1.SMB1-TRUNCATED-SESSSETUP.smbtorture\(fileserver_smb1\)
index abd9b928b7e68d74e5ae35f0d6ea613fffa4bf0f..16d132e0acfdaa2629aeb209fc37967a9089d925 100644 (file)
@@ -548,6 +548,7 @@ size_t srvstr_pull_req_talloc(TALLOC_CTX *ctx, struct smb_request *req,
        ssize_t bufrem = smbreq_bufrem(req, src);
 
        if (bufrem == 0) {
+               *dest = NULL;
                return 0;
        }