diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-11 20:20:02 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-04-23 20:54:07 +0200 |
commit | 92cb461b47090a1df80b9e970f7587b18c5cbe7f (patch) | |
tree | c149490fe3fee3daff1da723bcbdb18cdb37f66a /lotuswordpro | |
parent | b10bc7a7833ef7cb5bead4ec191f426ecea7f4c5 (diff) |
ofz: turn assert into throw
cause size arg is controllable by the file data
(cherry picked from commit 1e8d00719c851d69d36cd66eb115c517c1696b64)
Change-Id: Ia92b56c04271557afbec1ab47620bcb34f1c0e8a
Reviewed-on: https://gerrit.libreoffice.org/35084
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
(cherry picked from commit 2dd2ef0a09cc1deb991abc55e3fd87cf9c73002e)
(cherry picked from commit 1f7745e36d255a6af3345ecf42ab96c509d0790d)
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 edbd56255929..88a82936a75a 100644 --- a/lotuswordpro/source/filter/lwpobjstrm.cxx +++ b/lotuswordpro/source/filter/lwpobjstrm.cxx @@ -69,7 +69,8 @@ LwpObjectStream::LwpObjectStream(LwpSvStream *pStrm, bool isCompressed, sal_uInt :m_pContentBuf(NULL), 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"); ReadStream(); } /** |