Fix UBSan null-pointer-use

Desktop / LibreOffice - Stephan Bergmann [redhat.com] - 7 November 2019 18:40 EST

...during CppunitTest_sw_mailmerge (see below). Not sure why this started now, and no idea whether pWin can legitimately be null there in SfxWorkWindow::HidePopups_Impl, but the fix looks harmless enough to just do it.

> sfx2/source/appl/workwin.cxx:1512:52: runtime error: reference binding to null pointer of type 'const vcl::Window' > #0 in SfxWorkWindow::HidePopups_Impl(bool, unsigned short) at sfx2/source/appl/workwin.cxx:1512:37 > #1 in SfxDispatcher::DoActivate_Impl(bool) at sfx2/source/control/dispatch.cxx:706:56 > #2 in SfxViewFrame::DoActivate(bool) at sfx2/source/view/viewfrm.cxx:1175:20 > #3 in SfxApplication::SetViewFrame_Impl(SfxViewFrame*) at sfx2/source/appl/app.cxx:308:21 > #4 in SfxViewFrame::SetViewFrame(SfxViewFrame*) at sfx2/source/view/viewfrm.cxx:3268:19 > #5 in SfxViewFrame::MakeActive_Impl(bool) at sfx2/source/view/viewfrm.cxx:1879:9 > #6 in SfxBaseController::ConnectSfxFrame_Impl(SfxBaseController::ConnectSfxFrame) at sfx2/source/view/sfxbasecontroller.cxx:1254:33 > #7 in SfxBaseController::attachFrame(com::sun::star::uno::Reference const&) at sfx2/source/view/sfxbasecontroller.cxx:532:9 > #8 in (anonymous namespace)::SfxFrameLoader_Impl::impl_createDocumentView(com::sun::star::uno::Reference const&, com::sun::star::uno::Reference const&, comphelper::NamedValueCollection const&, rtl::OUString const&) > #9 in (anonymous namespace)::SfxFrameLoader_Impl::load(com::sun::star::uno::Sequence const&, com::sun::star::uno::Reference const&) at sfx2/source/view/frmload.cxx:714:13 > #10 in framework::LoadEnv::impl_loadContent() at framework/source/loadenv/loadenv.cxx:1157:37 > #11 in framework::LoadEnv::startLoading() at framework/source/loadenv/loadenv.cxx:390:20 > #12 in framework::LoadEnv::loadComponentFromURL(com::sun::star::uno::Reference const&, com::sun::star::uno::Reference const&, rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence const&) at framework/source/loadenv/loadenv.cxx:171:14 > #13 in framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence const&) at framework/source/services/desktop.cxx:621:12 > #14 in non-virtual thunk to framework::Desktop::loadComponentFromURL(rtl::OUString const&, rtl::OUString const&, int, com::sun::star::uno::Sequence const&) at framework/source/services/desktop.cxx > #15 in unotest::MacrosTest::loadFromDesktop(rtl::OUString const&, rtl::OUString const&, com::sun::star::uno::Sequence const&) at unotest/source/cpp/macros_test.cxx:48:62 > #16 in SwModelTestBase::loadURL(rtl::OUString const&, char const*, char const*) at sw/qa/extras/inc/swmodeltestbase.hxx:764:23 > #17 in SwModelTestBase::load(rtl::OUString const&, char const*, char const*) at sw/qa/extras/inc/swmodeltestbase.hxx:719:16 > #18 in MMTest::executeMailMerge(bool) at sw/qa/extras/mailmerge/mailmerge.cxx:209:9 > #19 in testTdf95292::verify() at sw/qa/extras/mailmerge/mailmerge.cxx:593:5 > #20 in MMTest::executeMailMergeTest(char const*, char const*, char const*, bool, int, char const*) at sw/qa/extras/mailmerge/mailmerge.cxx:88:9 > #21 in testTdf95292::MailMerge() at sw/qa/extras/mailmerge/mailmerge.cxx:590:1

Change-Id: Id9499c62cca6e1fcf3ba50b82117395106a93765 Reviewed-on: https://gerrit.libreoffice.org/82246

0f311cebd6b5 Fix UBSan null-pointer-use
sfx2/source/appl/workwin.cxx | 8 ++++----
sfx2/source/inc/workwin.hxx | 2 +-
2 files changed, 5 insertions(+), 5 deletions(-)

Upstream: cgit.freedesktop.org


  • Share