cui/source/dialogs/welcomedlg.cxx | 6 ++++-- cui/source/inc/welcomedlg.hxx | 2 ++ cui/source/options/appearance.cxx | 4 +++- cui/source/options/appearance.hxx | 1 + sc/source/ui/inc/duplicaterecordsdlg.hxx | 1 + sc/source/ui/miscdlgs/duplicaterecordsdlg.cxx | 4 +++- sd/source/ui/dlg/morphdlg.cxx | 2 +- sfx2/inc/autoredactdialog.hxx | 2 ++ sfx2/source/doc/autoredactdialog.cxx | 6 ++++-- starmath/source/dialog.cxx | 7 ++++++- sw/source/ui/fldui/javaedit.cxx | 7 ++++++- sw/source/uibase/inc/javaedit.hxx | 1 + vcl/inc/jsdialog/jsdialogsender.hxx | 2 ++ vcl/jsdialog/jsdialogsender.cxx | 4 +++- vcl/source/filter/ipdf/pdfread.cxx | 5 +++++ vcl/source/text/textlayout.cxx | 9 ++++++++- 16 files changed, 52 insertions(+), 11 deletions(-)
New commits: commit acbe02d2e2d5935dc2324eb168ae19df28e97b3b Author: Caolán McNamara <[email protected]> AuthorDate: Sun Oct 12 12:48:19 2025 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Sun Oct 12 20:00:15 2025 +0200 ofz#451188537 Null-dereference READ Change-Id: Ida4e0deb43eb04ec0286645bb84d3c6bbb8e1e5c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192245 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/vcl/source/filter/ipdf/pdfread.cxx b/vcl/source/filter/ipdf/pdfread.cxx index cc609f7cf40e..84dc9f810922 100644 --- a/vcl/source/filter/ipdf/pdfread.cxx +++ b/vcl/source/filter/ipdf/pdfread.cxx @@ -410,6 +410,11 @@ size_t ImportPDFUnloaded(SvStream& rStream, std::vector<PDFGraphicResult>& rGrap Graphic aGraphic(pGfxLink, nPageIndex); auto pPage = pPdfDocument->openPage(nPageIndex); + if (!pPage) + { + SAL_WARN("vcl.filter", "ImportPDF: unable to open page: " << nPageIndex); + continue; + } std::vector<PDFGraphicAnnotation> aPDFGraphicAnnotations = findAnnotations(pPage, aPageSize); commit 295d9b9afb70fbc1ff1f0b6fce745d9c79320929 Author: Caolán McNamara <[email protected]> AuthorDate: Sun Oct 12 12:30:57 2025 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Sun Oct 12 20:00:06 2025 +0200 cid#1659788 Uncaught exception and cid#1659768 Uncaught exception cid#1659734 Uncaught exception cid#1659719 Uncaught exception cid#1659715 Uncaught exception cid#1659689 Uncaught exception cid#1659665 Uncaught exception cid#1659614 Uncaught exception cid#1486702 Uncaught exception cid#1660487 Uncaught exception cid#1660210 Uncaught exception cid#1660077 Uncaught exception Change-Id: I472ad885bf167cc6c8767b703eb54b7d684fc114 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192244 Reviewed-by: Caolán McNamara <[email protected]> Tested-by: Jenkins diff --git a/cui/source/dialogs/welcomedlg.cxx b/cui/source/dialogs/welcomedlg.cxx index 2a71d546e734..ba665c565000 100644 --- a/cui/source/dialogs/welcomedlg.cxx +++ b/cui/source/dialogs/welcomedlg.cxx @@ -59,7 +59,7 @@ WelcomeDialog::WelcomeDialog(weld::Window* pParent, const bool bIsFirstStart) OnActivatePage(sNewsTab); } -WelcomeDialog::~WelcomeDialog() +void WelcomeDialog::ImplDestroy() { m_xTabCtrl->set_current_page(sNewsTab); // ensure next start with the first page if (!m_xShowAgain->get_active()) @@ -71,6 +71,8 @@ WelcomeDialog::~WelcomeDialog() } } +WelcomeDialog::~WelcomeDialog() { suppress_fun_call_w_exception(ImplDestroy()); } + void WelcomeDialog::PageCreated(const OUString& rId, SfxTabPage& rPage) { if (rId == sNewsTab) @@ -166,4 +168,4 @@ IMPL_LINK_NOARG(WelcomeDialog, OnActionClick, weld::Button&, void) } } -/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/cui/source/inc/welcomedlg.hxx b/cui/source/inc/welcomedlg.hxx index fab291fdc14a..20e678c9d94a 100644 --- a/cui/source/inc/welcomedlg.hxx +++ b/cui/source/inc/welcomedlg.hxx @@ -29,6 +29,8 @@ private: DECL_LINK(OnActionClick, weld::Button&, void); DECL_LINK(OnNextClick, weld::Button&, void); + void ImplDestroy(); + public: WelcomeDialog(weld::Window* pParent, const bool bIsFirstStart); virtual ~WelcomeDialog() override; diff --git a/cui/source/options/appearance.cxx b/cui/source/options/appearance.cxx index ed46b387ebc9..0244e83fb9bd 100644 --- a/cui/source/options/appearance.cxx +++ b/cui/source/options/appearance.cxx @@ -159,13 +159,15 @@ void SvxAppearanceTabPage::LoadSchemeList() m_xSchemeList->set_active_text(pColorConfig->GetCurrentSchemeName()); } -SvxAppearanceTabPage::~SvxAppearanceTabPage() +void SvxAppearanceTabPage::ImplDestroy() { if (m_bRestartRequired) ::svtools::executeRestartDialog(comphelper::getProcessComponentContext(), GetFrameWeld(), svtools::RESTART_REASON_THEME_CHANGE); } +SvxAppearanceTabPage::~SvxAppearanceTabPage() { suppress_fun_call_w_exception(ImplDestroy()); } + std::unique_ptr<SfxTabPage> SvxAppearanceTabPage::Create(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet* rSet) diff --git a/cui/source/options/appearance.hxx b/cui/source/options/appearance.hxx index 15cf0df176a3..761685418a94 100644 --- a/cui/source/options/appearance.hxx +++ b/cui/source/options/appearance.hxx @@ -84,6 +84,7 @@ private: void UpdateBmpControlsState(); void UpdateColorDropdown(); void FillItemsList(); + void ImplDestroy(); ColorConfigEntry GetActiveEntry(); public: diff --git a/sc/source/ui/inc/duplicaterecordsdlg.hxx b/sc/source/ui/inc/duplicaterecordsdlg.hxx index 5977bad41191..cf09d2a1276f 100644 --- a/sc/source/ui/inc/duplicaterecordsdlg.hxx +++ b/sc/source/ui/inc/duplicaterecordsdlg.hxx @@ -69,6 +69,7 @@ private: DuplicatesResponse maResponse; void InsertEntry(const OUString& rTxt, bool bToggle); + void ImplDestroy(); DECL_LINK(OrientationHdl, weld::Toggleable&, void); DECL_LINK(HeaderCkbHdl, weld::Toggleable&, void); diff --git a/sc/source/ui/miscdlgs/duplicaterecordsdlg.cxx b/sc/source/ui/miscdlgs/duplicaterecordsdlg.cxx index 0786ebbf13fb..4f074833cfb5 100644 --- a/sc/source/ui/miscdlgs/duplicaterecordsdlg.cxx +++ b/sc/source/ui/miscdlgs/duplicaterecordsdlg.cxx @@ -50,7 +50,7 @@ ScDuplicateRecordsDlg::ScDuplicateRecordsDlg(weld::Window* pParent, Init(); } -ScDuplicateRecordsDlg::~ScDuplicateRecordsDlg() +void ScDuplicateRecordsDlg::ImplDestroy() { auto pChange(comphelper::ConfigurationChanges::create()); officecfg::Office::Calc::Misc::HandleDuplicateRecords::RemoveDuplicateRows::set( @@ -66,6 +66,8 @@ ScDuplicateRecordsDlg::~ScDuplicateRecordsDlg() pChange->commit(); } +ScDuplicateRecordsDlg::~ScDuplicateRecordsDlg() { suppress_fun_call_w_exception(ImplDestroy()); } + void ScDuplicateRecordsDlg::SetDialogData(bool bToggle) { m_xCheckList->freeze(); diff --git a/sd/source/ui/dlg/morphdlg.cxx b/sd/source/ui/dlg/morphdlg.cxx index 7025b8e6e738..332a61e1dd3e 100644 --- a/sd/source/ui/dlg/morphdlg.cxx +++ b/sd/source/ui/dlg/morphdlg.cxx @@ -60,7 +60,7 @@ MorphDlg::MorphDlg(weld::Window* pParent, const SdrObject* pObj1, const SdrObjec MorphDlg::~MorphDlg() { - SaveSettings(); + suppress_fun_call_w_exception(SaveSettings()); } void MorphDlg::LoadSettings() diff --git a/sfx2/inc/autoredactdialog.hxx b/sfx2/inc/autoredactdialog.hxx index af23d80e18e5..203c8ecf0a53 100644 --- a/sfx2/inc/autoredactdialog.hxx +++ b/sfx2/inc/autoredactdialog.hxx @@ -105,6 +105,8 @@ class SfxAutoRedactDialog final : public SfxDialogController /// Clear all targets both visually and from the targets vector void clearTargets(); + void ImplDestroy(); + public: SfxAutoRedactDialog(weld::Window* pParent); virtual ~SfxAutoRedactDialog() override; diff --git a/sfx2/source/doc/autoredactdialog.cxx b/sfx2/source/doc/autoredactdialog.cxx index 24c50af43f62..b8ec3f5b2921 100644 --- a/sfx2/source/doc/autoredactdialog.cxx +++ b/sfx2/source/doc/autoredactdialog.cxx @@ -12,7 +12,7 @@ #include <sfx2/filedlghelper.hxx> #include <sfx2/sfxresid.hxx> #include <sfx2/strings.hrc> - +#include <o3tl/deleter.hxx> #include <osl/file.hxx> #include <sal/log.hxx> #include <vcl/svapp.hxx> @@ -626,7 +626,7 @@ SfxAutoRedactDialog::SfxAutoRedactDialog(weld::Window* pParent) m_aTargetsBox.connect_row_activated(LINK(this, SfxAutoRedactDialog, DoubleClickEditHdl)); } -SfxAutoRedactDialog::~SfxAutoRedactDialog() +void SfxAutoRedactDialog::ImplDestroy() { if (m_aTableTargets.empty()) { @@ -671,6 +671,8 @@ SfxAutoRedactDialog::~SfxAutoRedactDialog() } } +SfxAutoRedactDialog::~SfxAutoRedactDialog() { suppress_fun_call_w_exception(ImplDestroy()); } + bool SfxAutoRedactDialog::hasTargets() const { //TODO: Add also some validity checks? diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 8fd4914e30f2..a6a346be8e44 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -208,13 +208,18 @@ SmPrintOptionsTabPage::SmPrintOptionsTabPage(weld::Container* pPage, weld::Dialo Reset(&rOptions); } -SmPrintOptionsTabPage::~SmPrintOptionsTabPage() +static void ImplDestroy() { if (SmViewShell *pViewSh = SmGetActiveView()) if (SmEditWindow* pEdit = pViewSh->GetEditWindow()) pEdit->UpdateStatus(); } +SmPrintOptionsTabPage::~SmPrintOptionsTabPage() +{ + suppress_fun_call_w_exception(ImplDestroy()); +} + OUString SmPrintOptionsTabPage::GetAllStrings() { OUString sAllStrings; diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx index 1dfe851167bb..841eb7bba521 100644 --- a/sw/source/ui/fldui/javaedit.cxx +++ b/sw/source/ui/fldui/javaedit.cxx @@ -71,13 +71,18 @@ SwJavaEditDialog::SwJavaEditDialog(weld::Window* pParent, SwWrtShell* pWrtSh) UpdateFromRadioButtons(); } -SwJavaEditDialog::~SwJavaEditDialog() +void SwJavaEditDialog::ImplDestroy() { m_pSh->EnterStdMode(); m_pMgr.reset(); m_pFileDlg.reset(); } +SwJavaEditDialog::~SwJavaEditDialog() +{ + suppress_fun_call_w_exception(ImplDestroy()); +} + IMPL_LINK_NOARG(SwJavaEditDialog, PrevHdl, weld::Button&, void) { m_pSh->EnterStdMode(); diff --git a/sw/source/uibase/inc/javaedit.hxx b/sw/source/uibase/inc/javaedit.hxx index 0b4ca37cab07..9b9b642b02ef 100644 --- a/sw/source/uibase/inc/javaedit.hxx +++ b/sw/source/uibase/inc/javaedit.hxx @@ -60,6 +60,7 @@ private: void UpdateFromRadioButtons(); void CheckTravel(); void SetField(); + void ImplDestroy(); public: SwJavaEditDialog(weld::Window* pParent, SwWrtShell* pWrtSh); diff --git a/vcl/inc/jsdialog/jsdialogsender.hxx b/vcl/inc/jsdialog/jsdialogsender.hxx index 5bc95f4df049..6fdb00185c73 100644 --- a/vcl/inc/jsdialog/jsdialogsender.hxx +++ b/vcl/inc/jsdialog/jsdialogsender.hxx @@ -35,6 +35,8 @@ class JSDialogSender { std::unique_ptr<JSDialogNotifyIdle> mpIdleNotify; + void ImplDestroy(); + protected: bool m_bCanClose; // specifies if can send a close message diff --git a/vcl/jsdialog/jsdialogsender.cxx b/vcl/jsdialog/jsdialogsender.cxx index 3b1a499b6f3e..1ca544647140 100644 --- a/vcl/jsdialog/jsdialogsender.cxx +++ b/vcl/jsdialog/jsdialogsender.cxx @@ -295,7 +295,7 @@ void JSDialogNotifyIdle::Invoke() void JSDialogNotifyIdle::clearQueue() { m_aMessageQueue.clear(); } -JSDialogSender::~JSDialogSender() +void JSDialogSender::ImplDestroy() { sendClose(); @@ -303,6 +303,8 @@ JSDialogSender::~JSDialogSender() mpIdleNotify->Stop(); } +JSDialogSender::~JSDialogSender() { suppress_fun_call_w_exception(ImplDestroy()); } + void JSDialogSender::sendFullUpdate(bool bForce) { if (!mpIdleNotify) diff --git a/vcl/source/text/textlayout.cxx b/vcl/source/text/textlayout.cxx index 50ab30d921d9..8705459df647 100644 --- a/vcl/source/text/textlayout.cxx +++ b/vcl/source/text/textlayout.cxx @@ -520,6 +520,8 @@ namespace vcl private: + void ImplDestroy(); + OutputDevice& m_rTargetDevice; OutputDevice& m_rReferenceDevice; const bool m_bRTLEnabled; @@ -570,12 +572,17 @@ namespace vcl m_rReferenceDevice.SetFont( aRefFont ); } - ReferenceDeviceTextLayout::~ReferenceDeviceTextLayout() + void ReferenceDeviceTextLayout::ImplDestroy() { m_rReferenceDevice.Pop(); m_rTargetDevice.Pop(); } + ReferenceDeviceTextLayout::~ReferenceDeviceTextLayout() + { + suppress_fun_call_w_exception(ImplDestroy()); + } + namespace { bool lcl_normalizeLength( std::u16string_view _rText, const sal_Int32 _nStartIndex, sal_Int32& _io_nLength )
