When dsdb_class_by_lDAPDisplayName_ldb_val() returns NULL due
to a missing class in the schema, the result is passed to
attribute_list_from_class() without validation. The function
immediately dereferences sclass when calling dsdb_attribute_list(),
causing a NULL pointer dereference.
Add NULL check at the entry of attribute_list_from_class() and return
NULL for missing schema classes.
Signed-off-by: Anoop C S <anoopcs@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
const char **recursive_list;
const char **attr_list;
+ if (sclass == NULL) {
+ return NULL;
+ }
+
this_class_list = dsdb_attribute_list(mem_ctx, sclass, query);
recursive_list = dsdb_full_attribute_list_internal(mem_ctx, schema,