• Steve Wolf's avatar
    xmlCtxtReadFile doesn't work with literal IPv6 URLs · 19d785b5
    Steve Wolf authored
    https://bugzilla.gnome.org/show_bug.cgi?id=694185
    
    RedHat Bug 624626 discusses the new behavior of libxml regarding brackets
    around IPv6 addresses.  In earlier versions such as 2.6.27, uri.c stripped the
    brackets (e.g. uri->server == "fdf2:1e39:73d1:934e::119"); in the current
    version it returns IPv6 addresses with brackets intact (e.g. uri->server
    == "[fdf2:1e39:73d1:934e::119]").
    
    Thus in 2.9.0, xmlCtxtReadFile() has a problem when it is passed a URL
    containing a literal IPv6 address.  xmlCtxReadFile() and its subroutines pass
    uri->server unchanged to getaddrinfo(), which doesn't recognize a bracketed
    IPv6 address, so the read fails.
    
    This strips the [ and ] from IPv6 addresses allowing getaddrinfo()
    to work properly with such URIs.
    19d785b5
nanohttp.c 47 KB