summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2019-07-04 11:50:29 +0000
committerNoel Power <npower@samba.org>2019-07-08 09:30:10 +0000
commitd54f9aaf81e03d6a7d0e270a88c744f51af507f7 (patch)
tree2ac8637459bc5404b2e6a1cdaad97f87ecb76207 /source4/dsdb
parent50a22849ce11aebead43e39ea42541afdd987408 (diff)
downloadsamba-d54f9aaf81e03d6a7d0e270a88c744f51af507f7.tar.gz
s4/dsdb/schema: clang: Fix Array access results in null pointer deref
Fixes: source4/dsdb/schema/schema_query.c:223:15: warning: Array access (from variable 'attr_list') results in a null pointer dereference <--[clang] attr_list[i] = NULL; ~~~~~~~~~ ^ 1 warning generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/schema/schema_query.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/dsdb/schema/schema_query.c b/source4/dsdb/schema/schema_query.c
index 8a582161721..848f6cbd5b1 100644
--- a/source4/dsdb/schema/schema_query.c
+++ b/source4/dsdb/schema/schema_query.c
@@ -220,7 +220,9 @@ WERROR dsdb_linked_attribute_lDAPDisplayName_list(const struct dsdb_schema *sche
attr_list[i] = cur->lDAPDisplayName;
i++;
}
- attr_list[i] = NULL;
+ if (attr_list != NULL && attr_list[i] != NULL) {
+ attr_list[i] = NULL;
+ }
*attr_list_ret = attr_list;
return WERR_OK;
}