forked from wolfSSL/wolfssl
Properly limit array access in OCSP response decoder
This commit is contained in:
@ -14799,7 +14799,7 @@ static int GetEnumerated(const byte* input, word32* inOutIdx, int *value,
|
|||||||
return BUFFER_E;
|
return BUFFER_E;
|
||||||
|
|
||||||
len = input[idx++];
|
len = input[idx++];
|
||||||
if (len > 4 || (int)len > sz)
|
if (len > 4 || (int)(len + idx) > sz)
|
||||||
return ASN_PARSE_E;
|
return ASN_PARSE_E;
|
||||||
|
|
||||||
while (len--) {
|
while (len--) {
|
||||||
@ -14859,6 +14859,9 @@ static int DecodeSingleResponse(byte* source,
|
|||||||
if (GetSerialNumber(source, &idx, cs->serial, &cs->serialSz, size) < 0)
|
if (GetSerialNumber(source, &idx, cs->serial, &cs->serialSz, size) < 0)
|
||||||
return ASN_PARSE_E;
|
return ASN_PARSE_E;
|
||||||
|
|
||||||
|
if ( idx >= size )
|
||||||
|
return BUFFER_E;
|
||||||
|
|
||||||
/* CertStatus */
|
/* CertStatus */
|
||||||
switch (source[idx++])
|
switch (source[idx++])
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user