mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +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;
|
||||
|
||||
len = input[idx++];
|
||||
if (len > 4 || (int)len > sz)
|
||||
if (len > 4 || (int)(len + idx) > sz)
|
||||
return ASN_PARSE_E;
|
||||
|
||||
while (len--) {
|
||||
@@ -14850,6 +14850,9 @@ static int DecodeSingleResponse(byte* source,
|
||||
if (GetSerialNumber(source, &idx, cs->serial, &cs->serialSz, size) < 0)
|
||||
return ASN_PARSE_E;
|
||||
|
||||
if ( idx >= size )
|
||||
return BUFFER_E;
|
||||
|
||||
/* CertStatus */
|
||||
switch (source[idx++])
|
||||
{
|
||||
|
Reference in New Issue
Block a user