]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2022-32745 s4/dsdb/samldb: Check for empty values array
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 16 Feb 2022 04:03:10 +0000 (17:03 +1300)
committerJule Anger <janger@samba.org>
Sun, 24 Jul 2022 09:41:53 +0000 (11:41 +0200)
This avoids potentially trying to access the first element of an empty
array.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15008

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
source4/dsdb/samdb/ldb_modules/samldb.c

index 107e643e49268e5ef83672b6a7c1e081831d1ef2..3625bb42e58d1f3bb1336b68f917e5e831dd6dfc 100644 (file)
@@ -751,7 +751,7 @@ static int samldb_schema_add_handle_linkid(struct samldb_ctx *ac)
                return ret;
        }
 
-       if (el == NULL) {
+       if (el == NULL || el->num_values == 0) {
                return LDB_SUCCESS;
        }
 
@@ -919,7 +919,7 @@ static int samldb_schema_add_handle_mapiid(struct samldb_ctx *ac)
                return ret;
        }
 
-       if (el == NULL) {
+       if (el == NULL || el->num_values == 0) {
                return LDB_SUCCESS;
        }