Skip to content

Commit b37716f

Browse files
committed
refactor and remove word16 index
1 parent 245c87f commit b37716f

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

src/internal.c

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21162,20 +21162,15 @@ int ProcessReplyEx(WOLFSSL* ssl, int allowSocketErr)
2116221162
ssl->keys.decryptedCur = 1;
2116321163
#ifdef WOLFSSL_TLS13
2116421164
if (ssl->options.tls1_3) {
21165-
word16 i;
21166-
word32 boundsCheck = (ssl->buffers.inputBuffer.idx +
21165+
word32 i = (ssl->buffers.inputBuffer.idx +
2116721166
ssl->curSize - ssl->specs.aead_mac_size);
2116821167
/* check that the end of the logical length doesn't extend
2116921168
* past the real buffer */
21170-
if (boundsCheck > ssl->buffers.inputBuffer.length ||
21171-
boundsCheck == 0) {
21169+
if (i > ssl->buffers.inputBuffer.length || i == 0) {
2117221170
WOLFSSL_ERROR(BUFFER_ERROR);
2117321171
return BUFFER_ERROR;
2117421172
}
2117521173

21176-
/* end of plaintext */
21177-
i = (word16)(boundsCheck);
21178-
2117921174
/* Remove padding from end of plain text. */
2118021175
for (--i; i > ssl->buffers.inputBuffer.idx; i--) {
2118121176
if (ssl->buffers.inputBuffer.buffer[i] != 0)

0 commit comments

Comments
 (0)