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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 31 18:37:08 UTC 2021


 emfio/source/reader/wmfreader.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 58da1a60424f4decffd6a946454eb8f7520ab8fb
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Aug 30 16:45:10 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Aug 31 20:36:32 2021 +0200

    ofz: MemorySanitizer: use-of-uninitialized-value
    
    test for eof condition before comparing the uninit val
    
    Change-Id: Ie27c80f6c8103af4283181c522794eb878ccf588
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121373
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx
index 6ef7003c42bd..9d27787c205f 100644
--- a/emfio/source/reader/wmfreader.cxx
+++ b/emfio/source/reader/wmfreader.cxx
@@ -1673,14 +1673,14 @@ namespace emfio
                     bRet = false;
                     break;
                 }
-                else if ( nRSize==3 && nFunction==0 )
+                else if (pStm->eof() || nRSize < 3)
                 {
+                    pStm->SetError( SVSTREAM_FILEFORMAT_ERROR );
+                    bRet = false;
                     break;
                 }
-                else if ( nRSize < 3 || pStm->eof() )
+                else if ( nRSize==3 && nFunction==0 )
                 {
-                    pStm->SetError( SVSTREAM_FILEFORMAT_ERROR );
-                    bRet = false;
                     break;
                 }
                 switch( nFunction )


More information about the Libreoffice-commits mailing list