From d0db0ff268bf7f7abcdc705088e1b5c04796d671 Mon Sep 17 00:00:00 2001 From: Joseph Sutton Date: Fri, 6 Oct 2023 10:27:45 +1300 Subject: [PATCH] =?utf8?q?s4:dsdb:=20Check=20whether=20=E2=80=98p=E2=80=99?= =?utf8?q?=20is=20NULL=20before=20dereferencing=20it=20(CID=20240875)?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Commit 6baf7608dfc3517cb3798fc53db849f49c6d157a added a NULL check in one place, but not everywhere ‘p’ was dereferenced. Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- source4/dsdb/samdb/ldb_modules/extended_dn_out.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.47.3