From: Noel Power Date: Wed, 3 Jul 2019 12:51:01 +0000 (+0000) Subject: s4/dsdb/schema: Fix Access to field results in deference of null pointer X-Git-Tag: samba-4.11.0rc1~22 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=109b438181563ed0074780df59a77bcdd7793e9d;p=thirdparty%2Fsamba.git 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 Reviewed-by: Gary Lockyer --- 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