]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4:dsdb: Check whether ā€˜p’ is NULL before dereferencing it (CID 240875)
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 5 Oct 2023 21:27:45 +0000 (10:27 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 13 Oct 2023 02:18:31 +0000 (02:18 +0000)
Commit 6baf7608dfc3517cb3798fc53db849f49c6d157a 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>
source4/dsdb/samdb/ldb_modules/extended_dn_out.c

index 8a323e2d6b0682834b150f09b26ecc4c0ffee48e..a949bfbd907e8521b6f550a5a030745be9132036 100644 (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);