diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-02-28 12:32:07 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-02-28 12:34:43 +0000 |
commit | b9483aacadf443e57f7708f8db64aeeba4666f2a (patch) | |
tree | 646e42af4fc1d5f4c74a89417687db4fb4a5050e /hwpfilter | |
parent | 727a25090dbb1d3a3a2c33153a12d9c25b4206de (diff) |
hwp: avoid low hanging invalid input
Change-Id: I06133d6db14edb9d915c38e4c120a9d0905495dd
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/source/hwpfile.cxx | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/hwpfilter/source/hwpfile.cxx b/hwpfilter/source/hwpfile.cxx index 5f6fe55b1660..0ce390297563 100644 --- a/hwpfilter/source/hwpfile.cxx +++ b/hwpfilter/source/hwpfile.cxx @@ -350,6 +350,12 @@ void HWPFile::TagsRead() if (!Read4b(_hwpInfo.back_info.size)) return; + if (_hwpInfo.back_info.size < 0) + { + _hwpInfo.back_info.size = 0; + return; + } + _hwpInfo.back_info.data = new char[(unsigned int)_hwpInfo.back_info.size]; ReadBlock(_hwpInfo.back_info.data, _hwpInfo.back_info.size); |