From 915de136dfc808fdc78c8c1cf874570668286459 Mon Sep 17 00:00:00 2001 From: Arvid Requate Date: Tue, 8 Feb 2022 15:57:05 +0100 Subject: [PATCH] paged_results: Avoid ldb_oom if no attrs are specified BUG: https://bugzilla.samba.org/show_bug.cgi?id=14970 Signed-off-by: Arvid Requate --- source4/dsdb/samdb/ldb_modules/paged_results.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source4/dsdb/samdb/ldb_modules/paged_results.c b/source4/dsdb/samdb/ldb_modules/paged_results.c index c5def036780..7a7398ef30b 100644 --- a/source4/dsdb/samdb/ldb_modules/paged_results.c +++ b/source4/dsdb/samdb/ldb_modules/paged_results.c @@ -743,10 +743,12 @@ static int paged_search(struct ldb_module *module, struct ldb_request *req) if (ac->store->expr_str == NULL) { return ldb_module_oom(module); } - ac->store->attrs = paged_copy_attrs(ac->store, - req->op.search.attrs); - if (ac->store->attrs == NULL) { - return ldb_module_oom(module); + if (req->op.search.attrs != NULL) { + ac->store->attrs = paged_copy_attrs(ac->store, + req->op.search.attrs); + if (ac->store->attrs == NULL) { + return ldb_module_oom(module); + } } /* save it locally and remove it from the list */ -- 2.25.1