dtls 1.3: Check header length before copying

This commit is contained in:
Juliusz Sosinowicz
2024-09-05 14:18:24 +02:00
parent 8ce6f17144
commit 6d5fefde4a

View File

@ -11255,6 +11255,11 @@ static int GetDtls13RecordHeader(WOLFSSL* ssl, word32* inOutIdx,
if (ret != 0)
return ret;
if (ssl->dtls13CurRlLength > sizeof(ssl->dtls13CurRL)) {
WOLFSSL_MSG("Record header too long");
return SEQUENCE_ERROR;
}
if (readSize < ssl->dtls13CurRlLength + DTLS13_RN_MASK_SIZE) {
/* when using DTLS over a medium that does not guarantee that a full
* message is received in a single read, we may end up without the full