diff options
Diffstat (limited to 'source4/libcli/util')
-rw-r--r-- | source4/libcli/util/asn1.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/libcli/util/asn1.c b/source4/libcli/util/asn1.c index 1124cc1701..dff31f6411 100644 --- a/source4/libcli/util/asn1.c +++ b/source4/libcli/util/asn1.c @@ -509,9 +509,11 @@ BOOL asn1_read_OctetString(struct asn1_data *data, DATA_BLOB *blob) data->has_error = True; return False; } - *blob = data_blob(NULL, len); + *blob = data_blob(NULL, len+1); asn1_read(data, blob->data, len); asn1_end_tag(data); + blob->length--; + blob->data[len] = 0; if (data->has_error) { data_blob_free(blob); |