dsdb/mod/extended_dn_out: zero whole fake_msg struct
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Sat, 6 Apr 2019 01:20:25 +0000 (14:20 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 10 May 2019 01:15:17 +0000 (01:15 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/dsdb/samdb/ldb_modules/extended_dn_out.c

index af4ad8b..ee94be4 100644 (file)
@@ -188,11 +188,10 @@ static int handle_dereference_openldap(struct ldb_dn *dn,
                              const char *attr, const DATA_BLOB *val)
 {
        const struct ldb_val *entryUUIDblob, *sid_blob;
-       struct ldb_message fake_msg; /* easier to use routines that expect an ldb_message */
+       /* easier to use routines that expect an ldb_message */
+       struct ldb_message fake_msg = {0};
        unsigned int j;
-       
-       fake_msg.num_elements = 0;
-                       
+
        /* Look for this attribute in the returned control */
        for (j = 0; dereference_attrs && dereference_attrs[j]; j++) {
                struct ldb_val source_dn = data_blob_string_const(dereference_attrs[j]->dereferenced_dn);
@@ -241,11 +240,10 @@ static int handle_dereference_fds(struct ldb_dn *dn,
                              const char *attr, const DATA_BLOB *val)
 {
        const struct ldb_val *nsUniqueIdBlob, *sidBlob;
-       struct ldb_message fake_msg; /* easier to use routines that expect an ldb_message */
+       struct ldb_message fake_msg = {0}; /* easier to use routines that expect an ldb_message */
        unsigned int j;
-       
-       fake_msg.num_elements = 0;
-                       
+
+
        /* Look for this attribute in the returned control */
        for (j = 0; dereference_attrs && dereference_attrs[j]; j++) {
                struct ldb_val source_dn = data_blob_string_const(dereference_attrs[j]->dereferenced_dn);