diff options
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/asn1.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/libsmb/asn1.c b/source3/libsmb/asn1.c index 072fd30283..86a2845192 100644 --- a/source3/libsmb/asn1.c +++ b/source3/libsmb/asn1.c @@ -268,17 +268,22 @@ BOOL asn1_start_tag(ASN1_DATA *data, uint8 tag) } if (!asn1_read_uint8(data, &b)) { + SAFE_FREE(nesting); return False; } if (b & 0x80) { int n = b & 0x7f; - if (!asn1_read_uint8(data, &b)) + if (!asn1_read_uint8(data, &b)) { + SAFE_FREE(nesting); return False; + } nesting->taglen = b; while (n > 1) { - if (!asn1_read_uint8(data, &b)) + if (!asn1_read_uint8(data, &b)) { + SAFE_FREE(nesting); return False; + } nesting->taglen = (nesting->taglen << 8) | b; n--; } |