]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ldb: ldb_build_search_req() check for a talloc failure
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 31 Aug 2022 03:42:46 +0000 (15:42 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 16 Sep 2022 05:46:35 +0000 (05:46 +0000)
The failure in question would have to be a `talloc_strdup(dn, "")` in
ldb_dn_from_ldb_val().

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/common/ldb.c

index c2599a096b969c0ff51f38d11a7f0d4eefc37b8e..6145bc7e5008349bc62d34fe4298214ded5a0329 100644 (file)
@@ -1467,6 +1467,10 @@ int ldb_build_search_req_ex(struct ldb_request **ret_req,
        req->operation = LDB_SEARCH;
        if (base == NULL) {
                req->op.search.base = ldb_dn_new(req, ldb, NULL);
+               if (req->op.search.base == NULL) {
+                       ldb_oom(ldb);
+                       return LDB_ERR_OPERATIONS_ERROR;
+               }
        } else {
                req->op.search.base = base;
        }