Fix wolfIO_DecodeUrl handling of IPv6 brackets.

Fixes F-4285.
This commit is contained in:
Kareem
2026-06-12 13:25:56 -07:00
parent b28490c1cc
commit df81ef1fe3
+6
View File
@@ -1710,6 +1710,12 @@ int wolfIO_DecodeUrl(const char* url, int urlSz, char* outName, char* outPath,
outName[i] = url[cur];
i++; cur++;
}
/* A bracketed IPv6 literal must be terminated by ']'. The loop
* above can also stop on end-of-buffer, NUL, or the length cap,
* none of which represent a well-formed host. Reject those cases
* rather than accepting the unterminated tail as the hostname. */
if (cur >= urlSz || url[cur] != ']')
return WOLFSSL_FATAL_ERROR;
cur++; /* skip ']' */
}
else {