added check that checks if the SEQ's length is > than the buff's length

This commit is contained in:
gasbytes
2024-05-15 18:20:33 +02:00
parent 92806a61c0
commit 2f24b35ab1

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);
}