If the ASN.1 depth is zero in asn1_end_tag, call smb_panic. Rather than
ignoring the condition.
Signed-off-by: Gary Lockyer <gary@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
{
struct nesting *nesting;
- if (data->depth > 0) {
- data->depth--;
+ if (data->depth == 0) {
+ smb_panic("Unbalanced ASN.1 Tag nesting");
}
+ data->depth--;
/* make sure we read it all */
if (asn1_tag_remaining(data) != 0) {
data->has_error = true;