ldb modules: paged_search checks control is not NULL (CID 241355)
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 8 May 2019 01:11:43 +0000 (13:11 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 9 May 2019 22:39:27 +0000 (22:39 +0000)
It is unlikely to be NULL, since we're in the callback.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
lib/ldb/modules/paged_searches.c

index 68eeb4c76e30fd046683e510d3f6344015aea83c..f8f3895e19daf818dc0f64731d4051091f17b217 100644 (file)
@@ -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) {