Skip to content

Commit e641c6b

Browse files
committed
when removing the padding for the TLS13 verify message
step, check that the index doesn't wrap around due to a malformed packet
1 parent b8392ef commit e641c6b

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
@@ -21166,7 +21166,8 @@ int ProcessReplyEx(WOLFSSL* ssl, int allowSocketErr)
2116621166
word16 i = (word16)(ssl->buffers.inputBuffer.idx +
2116721167
ssl->curSize - ssl->specs.aead_mac_size);
2116821168

21169-
if (i > ssl->buffers.inputBuffer.length) {
21169+
/* check i isn't too big and won't wrap around on --i */
21170+
if (i > ssl->buffers.inputBuffer.length || i == 0) {
2117021171
WOLFSSL_ERROR(BUFFER_ERROR);
2117121172
return BUFFER_ERROR;
2117221173
}

0 commit comments

Comments
 (0)