s4-ldb: ensure element flags are zero in ldb search return
authorAndrew Tridgell <tridge@samba.org>
Tue, 17 Aug 2010 10:15:28 +0000 (20:15 +1000)
committerAndrew Tridgell <tridge@samba.org>
Tue, 17 Aug 2010 11:21:51 +0000 (21:21 +1000)
the distinguishedName element was getting an uninitialised flags value

source4/lib/ldb/ldb_tdb/ldb_search.c

index 08ccc7933d9261fe7f354507a991c5d5f243b6b0..9ebec90233bd31ea723c87009efec70572d45510 100644 (file)
@@ -78,6 +78,7 @@ static int msg_add_element(struct ldb_message *ret,
        }
 
        elnew->num_values = el->num_values;
+       elnew->flags = el->flags;
 
        ret->num_elements++;
 
@@ -97,6 +98,7 @@ static int msg_add_distinguished_name(struct ldb_message *msg)
        el.name = "distinguishedName";
        el.num_values = 1;
        el.values = &val;
+       el.flags = 0;
        val.data = (uint8_t *)ldb_dn_alloc_linearized(msg, msg->dn);
        val.length = strlen((char *)val.data);