diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-04-10 20:49:45 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-04-11 12:07:10 +0200 |
commit | 998ee89bcaf42697b5541008787ce05ecbe608d4 (patch) | |
tree | b3390ed1668ddb8b548a814d34e17523ef67ecdb /hwpfilter | |
parent | ed901cc95b24d01c741861526d66f9451827c0ba (diff) |
ofz#31685 give up on large tables to avoid Timeout
Change-Id: I99a7cdede74c4e8a661579467624f21fcf9132df
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113931
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, 6 insertions, 1 deletions
diff --git a/hwpfilter/source/hwpread.cxx b/hwpfilter/source/hwpread.cxx index ca2a2eff534e..b3eb5504a0d6 100644 --- a/hwpfilter/source/hwpread.cxx +++ b/hwpfilter/source/hwpread.cxx @@ -283,7 +283,12 @@ bool TxtBox::Read(HWPFile & hwpf) UpdateBBox(this); ncell = nCell; - if (ncell <= 0){ + if (ncell <= 0) { + return hwpf.SetState(HWP_InvalidFileFormat); + } + + if (ncell > 4096 && utl::ConfigManager::IsFuzzing()) { + // cut off at an arbitary size to speed up fuzzing return hwpf.SetState(HWP_InvalidFileFormat); } |