]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
source4/librpc: Add NULL check in dcerpc_secondary_auth_connection()
authorAnoop C S <anoopcs@samba.org>
Tue, 19 May 2026 10:47:56 +0000 (16:17 +0530)
committerMartin Schwenke <martins@samba.org>
Thu, 21 May 2026 03:24:09 +0000 (03:24 +0000)
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 <anoopcs@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu May 21 03:24:09 UTC 2026 on atb-devel-224

source4/librpc/rpc/dcerpc_secondary.c

index 7a4c254d5894c5e5c73b955ef024ca7c80834f8f..c036d988fe2ee610c5780c100ac1612e8ba5bf4e 100644 (file)
@@ -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);
 }