Re: [xml] xmlCtxtReadFile and IPv6

On Tue, Feb 19, 2013 at 09:30:46AM -0700, Steve Wolf wrote:
I just submitted a bug and proposed fix:

  thanks !

According to the instructions at, I'm
supposed to notify this list.  I apologize if this wasn't necessary.

  No need to apologize, it is actually better to raise the issue here
too :-)

From the bug description:

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 ==

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.  In the sample program attached, it returns:

error : No such file or directory
I/O warning : failed to load external entity

The attached patch strips the brackets from the uri->server value, and allows
the sample program to execute without error.

  Okay, understood, I hardened your patch a bit, and pushed it,

    thanks !


Daniel Veillard      | Open Source and Standards, Red Hat
veillard redhat com  | libxml Gnome XML XSLT toolkit | virtualization library

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]