xmlCtxtReadFile doesn't work with literal IPv6 URLs

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.
1 file changed
tree: e9b1904ee1a2315d1faf0e5e2ba4dac017d2f2dc
  1. bakefile/
  2. doc/
  3. example/
  4. include/
  5. macos/
  6. optim/
  7. python/
  8. result/
  9. test/
  10. vms/
  11. VxWorks/
  12. win32/
  13. xstc/
  14. .gitignore
  15. acinclude.m4
  16. AUTHORS
  17. autogen.sh
  18. buf.c
  19. buf.h
  20. build_glob.py
  21. c14n.c
  22. catalog.c
  23. ChangeLog
  24. check-relaxng-test-suite.py
  25. check-relaxng-test-suite2.py
  26. check-xinclude-test-suite.py
  27. check-xml-test-suite.py
  28. check-xsddata-test-suite.py
  29. chvalid.c
  30. chvalid.def
  31. configure.in
  32. Copyright
  33. dbgen.pl
  34. dbgenattr.pl
  35. debugXML.c
  36. dict.c
  37. DOCBparser.c
  38. elfgcchack.h
  39. enc.h
  40. encoding.c
  41. entities.c
  42. error.c
  43. genChRanges.py
  44. gentest.py
  45. genUnicode.py
  46. global.data
  47. globals.c
  48. HACKING
  49. hash.c
  50. HTMLparser.c
  51. HTMLtree.c
  52. INSTALL.libxml2
  53. legacy.c
  54. libxml-2.0-uninstalled.pc.in
  55. libxml-2.0.pc.in
  56. libxml.3
  57. libxml.h
  58. libxml.m4
  59. libxml.spec.in
  60. libxml2.doap
  61. libxml2.syms
  62. list.c
  63. MAINTAINERS
  64. Makefile.am
  65. Makefile.tests
  66. Makefile.win
  67. nanoftp.c
  68. nanohttp.c
  69. NEWS
  70. parser.c
  71. parserInternals.c
  72. pattern.c
  73. README
  74. README.cvs-commits
  75. README.tests
  76. regressions.py
  77. regressions.xml
  78. relaxng.c
  79. rngparser.c
  80. runsuite.c
  81. runtest.c
  82. runxmlconf.c
  83. save.h
  84. SAX.c
  85. SAX2.c
  86. schematron.c
  87. testapi.c
  88. testAutomata.c
  89. testC14N.c
  90. testchar.c
  91. testdict.c
  92. testdso.c
  93. testHTML.c
  94. testlimits.c
  95. testModule.c
  96. testOOM.c
  97. testOOMlib.c
  98. testOOMlib.h
  99. testReader.c
  100. testrecurse.c
  101. testRegexp.c
  102. testRelax.c
  103. testSAX.c
  104. testSchemas.c
  105. testThreads.c
  106. testThreadsWin32.c
  107. testURI.c
  108. testXPath.c
  109. threads.c
  110. timsort.h
  111. TODO
  112. TODO_SCHEMAS
  113. tree.c
  114. trio.c
  115. trio.h
  116. triodef.h
  117. trionan.c
  118. trionan.h
  119. triop.h
  120. triostr.c
  121. triostr.h
  122. uri.c
  123. valid.c
  124. xinclude.c
  125. xlink.c
  126. xml2-config.1
  127. xml2-config.in
  128. xml2Conf.sh.in
  129. xmlcatalog.c
  130. xmlIO.c
  131. xmllint.c
  132. xmlmemory.c
  133. xmlmodule.c
  134. xmlreader.c
  135. xmlregexp.c
  136. xmlsave.c
  137. xmlschemas.c
  138. xmlschemastypes.c
  139. xmlstring.c
  140. xmlunicode.c
  141. xmlwriter.c
  142. xpath.c
  143. xpointer.c
  144. xzlib.c
  145. xzlib.h