Skip to content

Commit 9d3cc6e

Browse files
committed
Fix for loop exit condition.
size should be length. s includes offset, so it must be compared against length, not size because size is only what is after offset.
1 parent 350706d commit 9d3cc6e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tls.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1910,7 +1910,7 @@ static int TLSX_ALPN_ParseAndSet(WOLFSSL *ssl, const byte *input, word16 length,
19101910
return BUFFER_ERROR;
19111911

19121912
/* validating length of entries before accepting */
1913-
for (s = input + offset; (s - input) < size; s += wlen) {
1913+
for (s = input + offset; (s - input) < length; s += wlen) {
19141914
wlen = *s++;
19151915
if (wlen == 0 || (s + wlen - input) > length)
19161916
return BUFFER_ERROR;

0 commit comments

Comments
 (0)