Merge pull request #9860 from anhu/for_length

Fix for loop exit condition.
This commit is contained in:
Daniel Pouzzner
2026-03-04 12:18:31 -06:00
committed by GitHub
+1 -1
View File
@@ -1910,7 +1910,7 @@ static int TLSX_ALPN_ParseAndSet(WOLFSSL *ssl, const byte *input, word16 length,
return BUFFER_ERROR;
/* validating length of entries before accepting */
for (s = input + offset; (s - input) < size; s += wlen) {
for (s = input + offset; (s - input) < length; s += wlen) {
wlen = *s++;
if (wlen == 0 || (s + wlen - input) > length)
return BUFFER_ERROR;