ASN original, OCSP: fix maximum size calc to GetDateInfo

GetDateInfo called with a local index (reset to 0) but size is of
original buffer. Subtract the index into original buffer from size to
get size available for parsing.
This commit is contained in:
Sean Parkinson
2023-04-26 09:03:08 +10:00
parent c4233e7aec
commit 5b0c017a94

View File

@ -33759,7 +33759,7 @@ static int DecodeSingleResponse(byte* source, word32* ioIndex, word32 size,
localIdx = 0;
if (GetDateInfo(single->status->thisDateAsn, &localIdx, NULL,
(byte*)&single->status->thisDateParsed.type,
&single->status->thisDateParsed.length, size) < 0)
&single->status->thisDateParsed.length, size - idx) < 0)
return ASN_PARSE_E;
if (idx + localIdx >= size)
@ -33795,7 +33795,7 @@ static int DecodeSingleResponse(byte* source, word32* ioIndex, word32 size,
localIdx = 0;
if (GetDateInfo(single->status->nextDateAsn, &localIdx, NULL,
(byte*)&single->status->nextDateParsed.type,
&single->status->nextDateParsed.length, size) < 0)
&single->status->nextDateParsed.length, size - idx) < 0)
return ASN_PARSE_E;
if (idx + localIdx >= size)