We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents bcfaf03 + b37716f commit 9db2077Copy full SHA for 9db2077
1 file changed
src/internal.c
@@ -21160,11 +21160,11 @@ int ProcessReplyEx(WOLFSSL* ssl, int allowSocketErr)
21160
ssl->keys.decryptedCur = 1;
21161
#ifdef WOLFSSL_TLS13
21162
if (ssl->options.tls1_3) {
21163
- /* end of plaintext */
21164
- word16 i = (word16)(ssl->buffers.inputBuffer.idx +
21165
- ssl->curSize - ssl->specs.aead_mac_size);
21166
-
21167
- if (i > ssl->buffers.inputBuffer.length) {
+ word32 i = (ssl->buffers.inputBuffer.idx +
+ ssl->curSize - ssl->specs.aead_mac_size);
+ /* check that the end of the logical length doesn't extend
+ * past the real buffer */
+ if (i > ssl->buffers.inputBuffer.length || i == 0) {
21168
WOLFSSL_ERROR(BUFFER_ERROR);
21169
return BUFFER_ERROR;
21170
}
0 commit comments