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

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 31 20:22:31 UTC 2021


 hwpfilter/source/hwpread.cxx |    7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 7a410f7ee447201dc23b31166ca9989a3c01bce7
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Aug 31 09:17:18 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Tue Aug 31 22:21:56 2021 +0200

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

diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index 62989bcf022d..de69eb4cd004 100644
--- a/hwpfilter/source/hwpread.cxx
+++ b/hwpfilter/source/hwpread.cxx
@@ -38,20 +38,19 @@ static int lnnumber = 0;
 
 bool HBox::Read(HWPFile & )
 {
-// already read
+    // already read
     return true;
 }
 
-
 // skip block
-
 bool SkipData::Read(HWPFile & hwpf)
 {
     uint data_block_len;
     hwpf.Read4b(&data_block_len, 1);
 
     hchar dummy;
-    hwpf.Read2b(&dummy, 1);
+    if (!hwpf.Read2b(dummy))
+        return hwpf.SetState(HWP_InvalidFileFormat);
 
     if (!(IS_SP_SKIP_BLOCK(hh) && (hh == dummy))){
         return hwpf.SetState(HWP_InvalidFileFormat);


More information about the Libreoffice-commits mailing list