From: Joseph Sutton Date: Tue, 26 Sep 2023 00:34:56 +0000 (+1300) Subject: s4:auth: Ensure that some parameters are not NULL X-Git-Tag: tevent-0.16.0~292 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d30a6124101b5e79a496a6f6cc0a7f959fa2b5e1;p=thirdparty%2Fsamba.git s4:auth: Ensure that some parameters are not NULL Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- 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;