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:

https://bugzilla.gnome.org/show_bug.cgi?id=694185

  thanks !

According to the instructions at http://xmlsoft.org/bugs.html, 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 ==
"[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.  In the sample program attached, it returns:

error : No such file or directory
I/O warning : failed to load external entity
"http://[fdf2:1e39:73d1:934e::119:4567/Manifest.xml";

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,
http://git.gnome.org/browse/libxml2/commit/?id=19d785b5c76fcd9d7bc2c8d678b05ed83b02f91d

    thanks !

Daniel

-- 
Daniel Veillard      | Open Source and Standards, Red Hat
veillard redhat com  | libxml Gnome XML XSLT toolkit  http://xmlsoft.org/
http://veillard.com/ | virtualization library  http://libvirt.org/


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