summaryrefslogtreecommitdiff
path: root/hwpfilter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2021-09-02 12:02:55 +0100
committerCaolán McNamara <caolanm@redhat.com>2021-09-03 12:05:37 +0200
commit27b84d7460cbb925429826d20c4cee5439ad7053 (patch)
tree69dfd43ae8482a141e068e4edc50559d7533d2c1 /hwpfilter
parent6c0c3bd74e0d94f48feda9bd7663bb9b5d9fc320 (diff)
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 <caolanm@redhat.com>
Diffstat (limited to 'hwpfilter')
-rw-r--r--hwpfilter/source/hwpread.cxx10
1 files changed, 5 insertions, 5 deletions
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);