Skip to content

Commit 70883a4

Browse files
authored
Merge pull request #10692 from JacobBarthelmeh/fuzz
additional sanity check on alert message size
2 parents f9cd909 + 68422e8 commit 70883a4

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/internal.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22566,7 +22566,8 @@ static int DoAlert(WOLFSSL* ssl, byte* input, word32* inOutIdx, int* type)
2256622566
#endif
2256722567

2256822568
/* make sure can read the message */
22569-
if (dataSz != ALERT_SIZE) {
22569+
if (dataSz != ALERT_SIZE ||
22570+
*inOutIdx + ALERT_SIZE > ssl->buffers.inputBuffer.length) {
2257022571
#ifdef WOLFSSL_EXTRA_ALERTS
2257122572
SendAlert(ssl, alert_fatal, unexpected_message);
2257222573
#endif

0 commit comments

Comments
 (0)