when removing the padding for the TLS13 verify message

step, check that the index doesn't wrap around due to a malformed packet
This commit is contained in:
John Bland
2023-12-27 16:06:40 -05:00
parent b8392ef659
commit e641c6b738

View File

@ -21166,7 +21166,8 @@ default:
word16 i = (word16)(ssl->buffers.inputBuffer.idx +
ssl->curSize - ssl->specs.aead_mac_size);
if (i > ssl->buffers.inputBuffer.length) {
/* check i isn't too big and won't wrap around on --i */
if (i > ssl->buffers.inputBuffer.length || i == 0) {
WOLFSSL_ERROR(BUFFER_ERROR);
return BUFFER_ERROR;
}