]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:passdb: Fix CIDs 1596750,1596751 uninitialized pointer read
authorMichael Adam <obnox@samba.org>
Wed, 6 Aug 2025 09:27:48 +0000 (11:27 +0200)
committerAnoop C S <anoopcs@samba.org>
Thu, 7 Aug 2025 11:20:25 +0000 (11:20 +0000)
This fixes two coverity issues of type

CID 1596750 - uninitialized pointer read
CID 1596751 - uninitialized pointer read

 It fixes one occurrence in each of
pdb_samba_dsdb_create_user and pdb_samba_dsdb_create_alias

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Rabinarayan Panigrahi <rapanigr@redhat.com>
Reviewed-by: Shachar Sharon <ssharon@redhat.com>
Autobuild-User(master): Anoop C S <anoopcs@samba.org>
Autobuild-Date(master): Thu Aug  7 11:20:25 UTC 2025 on atb-devel-224

source3/passdb/pdb_samba_dsdb.c

index 0678f7516d116432547fc085292940572e74d586..96d9819316b9e28135edc6c3e4df948bedc34b9f 100644 (file)
@@ -768,7 +768,7 @@ static NTSTATUS pdb_samba_dsdb_create_user(struct pdb_methods *m,
 {
        struct pdb_samba_dsdb_state *state = talloc_get_type_abort(
                m->private_data, struct pdb_samba_dsdb_state);
-       struct dom_sid *sid;
+       struct dom_sid *sid = NULL;
        struct ldb_dn *dn;
        NTSTATUS status;
        TALLOC_CTX *tmp_ctx = talloc_new(mem_ctx);
@@ -1582,7 +1582,7 @@ static NTSTATUS pdb_samba_dsdb_create_alias(struct pdb_methods *m,
        TALLOC_CTX *frame = talloc_stackframe();
        struct pdb_samba_dsdb_state *state = talloc_get_type_abort(
                m->private_data, struct pdb_samba_dsdb_state);
-       struct dom_sid *sid;
+       struct dom_sid *sid = NULL;
 
        struct ldb_dn *dn;
        NTSTATUS status;