r13507: the 'data' element of LDAP controls is optional.
authorStefan Metzmacher <metze@samba.org>
Wed, 15 Feb 2006 15:13:05 +0000 (15:13 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 18:51:56 +0000 (13:51 -0500)
(prepare the next commit)

metze
(This used to be commit a1bbf7f2982185cb6cd544b65b4709ab33a850c5)

source4/dsdb/samdb/ldb_modules/extended_dn.c
source4/lib/ldb/modules/asq.c
source4/lib/ldb/modules/paged_results.c
source4/lib/ldb/modules/sort.c

index 839c190a8e5fac4eebfa7cf14584e53cfb208f94..9795758dc2ccab9e171041efb6e32597224e0def 100644 (file)
@@ -185,6 +185,9 @@ static int extended_search(struct ldb_module *module, struct ldb_request *req)
        }
 
        extended_ctrl = talloc_get_type(control->data, struct ldb_extended_dn_control);
+       if (!extended_ctrl) {
+               return LDB_ERR_PROTOCOL_ERROR;
+       }
 
        /* save it locally and remove it from the list */
        if (!save_controls(control, req, &saved_controls)) {
index 905bab480a363cb00c3d26f3ea6bc9df7076a4f0..2975f4d832d464517cb26554a9e8416257e25101 100644 (file)
@@ -105,6 +105,9 @@ static int asq_search(struct ldb_module *module, struct ldb_request *req)
        }
 
        asq_ctrl = talloc_get_type(control->data, struct ldb_asq_control);
+       if (!asq_ctrl) {
+               return LDB_ERR_PROTOCOL_ERROR;
+       }
 
        /* get the object to retrieve the DNs to search */
        base_req = talloc_zero(req, struct ldb_request);
index 5e880529901d16b1201193464b04bc41f545a257..c4aad4500efaa469808a646cd593c940102e7725 100644 (file)
@@ -117,6 +117,9 @@ static int paged_search(struct ldb_module *module, struct ldb_request *req)
        }
 
        paged_ctrl = talloc_get_type(control->data, struct ldb_paged_control);
+       if (!paged_ctrl) {
+               return LDB_ERR_PROTOCOL_ERROR;
+       }
 
        /* check if it is a continuation search the store */
        if (paged_ctrl->cookie_len != 0) {
index 9a0d449cf79a6f443d7f9afe2d1921dfe3c1e4cd..ac9f1081de0fc9c94b2439fb4b44ed1f7f6b3159 100644 (file)
@@ -126,6 +126,9 @@ static int server_sort_search(struct ldb_module *module, struct ldb_request *req
        }
 
        sort_ctrls = talloc_get_type(control->data, struct ldb_server_sort_control *);
+       if (!sort_ctrls) {
+               return LDB_ERR_PROTOCOL_ERROR;
+       }
 
        /* FIXME: we do not support more than one attribute for sorting right now */
        /* FIXME: we need to check if the attribute type exist or return an error */