mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 12:14:38 +02:00
ParseCert: check index in DecodeSubtree before accessing tag
This commit is contained in:
@@ -15968,6 +15968,12 @@ static int DecodeSubtree(const byte* input, int sz, Base_entry** head,
|
|||||||
WOLFSSL_MSG("\tfail: should be a SEQUENCE");
|
WOLFSSL_MSG("\tfail: should be a SEQUENCE");
|
||||||
return ASN_PARSE_E;
|
return ASN_PARSE_E;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (idx >= (word32)sz) {
|
||||||
|
WOLFSSL_MSG("\tfail: expecting tag");
|
||||||
|
return ASN_PARSE_E;
|
||||||
|
}
|
||||||
|
|
||||||
nameIdx = idx;
|
nameIdx = idx;
|
||||||
b = input[nameIdx++];
|
b = input[nameIdx++];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user