From: Douglas Bagnall Date: Tue, 22 Dec 2015 04:10:14 +0000 (+1300) Subject: ldap VLV: memdup, not strdup VLV context_id X-Git-Tag: tdb-1.3.9~481 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d2c6f7624b802825f0fa711a6254f16de071814d;p=thirdparty%2Fsamba.git ldap VLV: memdup, not strdup VLV context_id The context ID is not a text string, it is an opaque binary field. Pair-programmed-with: Garming Sam Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett Reviewed-by: Garming Sam --- diff --git a/source4/libcli/ldap/ldap_controls.c b/source4/libcli/ldap/ldap_controls.c index 6a4af70d884..0a23cc79a47 100644 --- a/source4/libcli/ldap/ldap_controls.c +++ b/source4/libcli/ldap/ldap_controls.c @@ -675,7 +675,7 @@ static bool decode_vlv_response(void *mem_ctx, DATA_BLOB in, void *_out) if (!asn1_read_OctetString(data, mem_ctx, &context_id)) { return false; } - lvrc->contextId = talloc_strndup(lvrc, (const char *)context_id.data, context_id.length); + lvrc->contextId = talloc_memdup(lvrc, (const char *)context_id.data, context_id.length); if (!lvrc->contextId) { return false; }