Does not correctly parse host, if given array has no extra
space.
if (*o++ != ']' || (*o != '\0' && *o != ':'))
goto failed;
} else {
- for (; (*c = *o == ':'? '\0' : *o); c++, o++)
- if (c == end)
+ for (; (*c = *o == ':'? '\0' : *o); c++, o++) {
+ if (c == end && o[1])
goto failed;
+ }
}
if (*o == ':')
if (para_atoi32(++o, port) < 0 ||
*port < 0 || *port > 0xffff)
goto failed;
-
if (host_string_ok(host))
return host;
failed: