]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
torture: Only walk over objects actually converted in drs.dssync
authorAndrew Bartlett <abartlet@samba.org>
Fri, 13 May 2016 04:06:29 +0000 (16:06 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 2 Jun 2016 14:36:15 +0000 (16:36 +0200)
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
source4/torture/drs/rpc/dssync.c

index 80e237b8021b9ea59f9f986c5b0ac25ad83346ac..488a88c9526526b130aef419781dc065e9f5a56c 100644 (file)
@@ -384,11 +384,12 @@ static bool test_analyse_objects(struct torture_context *tctx,
        deleted_dn = ldb_dn_new(objs, ldb, partition);
        ldb_dn_add_child_fmt(deleted_dn, "CN=Deleted Objects");
 
-       for (i=0; i < object_count; i++) {
+       for (i=0; i < objs->num_objects; i++) {
                struct ldb_request *search_req;
                struct ldb_result *res;
                struct ldb_message *new_msg, *drs_msg, *ldap_msg;
-               const char **attrs = talloc_array(objs, const char *, objs->objects[i].msg->num_elements+1);
+               size_t num_attrs = objs->objects[i].msg->num_elements+1;
+               const char **attrs = talloc_array(objs, const char *, num_attrs);
                for (j=0; j < objs->objects[i].msg->num_elements; j++) {
                        attrs[j] = objs->objects[i].msg->elements[j].name;
                }