Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-1021

uri port is never initialized to zero in axutil_uri_create().

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3.0
    • 1.3.0
    • util
    • None

    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)

      { uri->port = base->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.

      Attachments

        Activity

          People

            senakafdo Senaka Fernando
            senakafdo Senaka Fernando
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: