From: Anoop C S Date: Tue, 19 May 2026 10:47:56 +0000 (+0530) Subject: source4/librpc: Add NULL check in dcerpc_secondary_auth_connection() X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=bd7d2de74503afa8a286aaa06ef7d1562b296937;p=thirdparty%2Fsamba.git source4/librpc: Add NULL check in dcerpc_secondary_auth_connection() When dcerpc_secondary_auth_connection_send() fails, it returns NULL. The NULL pointer is passed to dcerpc_secondary_auth_connection_recv() which dereferences it without checking, causing a NULL pointer dereference. Add NULL check before calling the recv function and return NT_STATUS_NO_MEMORY. Signed-off-by: Anoop C S Reviewed-by: Martin Schwenke Autobuild-User(master): Martin Schwenke Autobuild-Date(master): Thu May 21 03:24:09 UTC 2026 on atb-devel-224 --- diff --git a/source4/librpc/rpc/dcerpc_secondary.c b/source4/librpc/rpc/dcerpc_secondary.c index 7a4c254d589..c036d988fe2 100644 --- a/source4/librpc/rpc/dcerpc_secondary.c +++ b/source4/librpc/rpc/dcerpc_secondary.c @@ -428,5 +428,9 @@ _PUBLIC_ NTSTATUS dcerpc_secondary_auth_connection(struct dcerpc_pipe *p, c = dcerpc_secondary_auth_connection_send(p, binding, table, credentials, lp_ctx); + if (c == NULL) { + return NT_STATUS_NO_MEMORY; + } + return dcerpc_secondary_auth_connection_recv(c, mem_ctx, p2); }