Skip to content

Commit

Permalink
s4:dsdb: Check whether ‘p’ is NULL before dereferencing it (CID 240875)
Browse files Browse the repository at this point in the history
Commit 6baf760 added a NULL check in
one place, but not everywhere ‘p’ was dereferenced.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
  • Loading branch information
jsutton24 authored and abartlet committed Oct 13, 2023
1 parent 1ad4dd9 commit d0db0ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source4/dsdb/samdb/ldb_modules/extended_dn_out.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit d0db0ff

Please sign in to comment.