Make specifying local proxy by IPv6 address work.

The pattern meant for parsing a host name (or IPv4 address) also matched
the head of an IPv6 address, resulting in an invalid host name causing
failure later on. The code meant for parsing an IPv6 address was never
reached.
This commit is contained in:
Sven Geuer 2026-04-13 22:00:31 +02:00
parent 2827a6647e
commit b8c2189ff3
No known key found for this signature in database
GPG key ID: ADF50EDAF8ADD585

View file

@ -631,7 +631,7 @@ int cmdline_parser( int argc, char * const *argv, struct gengetopt_args_info *ar
message( "Out of memory\n" );
exit(1);
}
snprintf( proxy_arg_fmt, sizeof(proxy_arg_fmt), "%%%zu[^:]:%%5u", proxy_arg_len - 1 );
snprintf( proxy_arg_fmt, sizeof(proxy_arg_fmt), "%%%zu[^][:]:%%5u", proxy_arg_len - 1 );
r = sscanf( args_info->proxy_arg, proxy_arg_fmt, phost, &pport );
if ( r != 2 ) {
/* try bracket-enclosed IPv6 literal */