malloc-fail: Fix OOB read after xmlRegGetCounter

Found with libFuzzer, see #344.

(cherry picked from commit 1743c4c3fc58cf38ecce68db9de51d0f3651e033)

I also copied the error label from
e64653c0e7975594e27d7de2ed4be062c1e4ad03 to fix the build failure.

Bug: http://b/274231102
Test: TreeHugger
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:381160fc2a293d50a627c9e35bb34485bf97b6e7)
Merged-In: I3bad3e03092e17a761cb6e299aff848ebd35b6f4
Change-Id: I3bad3e03092e17a761cb6e299aff848ebd35b6f4
1 file changed
tree: f40b5f3d4e3018f154894d53f17a4715e888c9d1
  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. .travis.yml
  17. acinclude.m4
  18. Android.bp
  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. CleanSpec.mk
  35. compile
  36. config.h
  37. configure.ac
  38. CONTRIBUTING
  39. Copyright
  40. dbgen.pl
  41. dbgenattr.pl
  42. debugXML.c
  43. dict.c
  44. DOCBparser.c
  45. elfgcchack.h
  46. enc.h
  47. encoding.c
  48. entities.c
  49. error.c
  50. genChRanges.py
  51. gentest.py
  52. genUnicode.py
  53. global.data
  54. globals.c
  55. hash.c
  56. HTMLparser.c
  57. HTMLtree.c
  58. INSTALL.libxml2
  59. legacy.c
  60. libxml-2.0-uninstalled.pc.in
  61. libxml-2.0.pc.in
  62. libxml.3
  63. libxml.h
  64. libxml.m4
  65. libxml.spec.in
  66. libxml2-config.cmake.in
  67. libxml2.doap
  68. libxml2.syms
  69. list.c
  70. MAINTAINERS
  71. Makefile.am
  72. Makefile.tests
  73. Makefile.win
  74. METADATA
  75. MODULE_LICENSE_MIT
  76. nanoftp.c
  77. nanohttp.c
  78. NEWS
  79. OWNERS
  80. parser.c
  81. parserInternals.c
  82. pattern.c
  83. README
  84. README.cvs-commits
  85. README.tests
  86. README.zOS
  87. regressions.py
  88. regressions.xml
  89. relaxng.c
  90. rngparser.c
  91. runsuite.c
  92. runtest.c
  93. runxmlconf.c
  94. save.h
  95. SAX.c
  96. SAX2.c
  97. schematron.c
  98. testapi.c
  99. testAutomata.c
  100. testC14N.c
  101. testchar.c
  102. testdict.c
  103. testdso.c
  104. testHTML.c
  105. testlimits.c
  106. testModule.c
  107. testOOM.c
  108. testOOMlib.c
  109. testOOMlib.h
  110. testReader.c
  111. testrecurse.c
  112. testRegexp.c
  113. testRelax.c
  114. testSAX.c
  115. testSchemas.c
  116. testThreads.c
  117. testThreadsWin32.c
  118. testURI.c
  119. testXPath.c
  120. threads.c
  121. timsort.h
  122. TODO
  123. TODO_SCHEMAS
  124. tree.c
  125. trio.c
  126. trio.h
  127. triodef.h
  128. trionan.c
  129. trionan.h
  130. triop.h
  131. triostr.c
  132. triostr.h
  133. uri.c
  134. valid.c
  135. xinclude.c
  136. xlink.c
  137. xml2-config.1
  138. xml2-config.in
  139. xml2Conf.sh.in
  140. xmlcatalog.c
  141. xmlIO.c
  142. xmllint.c
  143. xmlmemory.c
  144. xmlmodule.c
  145. xmlreader.c
  146. xmlregexp.c
  147. xmlsave.c
  148. xmlschemas.c
  149. xmlschemastypes.c
  150. xmlstring.c
  151. xmlunicode.c
  152. xmlwriter.c
  153. xpath.c
  154. xpointer.c
  155. xzlib.c
  156. xzlib.h