diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-07-22 00:56:07 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-07-22 00:38:17 +0200 |
commit | 0d4cbdbc9cd4ab06056cec66cffd292b41615b6e (patch) | |
tree | 74fc68755a97c7598baedee98dcc35c750ae8abd /sw/source/uibase/shells/drawdlg.cxx | |
parent | 697e9f3cc9cb3309bf7e22bc39057ff720f1d1b3 (diff) |
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.kaganski@collabora.com>
Diffstat (limited to 'sw/source/uibase/shells/drawdlg.cxx')
-rw-r--r-- | sw/source/uibase/shells/drawdlg.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
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) |