summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-09-12 19:28:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-09-12 21:20:59 +0200
commit34d229cecadba9d216d7b1111146a1bace84983e (patch)
treebc873f59700c06746a9c915a2a515f01b38c605b /sc/source
parent38afbf56f0783d7442e63b58ffae9cf111c04edf (diff)
ofz: avoid std::basic_string from boost::filesystem
workaround this problem for now by skipping the problematic path so fuzzers don't fail immediately ==706226==WARNING: MemorySanitizer: use-of-uninitialized-value #0 0x161c3bf7 in ~basic_string /usr/local/bin/../include/c++/v1/string:2267:9 #1 0x161c3bf7 in ~path workdir/UnpackedTarball/boost/boost/filesystem/path.hpp:83:9 #2 0x161c3bf7 in ~impl workdir/UnpackedTarball/boost/boost/filesystem/exception.hpp:78:10 #3 0x161c3bf7 in intrusive_ptr_release<boost::filesystem::filesystem_error::impl, boost::sp_adl_block::thread_safe_counter> workdir/UnpackedTarball/boost/boost/smart_ptr/intrusive_ref_counter.hpp:173:9 #4 0x161c3bf7 in boost::intrusive_ptr<boost::filesystem::filesystem_error::impl>::~intrusive_ptr() workdir/UnpackedTarball/boost/boost/smart_ptr/intrusive_ptr.hpp:98:23 #5 0x161c4c14 in boost::filesystem::filesystem_error::~filesystem_error() workdir/UnpackedTarball/boost/libs/filesystem/src/exception.cpp:79:1 #6 0x174134a1 in __cxa_end_catch (/out/fodsfuzzer+0x174134a1) #7 0xf22faa1 in ScOrcusFiltersImpl::importODS_Styles(ScDocument&, rtl::OUString&) const /src/libreoffice/sc/source/filter/orcus/orcusfiltersimpl.cxx:164:5 #8 0x8c1c64 in ScDocShell::InitNew(com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&) /src/libreoffice/sc/source/ui/docshell/docsh2.cxx:77:21 #9 0x51e73cc in SfxObjectShell::DoInitNew(SfxMedium*) /src/libreoffice/sfx2/source/doc/objstor.cxx:470:10 #10 0x6cf506 in TestImportFODS /src/libreoffice/sc/source/filter/xml/xmlimprt.cxx:1675:13 #11 0x698137 in LLVMFuzzerTestOneInput /src/libreoffice/vcl/workben/fodsfuzzer.cxx:30:11 #12 0x5e8603 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) cxa_noexception.cpp #13 0x5d54a2 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerDriver.cpp:324:6 #14 0x5daecb in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) cxa_noexception.cpp #15 0x5ffd62 in main /src/llvm-project/compiler-rt/lib/fuzzer/FuzzerMain.cpp:20:10 #16 0x7f15c66ee0b2 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x270b2) #17 0x5b293d in _start (/out/fodsfuzzer+0x5b293d) Change-Id: Ie8a9d376f902a391551237b833236c2203525555 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122010 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/docshell/docsh2.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index e02b815d2181..46089387f86a 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -61,6 +61,7 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
m_aDocument.GetStyleSheetPool()->CreateStandardStyles();
m_aDocument.UpdStlShtPtrsFrmNms();
+#if !defined(FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION)
if (!m_bUcalcTest)
{
/* Create styles that are imported through Orcus */
@@ -78,6 +79,7 @@ bool ScDocShell::InitNew( const uno::Reference < embed::XStorage >& xStor )
m_aDocument.GetStyleSheetPool()->setAllParaStandard();
}
}
+#endif
// SetDocumentModified is not allowed anymore in Load/InitNew!
InitItems();