]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:auth: Ensure that some parameters are not NULL
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Tue, 26 Sep 2023 00:34:56 +0000 (13:34 +1300)
committerJoseph Sutton <jsutton@samba.org>
Sun, 1 Oct 2023 22:45:38 +0000 (22:45 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/auth/sam.c

index 7b1d29e377e314e5a30129650fda99bb35119505..33956c16a4059df55e28633997f3660fc8f3a93b 100644 (file)
@@ -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;