Propagate memory errors in xmlXPathCompExprAdd

Make sure that memory errors in xmlXPathCompExprAdd are propagated to
the parser context. Hitting the step limit or running out of memory
without raising an error could also lead to an out-of-bounds read.

Also fixes a memory leak in xmlXPathErrMemory.

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