summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2019-07-03 12:51:01 +0000
committerNoel Power <npower@samba.org>2019-07-08 09:30:10 +0000
commit109b438181563ed0074780df59a77bcdd7793e9d (patch)
treeefc486edc980597636e3eb8e8d60d76b73e89fa0 /source4
parent96e00a525876ba13250c6428c014d58464fcf5f3 (diff)
downloadsamba-109b438181563ed0074780df59a77bcdd7793e9d.tar.gz
s4/dsdb/schema: Fix Access to field results in deference of null pointer
Fixes: source4/dsdb/schema/schema_info_attr.c:207:38: warning: Access to field 'revision' results in a dereference of a null pointer (loaded from variable 'schema_info') <--[clang] if (schema->schema_info->revision > schema_info->revision) { ^~~~~~~~~~~ 1 warning generated. Signed-off-by: Noel Power <noel.power@suse.com> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/schema/schema_info_attr.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source4/dsdb/schema/schema_info_attr.c b/source4/dsdb/schema/schema_info_attr.c
index dd06f9b2fbc..447bc9fd8fc 100644
--- a/source4/dsdb/schema/schema_info_attr.c
+++ b/source4/dsdb/schema/schema_info_attr.c
@@ -204,6 +204,15 @@ WERROR dsdb_schema_info_cmp(const struct dsdb_schema *schema,
return werr;
}
+ /*
+ * shouldn't really be possible is dsdb_schema_info_from_blob
+ * succeeded, this check is just to satisfy static checker
+ */
+ if (schema_info == NULL) {
+ TALLOC_FREE(frame);
+ return WERR_INVALID_PARAMETER;
+ }
+
if (schema->schema_info->revision > schema_info->revision) {
/*
* It's ok if our schema is newer than the remote one