mirror of
https://github.com/samba-team/samba.git
synced 2025-02-04 17:47:26 +03:00
r2535: Make certain, that even if we have invalid ASN.1 here, and the caller does not check the return value, that we don't return uninitialised memory here.
Andrew Bartlett (This used to be commit 0e081ecb9d752067b99305b3b62477c3eed9ac24)
This commit is contained in:
parent
366be01eef
commit
5e7259a697
@ -566,7 +566,13 @@ BOOL asn1_read_OctetString(ASN1_DATA *data, DATA_BLOB *blob)
|
||||
*blob = data_blob(NULL, len);
|
||||
asn1_read(data, blob->data, len);
|
||||
asn1_end_tag(data);
|
||||
return !data->has_error;
|
||||
|
||||
if (data->has_error) {
|
||||
data_blob_free(blob);
|
||||
*blob = data_blob(NULL, 0);
|
||||
return False;
|
||||
}
|
||||
return True;
|
||||
}
|
||||
|
||||
BOOL asn1_read_ContextSimple(ASN1_DATA *data, uint8_t num, DATA_BLOB *blob)
|
||||
|
Loading…
x
Reference in New Issue
Block a user