external/liborcus/UnpackedTarball_liborcus.mk | 2 + external/liborcus/forcepoint-87.patch.1 | 27 ++++++++++++++++ external/liborcus/forcepoint-88.patch.1 | 42 ++++++++++++++++++++++++++ 3 files changed, 71 insertions(+)
New commits: commit 87259aef31a0411ccc8cb045ceb1365c23e917e5 Author: Caolán McNamara <[email protected]> AuthorDate: Fri Mar 25 10:14:19 2022 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Fri Mar 25 14:48:43 2022 +0100 forcepoint#88 temp std::string assigned to std::string_view Change-Id: I128a60b68a3af988e3a4bdb06994f43d9b18d67e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132102 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk index 948b92753539..562ab4e5fcd7 100644 --- a/external/liborcus/UnpackedTarball_liborcus.mk +++ b/external/liborcus/UnpackedTarball_liborcus.mk @@ -30,6 +30,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\ external/liborcus/forcepoint-83.patch.1 \ external/liborcus/forcepoint-84.patch.1 \ external/liborcus/forcepoint-87.patch.1 \ + external/liborcus/forcepoint-88.patch.1 \ )) ifeq ($(OS),WNT) diff --git a/external/liborcus/forcepoint-88.patch.1 b/external/liborcus/forcepoint-88.patch.1 new file mode 100644 index 000000000000..19d96f4d8315 --- /dev/null +++ b/external/liborcus/forcepoint-88.patch.1 @@ -0,0 +1,42 @@ +From 8c9537fe46b85acde0a7a183cee9066919c6b619 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <[email protected]> +Date: Fri, 25 Mar 2022 10:10:17 +0000 +Subject: [PATCH] forcepoint#88 assigned temp std::string return to string_view + +it's out of scope when used + +=ERROR: AddressSanitizer: stack-use-after-scope on address 0x7ffcaf91b111 at pc 0x000000486ec4 bp 0x7ffcaf91aed0 sp 0x7ffcaf91a680 +READ of size 2 at 0x7ffcaf91b111 thread T0 + #0 0x486ec3 in __interceptor_memcpy.part.0 (instdir/program/soffice.bin+0x486ec3) + #1 0x7fa6c4471b77 in std::basic_streambuf<char, std::char_traits<char> >::xsputn(char const*, long) (/lib64/libstdc++.so.6+0x143b77) + #2 0x7fa6c4463ae3 in std::basic_ostream<char, std::char_traits<char> >& std::__ostream_insert<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*, long) (/lib64/libstdc++.so.6+0x135ae3) + #3 0x7fa6b4027a26 in std::basic_ostream<char, std::char_traits<char> >& std::operator<<<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, std::basic_string_view<char, std::char_traits<char> >) /usr/bin/../lib/gcc/x86_64-redhat-linux/11/../../../../include/c++/11/string_view:669:14 + #4 0x7fa6b426792b in orcus::xml_element_printer::print_namespace(std::ostream&, char const*) const workdir/UnpackedTarball/liborcus/src/liborcus/xml_util.cpp:35:12 + #5 0x7fa6b4267c68 in orcus::xml_element_printer::print_element(std::ostream&, char const*, unsigned long) const workdir/UnpackedTarball/liborcus/src/liborcus/xml_util.cpp:46:5 + #6 0x7fa6b41c1956 in orcus::xml_context_base::print_element(std::ostream&, std::pair<char const*, unsigned long> const&) const workdir/UnpackedTarball/liborcus/src/liborcus/xml_context_base.cpp:280:20 +--- + src/liborcus/xml_util.cpp | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/liborcus/xml_util.cpp b/src/liborcus/xml_util.cpp +index 906d321d..ff270d4a 100644 +--- a/src/liborcus/xml_util.cpp ++++ b/src/liborcus/xml_util.cpp +@@ -29,10 +29,10 @@ void xml_element_printer::print_namespace(std::ostream& os, xmlns_id_t ns) const + if (mp_ns_cxt) + { + std::string_view alias = mp_ns_cxt->get_alias(ns); +- if (alias.empty()) +- alias = mp_ns_cxt->get_short_name(ns); +- +- os << alias; ++ if (!alias.empty()) ++ os << alias; ++ else ++ os << mp_ns_cxt->get_short_name(ns); + } + else + os << ns; +-- +2.35.1 + commit 32019baffa19a8f79cacf93d5dd5a95c7d416657 Author: Caolán McNamara <[email protected]> AuthorDate: Fri Mar 25 09:12:30 2022 +0000 Commit: Caolán McNamara <[email protected]> CommitDate: Fri Mar 25 14:48:28 2022 +0100 forcepoint#87 Assertion 'mp_char <= mp_end' failed Change-Id: I434928cb2425a2e8eb9440dff67f52cda241b2d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132097 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/external/liborcus/UnpackedTarball_liborcus.mk b/external/liborcus/UnpackedTarball_liborcus.mk index 8f41fdbf9173..948b92753539 100644 --- a/external/liborcus/UnpackedTarball_liborcus.mk +++ b/external/liborcus/UnpackedTarball_liborcus.mk @@ -29,6 +29,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,liborcus,\ external/liborcus/std-get-busted.patch.1 \ external/liborcus/forcepoint-83.patch.1 \ external/liborcus/forcepoint-84.patch.1 \ + external/liborcus/forcepoint-87.patch.1 \ )) ifeq ($(OS),WNT) diff --git a/external/liborcus/forcepoint-87.patch.1 b/external/liborcus/forcepoint-87.patch.1 new file mode 100644 index 000000000000..c1a58dde59c4 --- /dev/null +++ b/external/liborcus/forcepoint-87.patch.1 @@ -0,0 +1,27 @@ +From e4f3741197a3af6d434850d388483b523138a214 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <[email protected]> +Date: Thu, 24 Mar 2022 21:31:14 +0000 +Subject: [PATCH] forcepoint#87 Assertion `mp_char <= mp_end' failed + +soffice.bin: ../../include/orcus/parser_base.hpp:65: bool orcus::parser_base::has_char() const: Assertion `mp_char <= mp_end' failed. +--- + src/parser/sax_parser_base.cpp | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/src/parser/sax_parser_base.cpp b/src/parser/sax_parser_base.cpp +index 46acb81d..cb7a9c04 100644 +--- a/src/parser/sax_parser_base.cpp ++++ b/src/parser/sax_parser_base.cpp +@@ -295,7 +295,8 @@ void parser_base::value_with_encoded_char(cell_buffer& buf, std::string_view& st + + // Skip the closing quote. + assert(!has_char() || cur_char() == quote_char); +- next(); ++ if (has_char()) ++ next(); + } + + bool parser_base::value(std::string_view& str, bool decode) +-- +2.35.1 +
