dsdb-cracknames: Always use talloc_zero()
authorAndrew Bartlett <abartlet@samba.org>
Wed, 24 Oct 2012 00:56:02 +0000 (11:56 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 24 Oct 2012 03:12:04 +0000 (05:12 +0200)
Otherwise, we will return un-initialised values to the caller, which will
attempt to push them onto the wire.

Found by Greg Dickie <greg@justaguy.ca>.

Andrew Bartlett

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Oct 24 05:12:04 CEST 2012 on sn-devel-104

source4/dsdb/samdb/cracknames.c

index c366019c56cf09ceb24a10b0dfee14bd22c63356..6ad802687eeb7db918e425f5418204093632809a 100644 (file)
@@ -1472,7 +1472,7 @@ WERROR dcesrv_drsuapi_CrackNamesByNameFormat(struct ldb_context *sam_ctx, TALLOC
        uint32_t i, count;
        WERROR status;
 
-       *ctr1 = talloc(mem_ctx, struct drsuapi_DsNameCtr1);
+       *ctr1 = talloc_zero(mem_ctx, struct drsuapi_DsNameCtr1);
        W_ERROR_HAVE_NO_MEMORY(*ctr1);
 
        count = req1->count;