mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-02 12:14:38 +02:00
Merge pull request #2587 from guidovranken/ocsp-resp-decoder-bounds-fix
Properly limit array access in OCSP response decoder
This commit is contained in:
@@ -14790,7 +14790,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--) {
|
||||||
@@ -14850,6 +14850,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