Skip to content

Commit 6d5fefd

Browse files
committed
dtls 1.3: Check header length before copying
1 parent 8ce6f17 commit 6d5fefd

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/internal.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11255,6 +11255,11 @@ static int GetDtls13RecordHeader(WOLFSSL* ssl, word32* inOutIdx,
1125511255
if (ret != 0)
1125611256
return ret;
1125711257

11258+
if (ssl->dtls13CurRlLength > sizeof(ssl->dtls13CurRL)) {
11259+
WOLFSSL_MSG("Record header too long");
11260+
return SEQUENCE_ERROR;
11261+
}
11262+
1125811263
if (readSize < ssl->dtls13CurRlLength + DTLS13_RN_MASK_SIZE) {
1125911264
/* when using DTLS over a medium that does not guarantee that a full
1126011265
* message is received in a single read, we may end up without the full

0 commit comments

Comments
 (0)