diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-11 20:20:02 +0000 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-03-13 13:38:27 +0000 |
commit | 562a13c8d2325f7cb80c61f198c87b98d8922e63 (patch) | |
tree | c671e96ea44031f3d2abbf68631d0caaf56be6d0 /lotuswordpro | |
parent | acd58ceaa1d792d0a16c270c56ff727321fb2aac (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>
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) { |