summaryrefslogtreecommitdiffstats
path: root/external
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-11-17 10:27:03 +0000
committerCaolán McNamara <caolanm@redhat.com>2021-11-17 13:43:22 +0100
commit037d5454a39260635aeb7064ac32c7a485af8197 (patch)
tree5ad1c16476dc34b30186233b09687d23e7a7e58e /external
parentdon't attempt to set cursor to first entry if there are no entries (diff)
downloadcore-037d5454a39260635aeb7064ac32c7a485af8197.tar.gz
core-037d5454a39260635aeb7064ac32c7a485af8197.zip
crashtesting: crash on passing null to std::string_view
with many documents, e.g. moz377878-1.xhtml https: //gitlab.com/orcus/orcus/-/merge_requests/113 Change-Id: I085543ebb28c02a1c0ec487b357f6e0a83004363 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125378 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'external')
-rw-r--r--external/liborcus/UnpackedTarball_liborcus.mk4
-rw-r--r--external/liborcus/crashtesting-crash-on-passing-null-to-std-string_vie.patch.127
2 files changed, 31 insertions, 0 deletions
diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk
index 3d2cec42e55e..86c30431e05d 100644
--- a/external/liborcus/UnpackedTarball_liborcus.mk
+++ b/external/liborcus/UnpackedTarball_liborcus.mk
@@ -15,6 +15,9 @@ $(eval $(call gb_UnpackedTarball_set_patchlevel,liborcus,1))
$(eval $(call gb_UnpackedTarball_update_autoconf_configs,liborcus))
+# crashtesting-crash-on-passing-null-to-std-string_vie.patch.1 submitted as
+# https://gitlab.com/orcus/orcus/-/merge_requests/113
+
$(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
external/liborcus/rpath.patch.0 \
external/liborcus/gcc9.patch.0 \
@@ -25,6 +28,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\
external/liborcus/unused-variables.patch.1 \
external/liborcus/boost-filesystem.patch.1 \
external/liborcus/std-get-busted.patch.1 \
+ external/liborcus/crashtesting-crash-on-passing-null-to-std-string_vie.patch.1 \
))
ifeq ($(OS),WNT)
diff --git a/external/liborcus/crashtesting-crash-on-passing-null-to-std-string_vie.patch.1 b/external/liborcus/crashtesting-crash-on-passing-null-to-std-string_vie.patch.1
new file mode 100644
index 000000000000..97e7b8366fde
--- /dev/null
+++ b/external/liborcus/crashtesting-crash-on-passing-null-to-std-string_vie.patch.1
@@ -0,0 +1,27 @@
+From ed21a93e132b968d8cd91aa080e1f90e980267c7 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
+Date: Wed, 17 Nov 2021 10:21:32 +0000
+Subject: [PATCH] crashtesting: crash on passing null to std::string_view
+
+with many documents, e.g. moz377878-1.xhtml
+---
+ src/parser/xml_namespace.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/parser/xml_namespace.cpp b/src/parser/xml_namespace.cpp
+index 07942563..66077d9c 100644
+--- a/src/parser/xml_namespace.cpp
++++ b/src/parser/xml_namespace.cpp
+@@ -223,7 +223,8 @@ xmlns_id_t xmlns_context::push(std::string_view key, std::string_view uri)
+ #endif
+ mp_impl->m_trim_all_ns = true;
+
+- std::string_view uri_interned = mp_impl->repo->intern(uri);
++ xmlns_id_t id = mp_impl->repo->intern(uri);
++ std::string_view uri_interned = id ? std::string_view(id) : std::string_view();
+
+ if (key.empty())
+ {
+--
+2.33.1
+