From d30a6124101b5e79a496a6f6cc0a7f959fa2b5e1 Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Tue, 26 Sep 2023 13:34:56 +1300 Subject: [PATCH] s4:auth: Ensure that some parameters are not NULL Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- source4/auth/sam.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/source4/auth/sam.c b/source4/auth/sam.c index 7b1d29e377e..33956c16a40 100644 --- a/source4/auth/sam.c +++ b/source4/auth/sam.c @@ -383,6 +383,10 @@ _PUBLIC_ NTSTATUS authsam_make_user_info_dc(TALLOC_CTX *mem_ctx, struct ldb_message_element *el; static const char * const group_type_attrs[] = { "groupType", NULL }; + if (msg == NULL) { + return NT_STATUS_INVALID_PARAMETER; + } + user_info_dc = talloc_zero(mem_ctx, struct auth_user_info_dc); NT_STATUS_HAVE_NO_MEMORY(user_info_dc); @@ -755,6 +759,14 @@ NTSTATUS authsam_shallow_copy_user_info_dc(TALLOC_CTX *mem_ctx, struct auth_user_info_dc *user_info_dc = NULL; NTSTATUS status = NT_STATUS_OK; + if (user_info_dc_in == NULL) { + return NT_STATUS_INVALID_PARAMETER; + } + + if (user_info_dc_out == NULL) { + return NT_STATUS_INVALID_PARAMETER; + } + user_info_dc = talloc_zero(mem_ctx, struct auth_user_info_dc); if (user_info_dc == NULL) { status = NT_STATUS_NO_MEMORY; -- 2.47.3