From: Jo Sutton Date: Tue, 30 Jul 2024 03:42:32 +0000 (+1200) Subject: s3:libsmb: Fix invalid array dereference X-Git-Tag: tdb-1.4.12~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=786265ad7ffd6d3b8438c18f62a2a027c50fde6d;p=thirdparty%2Fsamba.git s3:libsmb: Fix invalid array dereference If ‘num_addrs’ is equal to zero, name_queries_send() will pass an invalid address to name_query_send(). Signed-off-by: Jo Sutton Reviewed-by: Douglas Bagnall --- diff --git a/source3/libsmb/namequery.c b/source3/libsmb/namequery.c index 9a47f034d38..48210d92847 100644 --- a/source3/libsmb/namequery.c +++ b/source3/libsmb/namequery.c @@ -1701,6 +1701,10 @@ static struct tevent_req *name_queries_send( struct tevent_req *req, *subreq; struct name_queries_state *state; + if (num_addrs == 0) { + return NULL; + } + req = tevent_req_create(mem_ctx, &state, struct name_queries_state); if (req == NULL) {