diff --git a/lib/util/host_port.c b/lib/util/host_port.c index f238c5ce0..1ceb325dc 100644 --- a/lib/util/host_port.c +++ b/lib/util/host_port.c @@ -35,7 +35,7 @@ /* * Parse a string in the form host[:port] where host can also be * an IPv4 address or an IPv6 address in square brackets. - * Modifies str. + * Fills in hostp and portp which may point within str, which is modified. */ bool sudo_parse_host_port_v1(char *str, char **hostp, char **portp, char *defport) @@ -72,6 +72,9 @@ sudo_parse_host_port_v1(char *str, char **hostp, char **portp, char *defport) if (port == NULL) port = defport; + *hostp = host; + *portp = port; + ret = true; done: