diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-08-31 09:17:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-08-31 22:21:56 +0200 |
commit | 7a410f7ee447201dc23b31166ca9989a3c01bce7 (patch) | |
tree | 243bae5c8ddc66ef345d58ab91b7ef6835331589 /hwpfilter | |
parent | aac3ef9df34b38d8fc786f13b0336c7cbe68ee51 (diff) |
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@redhat.com>
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/source/hwpread.cxx | 7 |
1 files changed, 3 insertions, 4 deletions
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); |