mirror of
https://github.com/samba-team/samba.git
synced 2024-12-22 13:34:15 +03:00
asn1: make readContextSimple() add a NUL byte
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:
parent
16fda12282
commit
9bbd7d1c77
@ -938,12 +938,14 @@ bool asn1_read_ContextSimple(struct asn1_data *data, TALLOC_CTX *mem_ctx, uint8_
|
||||
data->has_error = true;
|
||||
return false;
|
||||
}
|
||||
*blob = data_blob_talloc(mem_ctx, NULL, len);
|
||||
*blob = data_blob_talloc(mem_ctx, NULL, len + 1);
|
||||
if ((len != 0) && (!blob->data)) {
|
||||
data->has_error = true;
|
||||
return false;
|
||||
}
|
||||
if (!asn1_read(data, blob->data, len)) return false;
|
||||
blob->length--;
|
||||
blob->data[len] = 0;
|
||||
return asn1_end_tag(data);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user