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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 2 12:29:03 UTC 2021


 vcl/source/filter/ipcd/ipcd.cxx |   12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

New commits:
commit c085fc7cd335e3ea50a6bbaedf2f6e8cffadf559
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Sep 2 09:51:11 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Sep 2 14:28:29 2021 +0200

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

diff --git a/vcl/source/filter/ipcd/ipcd.cxx b/vcl/source/filter/ipcd/ipcd.cxx
index b3377c8934e3..dbe7eb12d5db 100644
--- a/vcl/source/filter/ipcd/ipcd.cxx
+++ b/vcl/source/filter/ipcd/ipcd.cxx
@@ -226,10 +226,14 @@ void PCDReader::ReadImage()
     m_rPCD.Seek( nImagePos );
 
     // next pair of rows := first pair of rows:
-    m_rPCD.ReadBytes( pL0N, nWidth );
-    m_rPCD.ReadBytes( pL1N, nWidth );
-    m_rPCD.ReadBytes( pCbN, nW2 );
-    m_rPCD.ReadBytes( pCrN, nW2 );
+    if (m_rPCD.ReadBytes(pL0N, nWidth) != nWidth ||
+        m_rPCD.ReadBytes(pL1N, nWidth) != nWidth ||
+        m_rPCD.ReadBytes(pCbN, nW2) != nW2 ||
+        m_rPCD.ReadBytes(pCrN, nW2) != nW2)
+    {
+        bStatus = false;
+        return;
+    }
     pCbN[ nW2 ] = pCbN[ nW2 - 1 ];
     pCrN[ nW2 ] = pCrN[ nW2 - 1 ];
 


More information about the Libreoffice-commits mailing list