Merge pull request #7536 from gasbytes/buffer_overflows_fix

added check that checks if the SEQ's length is > than the buff's length
This commit is contained in:
David Garske
2024-05-15 10:56:42 -07:00
committed by GitHub

View File

@ -160,6 +160,10 @@ static int DataToDerBuffer(const unsigned char* buff, word32 len, int format,
else {
ret = ASN_PARSE_E;
}
if (info->consumed > (int)len) {
ret = ASN_PARSE_E;
}
if (ret == 0) {
ret = AllocCopyDer(der, buff, (word32)info->consumed, type, heap);
}