After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 694185 - xmlCtxtReadFile doesn't work with literal IPv6 URLs
xmlCtxtReadFile doesn't work with literal IPv6 URLs
Status: RESOLVED FIXED
Product: libxml2
Classification: Platform
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Daniel Veillard
libxml QA maintainers
Depends on:
Blocks:
 
 
Reported: 2013-02-19 16:18 UTC by Steve Wolf
Modified: 2013-02-28 10:28 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
sample program (281 bytes, text/x-csrc)
2013-02-19 16:18 UTC, Steve Wolf
  Details
Proposed fix (815 bytes, patch)
2013-02-19 16:18 UTC, Steve Wolf
none Details | Review

Description Steve Wolf 2013-02-19 16:18:05 UTC
Created attachment 236782 [details]
sample program

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.
Comment 1 Steve Wolf 2013-02-19 16:18:45 UTC
Created attachment 236783 [details] [review]
Proposed fix
Comment 2 Daniel Veillard 2013-02-28 10:28:17 UTC
Okay, fixed after a bit of hardening of the patch:

http://git.gnome.org/browse/libxml2/commit/?id=19d785b5c76fcd9d7bc2c8d678b05ed83b02f91d

 thanks a lot !

Daniel