summaryrefslogtreecommitdiff
path: root/sc/source/filter/oox
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2023-06-26 10:43:34 -0400
committerCaolán McNamara <caolan.mcnamara@collabora.com>2023-06-26 21:06:56 +0200
commit2f6859071031841be0126bc01587fcef0f8b8208 (patch)
tree246abdd2819ad8e73c6ef2a62dbf91f7e59fc101 /sc/source/filter/oox
parent633be9b03c870d9f242279e7f8617ae6daaef460 (diff)
sc: filter: oox: fix crash delete ScDatabarFormatData
Unfortunately, the instance of "ScDatabarFormatData" is deleted before finalizeImport is called. The "maEntries" is not usable, the global format buffer is required to hold the reference. #1 0x7f2ef19081c0 in oox::xls::CondFormatBuffer::finalizeImport() co-23.05-asan/sc/source/filter/oox/condformatbuffer.cxx:1322:23 #2 0x7f2ef1b9999a in oox::xls::WorksheetGlobals::finalizeWorksheetImport() co-23.05-asan/sc/source/filter/oox/worksheethelper.cxx:942:22 #3 0x7f2ef58d030e in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) co-23.05-asan/sax/source/fastparser/fastparser.cxx:910:36 #4 0x7f2ef23f0e46 in oox::core::FastParser::parseStream(com::sun::star::xml::sax::InputSource const&, bool) co-23.05-asan/oox/source/core/fastparser.cxx:121:15 #5 0x7f2ef23f1544 in Signed-off-by: Henry Castro <hcastro@collabora.com> Change-Id: Ieb3840cc10372867d5462a19d9efa9771f633437 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153601 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc/source/filter/oox')
-rw-r--r--sc/source/filter/oox/condformatbuffer.cxx5
-rw-r--r--sc/source/filter/oox/extlstcontext.cxx2
2 files changed, 6 insertions, 1 deletions
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index 75171441c23d..649c2417f348 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -1376,6 +1376,11 @@ std::vector< std::unique_ptr<ExtCfCondFormat> >& CondFormatBuffer::importExtCond
return maExtCondFormats;
}
+std::vector<std::unique_ptr<ScFormatEntry> >& CondFormatBuffer::importExtFormatEntries()
+{
+ return maExtFormatEntries;
+}
+
sal_Int32 CondFormatBuffer::convertToApiOperator( sal_Int32 nToken )
{
switch( nToken )
diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx
index 3209c846f9ce..58e4c7931729 100644
--- a/sc/source/filter/oox/extlstcontext.cxx
+++ b/sc/source/filter/oox/extlstcontext.cxx
@@ -174,7 +174,7 @@ ContextHandlerRef ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl
{
auto pFormat = std::make_unique<ScDataBarFormat>(&getScDocument());
pFormat->SetDataBarData(pInfo);
- maEntries.push_back(std::move(pFormat));
+ getCondFormats().importExtFormatEntries().push_back(std::move(pFormat));
}
}
else