diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-11 20:20:02 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-03-16 14:43:52 +0100 |
commit | 9d56e2580f32411c6e13ee8f1f6a0ded3123a54b (patch) | |
tree | 3e76b62a4af9f8e76a4c463607b29dc64535e99a /lotuswordpro | |
parent | d4cccc733f19a3e57f5067bae73108f21ec5a099 (diff) |
ofz: turn assert into throw
cause size arg is controllable by the file data
Change-Id: Ia92b56c04271557afbec1ab47620bcb34f1c0e8a
(cherry picked from commit 1e8d00719c851d69d36cd66eb115c517c1696b64)
Reviewed-on: https://gerrit.libreoffice.org/35083
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
(cherry picked from commit 562a13c8d2325f7cb80c61f198c87b98d8922e63)
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwpobjstrm.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lotuswordpro/source/filter/lwpobjstrm.cxx b/lotuswordpro/source/filter/lwpobjstrm.cxx index 8a28c9fd214a..c9350d8705db 100644 --- a/lotuswordpro/source/filter/lwpobjstrm.cxx +++ b/lotuswordpro/source/filter/lwpobjstrm.cxx @@ -68,7 +68,8 @@ LwpObjectStream::LwpObjectStream(LwpSvStream *pStrm, bool isCompressed, sal_uInt :m_pContentBuf(nullptr), m_nBufSize(size), m_nReadPos(0), m_pStrm(pStrm), m_bCompressed(isCompressed) { - assert(size<IO_BUFFERSIZE); + if (size >= IO_BUFFERSIZE) + throw std::range_error("bad Object size"); // read object data from stream if(m_nBufSize == 0) { |