Skip to content

Commit b7b20ed

Browse files
authored
Merge pull request #7058 from lealem47/zd17174
Check buffer length before XMEMCMP in GetOID
2 parents cbd5341 + 2724edc commit b7b20ed

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

wolfcrypt/src/asn.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5747,7 +5747,8 @@ static int GetOID(const byte* input, word32* inOutIdx, word32* oid,
57475747
*
57485748
* These hacks will hopefully disappear when new standardized OIDs appear.
57495749
*/
5750-
if (memcmp(&input[idx], sigSphincsFast_Level3Oid,
5750+
if (idx + (word32)sizeof(sigSphincsFast_Level3Oid) < (word32)length &&
5751+
XMEMCMP(&input[idx], sigSphincsFast_Level3Oid,
57515752
sizeof(sigSphincsFast_Level3Oid)) == 0) {
57525753
found_collision = SPHINCS_FAST_LEVEL3k;
57535754
}

0 commit comments

Comments
 (0)