[FIX] Check the number of digits with IPv6(up to 8)

Also fixes a warning (-Wno-unused-but-set-variable).
This commit is contained in:
lda 2024-03-20 15:37:52 +01:00
parent f815f653b0
commit 3ec713da8b

View file

@ -152,7 +152,7 @@ ParseIPv6(char **str, char **out)
goto fail;
}
while ((c = Iterate(str)) && IsIPv6Char(c))
while ((c = Iterate(str)) && IsIPv6Char(c) && digits < 8)
{
char *ipv4;
if (isxdigit(c))