ldb/mod/paged_searches: cope with NULL control data
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 22 Apr 2020 22:31:39 +0000 (10:31 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Sat, 13 Jun 2020 05:25:31 +0000 (05:25 +0000)
We won't get NULL data over ldap, but it can be set via 'local_oid:'.

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

index f8f3895e19daf818dc0f64731d4051091f17b217..315a17a092a15186f54090c8f871b24302897a34 100644 (file)
@@ -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;
        }