summaryrefslogtreecommitdiff
path: root/external
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2018-02-21 20:08:23 -0500
committerAndras Timar <andras.timar@collabora.com>2018-02-22 11:24:59 +0100
commit10d6381de641ce5f82b22795496800cfbc1ed45d (patch)
tree29952fa1dfa5e25900bdef8365fa48a7d1315580 /external
parentf2ca825e4f76ae728d2ea9d8c2b7897174305667 (diff)
Patch liborcus to avoid incorrect parsing of XML.
Found by Antti Levomäki and Christian Jalio from Forcepoint. This one is not a backport from the master branch. On the master branch the same fix will come from updating liborcus from 0.13.3 to 0.13.4. (cherry picked from commit 160350de5f07024b22fb5a9b596918ccc7f22c75) Conflicts: external/liborcus/UnpackedTarball_liborcus.mk Change-Id: I701c5a65ff67d77767913f8d056682b9db549f84
Diffstat (limited to 'external')
-rw-r--r--external/liborcus/0001-protect-the-self-closing-xml-element-code-against-se.patch30
-rw-r--r--external/liborcus/UnpackedTarball_liborcus.mk1
2 files changed, 31 insertions, 0 deletions
diff --git a/external/liborcus/0001-protect-the-self-closing-xml-element-code-against-se.patch b/external/liborcus/0001-protect-the-self-closing-xml-element-code-against-se.patch
new file mode 100644
index 000000000000..990665f9c383
--- /dev/null
+++ b/external/liborcus/0001-protect-the-self-closing-xml-element-code-against-se.patch
@@ -0,0 +1,30 @@
+From 12e5d89cbd7101c61fbdf063322203a1590a0ef5 Mon Sep 17 00:00:00 2001
+From: Markus Mohrhard <markus.mohrhard@googlemail.com>
+Date: Wed, 21 Feb 2018 00:29:03 +0100
+Subject: [PATCH] protect the self-closing xml element code against
+ self-closing root elements
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Found by Antti Levomäki and Christian Jalio from Forcepoint.
+---
+ include/orcus/sax_parser.hpp | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/include/orcus/sax_parser.hpp b/include/orcus/sax_parser.hpp
+index ba5ebcd..67d5943 100644
+--- a/include/orcus/sax_parser.hpp
++++ b/include/orcus/sax_parser.hpp
+@@ -171,6 +171,8 @@ void sax_parser<_Handler,_Config>::element_open(std::ptrdiff_t begin_pos)
+ m_handler.start_element(elem);
+ reset_buffer_pos();
+ m_handler.end_element(elem);
++ if (!m_nest_level)
++ m_root_elem_open = false;
+ #if ORCUS_DEBUG_SAX_PARSER
+ cout << "element_open: ns='" << elem.ns << "', name='" << elem.name << "' (self-closing)" << endl;
+ #endif
+--
+2.7.4
+
diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk
index 93b988553116..791436e66016 100644
--- a/external/liborcus/UnpackedTarball_liborcus.mk
+++ b/external/liborcus/UnpackedTarball_liborcus.mk
@@ -18,6 +18,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
external/liborcus/rpath.patch.0 \
external/liborcus/visibility.patch.0 \
external/liborcus/nullptr-in-ostringstream.patch.1 \
+ external/liborcus/0001-protect-the-self-closing-xml-element-code-against-se.patch \
))
ifeq ($(OS),WNT)