We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b8392ef commit e641c6bCopy full SHA for e641c6b
1 file changed
src/internal.c
@@ -21166,7 +21166,8 @@ int ProcessReplyEx(WOLFSSL* ssl, int allowSocketErr)
21166
word16 i = (word16)(ssl->buffers.inputBuffer.idx +
21167
ssl->curSize - ssl->specs.aead_mac_size);
21168
21169
- if (i > ssl->buffers.inputBuffer.length) {
+ /* check i isn't too big and won't wrap around on --i */
21170
+ if (i > ssl->buffers.inputBuffer.length || i == 0) {
21171
WOLFSSL_ERROR(BUFFER_ERROR);
21172
return BUFFER_ERROR;
21173
}
0 commit comments