sc/source/ui/drawfunc/drawsh2.cxx | 4 ++-- sw/source/uibase/shells/drawdlg.cxx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
New commits: commit 0d4cbdbc9cd4ab06056cec66cffd292b41615b6e Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Thu Jul 22 00:56:07 2021 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Thu Jul 22 00:38:17 2021 +0200 Dereferencing uninitialized pointer SfxItemSet::GetItemState returns SfxItemState::DEFAULT without resetting the passed pointer. Regression after commit dd5bf12193471f064bf7f581dd1b21783390e735. Change-Id: I1e427a05f8e5b375f50d81b51d32e78fca83eb42 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119348 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx index 82609b657959..889c7efd33b3 100644 --- a/sc/source/ui/drawfunc/drawsh2.cxx +++ b/sc/source/ui/drawfunc/drawsh2.cxx @@ -390,13 +390,13 @@ void ScDrawShell::GetDrawAttrState( SfxItemSet& rSet ) if( bHasMarked ) { SfxAllItemSet aSet(pDrView->GetAttrFromMarked(false)); - if (const SfxPoolItem * pItem; + if (const SfxPoolItem* pItem = nullptr; aSet.GetItemState(SDRATTR_TEXTCOLUMNS_NUMBER, false, &pItem) >= SfxItemState::DEFAULT && pItem) { aSet.Put(pItem->CloneSetWhich(SID_ATTR_TEXTCOLUMNS_NUMBER)); } - if (const SfxPoolItem * pItem; + if (const SfxPoolItem* pItem = nullptr; aSet.GetItemState(SDRATTR_TEXTCOLUMNS_SPACING, false, &pItem) >= SfxItemState::DEFAULT && pItem) { diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx index b18ce9327b68..9922e9d79fa8 100644 --- a/sw/source/uibase/shells/drawdlg.cxx +++ b/sw/source/uibase/shells/drawdlg.cxx @@ -371,14 +371,14 @@ void SwDrawShell::GetDrawAttrState(SfxItemSet& rSet) SfxItemSet aSet(rSet); aSet.MergeRange(SDRATTR_TEXTCOLUMNS_NUMBER, SDRATTR_TEXTCOLUMNS_SPACING); pSdrView->GetAttributes(aSet); - if (const SfxPoolItem * pItem; + if (const SfxPoolItem* pItem = nullptr; aSet.GetItemState(SDRATTR_TEXTCOLUMNS_NUMBER, false, &pItem) >= SfxItemState::DEFAULT && pItem) { aSet.Put(pItem->CloneSetWhich(SID_ATTR_TEXTCOLUMNS_NUMBER)); } - if (const SfxPoolItem * pItem; + if (const SfxPoolItem* pItem = nullptr; aSet.GetItemState(SDRATTR_TEXTCOLUMNS_SPACING, false, &pItem) >= SfxItemState::DEFAULT && pItem) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits