Description
uri port is never initialized to zero in axutil_uri_create(). This causes problems in axutil_uri_resolve_relative() which has a if check as,
if (!uri->port)
Thus, the port of the resolved relative URI will always be garbage, if it didn't originally have one. This badly affects axutil_uri_to_string() where there is a test for the default port in a scheme as,
is_default_port = (uri->port_str == NULL || uri->port == 0 ||
uri->port ==
axutil_uri_port_of_scheme(uri->scheme));
Obviously, uri->port_str != NULL if the base had a port, and due to this bug uri->port != 0. Also, since the value is garbage,
uri->port !=
axutil_uri_port_of_scheme(uri->scheme));
Therefore, the port is always printed in the string representation even though it is the default port or not.