From: Joseph Sutton Date: Mon, 3 May 2021 04:24:42 +0000 (+1200) Subject: libsmb: Ensure that whoami parses all the data provided to it X-Git-Tag: tevent-0.11.0~808 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9b96ebea5c6966b096cf1100a0895a9c41f2aa1d;p=thirdparty%2Fsamba.git libsmb: Ensure that whoami parses all the data provided to it Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett Reviewed-by: Douglas Bagnall --- diff --git a/source3/libsmb/clifsinfo.c b/source3/libsmb/clifsinfo.c index c1f2eca8bcf..c4e2a01bc45 100644 --- a/source3/libsmb/clifsinfo.c +++ b/source3/libsmb/clifsinfo.c @@ -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); }