[Libreoffice-commits] core.git: Branch 'libreoffice-7-2' - sc/source sw/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Thu Jul 22 08:57:04 UTC 2021


 sc/source/ui/drawfunc/drawsh2.cxx   |    4 ++--
 sw/source/uibase/shells/drawdlg.cxx |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 06f7757bd377c6dbeada7941249371ab5b31bbad
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Jul 22 00:56:07 2021 +0300
Commit:     Michael Stahl <michael.stahl at allotropia.de>
CommitDate: Thu Jul 22 10:56:29 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.kaganski at collabora.com>
    (cherry picked from commit 0d4cbdbc9cd4ab06056cec66cffd292b41615b6e)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119259
    Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>

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)


More information about the Libreoffice-commits mailing list