Skip to content

Commit 5b0c017

Browse files
committed
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.
1 parent c4233e7 commit 5b0c017

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

wolfcrypt/src/asn.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33759,7 +33759,7 @@ static int DecodeSingleResponse(byte* source, word32* ioIndex, word32 size,
3375933759
localIdx = 0;
3376033760
if (GetDateInfo(single->status->thisDateAsn, &localIdx, NULL,
3376133761
(byte*)&single->status->thisDateParsed.type,
33762-
&single->status->thisDateParsed.length, size) < 0)
33762+
&single->status->thisDateParsed.length, size - idx) < 0)
3376333763
return ASN_PARSE_E;
3376433764

3376533765
if (idx + localIdx >= size)
@@ -33795,7 +33795,7 @@ static int DecodeSingleResponse(byte* source, word32* ioIndex, word32 size,
3379533795
localIdx = 0;
3379633796
if (GetDateInfo(single->status->nextDateAsn, &localIdx, NULL,
3379733797
(byte*)&single->status->nextDateParsed.type,
33798-
&single->status->nextDateParsed.length, size) < 0)
33798+
&single->status->nextDateParsed.length, size - idx) < 0)
3379933799
return ASN_PARSE_E;
3380033800

3380133801
if (idx + localIdx >= size)

0 commit comments

Comments
 (0)