From: Douglas Bagnall Date: Wed, 8 May 2019 01:11:43 +0000 (+1200) Subject: ldb modules: paged_search checks control is not NULL (CID 241355) X-Git-Tag: tdb-1.4.1~119 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=47f2264c5e40ca283708310b1b28f03fad6a21a7;p=thirdparty%2Fsamba.git ldb modules: paged_search checks control is not NULL (CID 241355) It is unlikely to be NULL, since we're in the callback. Signed-off-by: Douglas Bagnall Reviewed-by: Gary Lockyer --- diff --git a/lib/ldb/modules/paged_searches.c b/lib/ldb/modules/paged_searches.c index 68eeb4c76e3..f8f3895e19d 100644 --- a/lib/ldb/modules/paged_searches.c +++ b/lib/ldb/modules/paged_searches.c @@ -72,6 +72,11 @@ 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"); + return LDB_ERR_OPERATIONS_ERROR; + } + paged_req_control = talloc_get_type(req_control->data, struct ldb_paged_control); if (!rep_control || !paged_rep_control) {