diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-25 11:50:38 +0500 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-04-25 13:00:25 +0200 |
commit | e7df78e1d4ac17ae5a17c4a151eefe2a6f2b0e4a (patch) | |
tree | 8bc326e3c49ebc1a037d27df155dd9dd6382bde0 /xmloff | |
parent | e3ce4aad47c052dcd67107f7c91336f4ecc949be (diff) |
Fix UBSan failure: omission from 69ed893087f89d176a5ec4b263ce8d75774be72b
This failure was seen:
/xmloff/source/text/txtparai.cxx:1816:37: runtime error: downcast of address 0x604000d86710 which does not point to an object of type 'XMLStyleHint_Impl'
0x604000d86710: note: object is of type 'XMLTextFrameHint_Impl'
00 00 00 00 00 4b 83 40 b3 7f 00 00 70 bf 22 00 b0 60 00 00 70 bf 22 00 b0 60 00 00 06 00 00 00
^~~~~~~~~~~~~~~~~~~~~~~
vptr for 'XMLTextFrameHint_Impl'
#0 0x7fb33f2d224d in XMLParaContext::endFastElement(int) /xmloff/source/text/txtparai.cxx:1816:37
#1 0x7fb33dc76333 in SvXMLImport::endFastElement(int) /xmloff/source/core/xmlimp.cxx:885:15
#2 0x7fb36ee0bfca in (anonymous namespace)::Entity::endElement() /sax/source/fastparser/fastparser.cxx:514:27
#3 0x7fb36ee0b998 in sax_fastparser::FastSaxParserImpl::callbackEndElement() /sax/source/fastparser/fastparser.cxx:1331:17
#4 0x7fb36edfb444 in (anonymous namespace)::call_callbackEndElement(void*, unsigned char const*, unsigned char const*, unsigned char const*) /sax/source/fastparser/fastparser.cxx:338:18
#5 0x7fb3bacb8eaa in xmlParseEndTag2 /workdir/UnpackedTarball/libxml2/parser.c:10089:2
#6 0x7fb3bac5fa45 in xmlParseTryOrFinish /workdir/UnpackedTarball/libxml2/parser.c:11867:14
#7 0x7fb3bac533c4 in xmlParseChunk /workdir/UnpackedTarball/libxml2/parser.c:12150:5
#8 0x7fb36edf6231 in sax_fastparser::FastSaxParserImpl::parse() /sax/source/fastparser/fastparser.cxx:1085:21
#9 0x7fb36edefd18 in sax_fastparser::FastSaxParserImpl::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:890:9
#10 0x7fb36ee11950 in sax_fastparser::FastSaxParser::parseStream(com::sun::star::xml::sax::InputSource const&) /sax/source/fastparser/fastparser.cxx:1470:13
#11 0x7fb33dc60551 in SvXMLImport::parseStream(com::sun::star::xml::sax::InputSource const&) /xmloff/source/core/xmlimp.cxx:528:15
#12 0x7fb31916b4f1 in (anonymous namespace)::ReadThroughComponent(com::sun::star::uno::Reference<com::sun::star::io::XInputStream> const&, com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, char const*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, rtl::OUString const&, bool, bool) /sw/source/filter/xml/swxml.cxx:181:26
#13 0x7fb3191609f1 in (anonymous namespace)::ReadThroughComponent(com::sun::star::uno::Reference<com::sun::star::embed::XStorage> const&, com::sun::star::uno::Reference<com::sun::star::lang::XComponent> const&, char const*, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, char const*, com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&, rtl::OUString const&, bool) /sw/source/filter/xml/swxml.cxx:323:16
#14 0x7fb319159e4c in XMLReader::Read(SwDoc&, rtl::OUString const&, SwPaM&, rtl::OUString const&) /sw/source/filter/xml/swxml.cxx:833:16
#15 0x7fb3187eda73 in SwReader::Read(Reader const&) /sw/source/filter/basflt/shellio.cxx:203:22
#16 0x7fb3195ecd45 in SwDocShell::Load(SfxMedium&) /sw/source/uibase/app/docshini.cxx:533:37
#17 0x7fb382833c33 in SfxObjectShell::LoadOwnFormat(SfxMedium&) /sfx2/source/doc/objstor.cxx:3619:20
#18 0x7fb38283a353 in SfxObjectShell::DoLoad(SfxMedium*) /sfx2/source/doc/objstor.cxx:705:40
#19 0x7fb382aca503 in SfxBaseModel::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /sfx2/source/doc/sfxbasemodel.cxx:1980:36
#20 0x7fb38333d8c9 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&) /sfx2/source/view/frmload.cxx:720:28
#21 0x7fb371713419 in framework::LoadEnv::impl_loadContent() /framework/source/loadenv/loadenv.cxx:1176:37
#22 0x7fb37170a43b in framework::LoadEnv::start() /framework/source/loadenv/loadenv.cxx:412:20
#23 0x7fb371702a79 in framework::LoadEnv::startLoading(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&, com::sun::star::uno::Reference<com::sun::star::frame::XFrame> const&, rtl::OUString const&, int, LoadEnvFeatures) /framework/source/loadenv/loadenv.cxx:308:5
#24 0x7fb3716fe207 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference<com::sun::star::frame::XComponentLoader> const&, com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/loadenv/loadenv.cxx:168:14
#25 0x7fb3717d23fd in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/desktop.cxx:591:16
#26 0x7fb3717d2626 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /framework/source/services/desktop.cxx
#27 0x7fb3869f5afa in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /unotest/source/cpp/macros_test.cxx:71:62
#28 0x7fb38762dc56 in UnoApiTest::loadWithParams(rtl::OUString const&, com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> const&) /test/source/unoapi_test.cxx:126:19
#29 0x7fb38762cef8 in UnoApiTest::load(rtl::OUString const&, char const*) /test/source/unoapi_test.cxx:108:5
#30 0x7fb38762e254 in UnoApiTest::loadFromFile(std::basic_string_view<char16_t, std::char_traits<char16_t> >, char const*) /test/source/unoapi_test.cxx:132:5
#31 0x7fb38858966e in testPreserveJpg::TestBody() /filter/qa/unit/svg.cxx:52:5
...
See https://ci.libreoffice.org/job/lo_ubsan/3150/consoleFull#1179512796d893063f-7f3d-4b7e-b56f-4e0f225817cd
Change-Id: I1984ae555fada39fb6db6cadd326e5c8b9421b90
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166613
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/text/txtparai.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/xmloff/source/text/txtparai.cxx b/xmloff/source/text/txtparai.cxx index f2124bf068ed..816bf8769999 100644 --- a/xmloff/source/text/txtparai.cxx +++ b/xmloff/source/text/txtparai.cxx @@ -1809,7 +1809,8 @@ void XMLParaContext::endFastElement(sal_Int32 ) // created between commits 6249858a8972aef077e0249bd93cfe8f01bce4d6 and // 1a88efa8e02a6d765dab13c7110443bb9e6acecf, where the trailing empty spans // were used to store the marker formatting - if (!m_aMarkerStyleName.hasValue() + if (pHint->GetType() == XMLHintType::XML_HINT_STYLE + && !m_aMarkerStyleName.hasValue() && xCompare->compareRegionStarts(pHint->GetStart(), xEnd) == 0) { if (auto pStyle = GetImport().GetTextImport()->FindAutoCharStyle( |