1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00

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 <garming@catalyst.net.nz>
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
This commit is contained in:
Douglas Bagnall 2015-12-22 17:10:14 +13:00 committed by Andrew Bartlett
parent 5421d7070a
commit d2c6f7624b

View File

@ -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)) { if (!asn1_read_OctetString(data, mem_ctx, &context_id)) {
return false; 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) { if (!lvrc->contextId) {
return false; return false;
} }