hwpfilter/source/hwpread.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 27b84d7460cbb925429826d20c4cee5439ad7053
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Thu Sep 2 12:02:55 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Fri Sep 3 12:05:37 2021 +0200

    cid#1490898 Unchecked return value
    
    Change-Id: I49124165e0d00d84f3ebdb0414d6db58f6da1209
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121519
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx
index de69eb4cd004..31da8c7efde7 100644
--- a/hwpfilter/source/hwpread.cxx
+++ b/hwpfilter/source/hwpread.cxx
@@ -70,17 +70,17 @@ bool FieldCode::Read(HWPFile & hwpf)
     uint binlen;     /* Length of any binary data format */
 
     hwpf.Read4b(size);
-    hwpf.Read2b(dummy);
+    if (!hwpf.Read2b(dummy))
+        return false;
     hwpf.ReadBlock(&type, 2);
     hwpf.Read4b(reserved1.data(), 1);
-    hwpf.Read2b(location_info);
+    if (!hwpf.Read2b(location_info))
+        return false;
     hwpf.ReadBlock(reserved2.data(), 22);
     hwpf.Read4b(len1);
     hwpf.Read4b(len2);
     hwpf.Read4b(len3);
-    bool bSuccess = hwpf.Read4b(binlen);
-
-    if (!bSuccess)
+    if (!hwpf.Read4b(binlen))
         return false;
 
     uint const len1_ = std::min<uint>(len1, 1024) / sizeof(hchar);

Reply via email to