]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Ensure that whoami parses all the data provided to it
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 3 May 2021 04:24:42 +0000 (16:24 +1200)
committerJeremy Allison <jra@samba.org>
Wed, 19 May 2021 01:32:34 +0000 (01:32 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source3/libsmb/clifsinfo.c

index c1f2eca8bcf63af2403bf8ecf427876d6fc1f949..c4e2a01bc45bba81e12f86c981ecf9e476c49734 100644 (file)
@@ -714,6 +714,13 @@ static void cli_posix_whoami_done(struct tevent_req *subreq)
                p += sid_size;
                num_rdata -= sid_size;
        }
+
+       if (num_rdata != 0) {
+               tevent_req_nterror(req,
+                       NT_STATUS_INVALID_NETWORK_RESPONSE);
+               return;
+       }
+
        tevent_req_done(req);
 }