From: Douglas Bagnall Date: Wed, 22 Apr 2020 22:31:39 +0000 (+1200) Subject: ldb/mod/paged_searches: cope with NULL control data X-Git-Tag: ldb-2.2.0~124 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3fb21ed12e21382607ed9dc8dc879d62ec43f119;p=thirdparty%2Fsamba.git ldb/mod/paged_searches: cope with NULL control data We won't get NULL data over ldap, but it can be set via 'local_oid:'. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/lib/ldb/modules/paged_searches.c b/lib/ldb/modules/paged_searches.c index f8f3895e19d..315a17a092a 100644 --- a/lib/ldb/modules/paged_searches.c +++ b/lib/ldb/modules/paged_searches.c @@ -72,8 +72,8 @@ static int check_ps_continuation(struct ps_context *ac, struct ldb_request *req, } req_control = ldb_request_get_control(req, LDB_CONTROL_PAGED_RESULTS_OID); - if (req_control == NULL) { - ldb_set_errstring(ldb, "paged_searches: control is missing"); + if (req_control == NULL || req_control->data == NULL) { + ldb_set_errstring(ldb, "paged_searches: control is missing or malformed"); return LDB_ERR_OPERATIONS_ERROR; }