From: Joseph Sutton Date: Thu, 5 Oct 2023 21:27:45 +0000 (+1300) Subject: s4:dsdb: Check whether ‘p’ is NULL before dereferencing it (CID 240875) X-Git-Tag: tevent-0.16.0~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d0db0ff268bf7f7abcdc705088e1b5c04796d671;p=thirdparty%2Fsamba.git s4:dsdb: Check whether ‘p’ is NULL before dereferencing it (CID 240875) Commit 6baf7608dfc3517cb3798fc53db849f49c6d157a added a NULL check in one place, but not everywhere ‘p’ was dereferenced. Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c index 8a323e2d6b0..a949bfbd907 100644 --- a/source4/dsdb/samdb/ldb_modules/extended_dn_out.c +++ b/source4/dsdb/samdb/ldb_modules/extended_dn_out.c @@ -295,7 +295,7 @@ static int extended_callback(struct ldb_request *req, struct ldb_reply *ares) * Shortcut for repl_meta_data. We asked for the data * 'as-is', so stop processing here! */ - if (have_reveal_control && p->normalise == false && ac->inject == true) { + if (have_reveal_control && (p == NULL || !p->normalise) && ac->inject) { return ldb_module_send_entry(ac->req, msg, ares->controls); } @@ -405,7 +405,7 @@ static int extended_callback(struct ldb_request *req, struct ldb_reply *ares) talloc_free(hex_string); } - if (p->normalise) { + if (p != NULL && p->normalise) { ret = dsdb_fix_dn_rdncase(ldb, dn); if (ret != LDB_SUCCESS) { talloc_free(dsdb_dn);