[xml] xmlCtxtReadFile and IPv6



I just submitted a bug and proposed fix:

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

According to the instructions at http://xmlsoft.org/bugs.html, I'm
supposed to notify this list.  I apologize if this wasn't necessary.

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.

Regards,
Steve


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