[Libreoffice-commits] core.git: filter/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 2 19:06:05 UTC 2021


 filter/source/msfilter/svdfppt.cxx |   17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

New commits:
commit 9f51d973f65e85ab01e393fc0821a0b304efbae3
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Sep 2 08:46:09 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Sep 2 21:05:30 2021 +0200

    ofz: MemorySanitizer: use-of-uninitialized-value
    
    Change-Id: Ie666d56816b5af96590d482e2af204e0f6486bc6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121494
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 33386122440b..61e020a2987e 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -3949,11 +3949,11 @@ void PPTParaSheet::Read( SdrPowerPointImport const &
                     , sal_uInt32 nLevel, bool bFirst )
 {
     // paragraph attributes
-    sal_uInt16  nVal16, i, nMask16;
-    sal_uInt32  nVal32, nPMask;
-    rIn.ReadUInt32( nPMask );
+    sal_uInt16  nVal16;
+    sal_uInt32 nPMask(0);
+    rIn.ReadUInt32(nPMask);
 
-    nMask16 = static_cast<sal_uInt16>(nPMask) & 0xf;
+    sal_uInt16 nMask16 = static_cast<sal_uInt16>(nPMask) & 0xf;
     if ( nMask16 )
     {
         rIn.ReadUInt16( nVal16 );
@@ -3972,7 +3972,8 @@ void PPTParaSheet::Read( SdrPowerPointImport const &
     }
     if ( nPMask & 0x0020 )
     {
-        rIn.ReadUInt32( nVal32 );
+        sal_uInt32 nVal32(0);
+        rIn.ReadUInt32(nVal32);
         maParaLevel[ nLevel ].mnBulletColor = nVal32;
     }
     if ( bFirst )
@@ -3996,11 +3997,12 @@ void PPTParaSheet::Read( SdrPowerPointImport const &
             rIn.ReadUInt16( maParaLevel[ nLevel ].mnDefaultTab );
         if ( nPMask & 0x200000 )
         {
+            sal_uInt32 nVal32;
             // number of tabulators
             rIn.ReadUInt16( nVal16 );
             if (rIn.remainingSize() / sizeof(nVal32) < nVal16)
                 return;
-            for ( i = 0; i < nVal16; i++ )
+            for (sal_uInt16 i = 0; i < nVal16; ++i)
                 rIn.ReadUInt32( nVal32 );      // reading the tabulators
         }
         if ( nPMask & 0x40000 )
@@ -4046,9 +4048,10 @@ void PPTParaSheet::Read( SdrPowerPointImport const &
         }
         if ( nPMask & 0x100000 )
         {
+            sal_uInt32 nVal32;
             // number of tabulators
             rIn.ReadUInt16( nVal16 );
-            for ( i = 0; i < nVal16; i++ )
+            for (sal_uInt16 i = 0; i < nVal16; ++i)
                 rIn.ReadUInt32( nVal32 );      // reading the tabulators
         }
         if ( nPMask & 0x200000 )


More information about the Libreoffice-commits mailing list