1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

s4:dsdb: Check whether ‘p’ is NULL before dereferencing it (CID 240875)

Commit 6baf7608df 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>
This commit is contained in:
Joseph Sutton 2023-10-06 10:27:45 +13:00 committed by Andrew Bartlett
parent 1ad4dd9288
commit d0db0ff268

View File

@ -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);