diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-03-11 20:20:02 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-03-11 20:20:46 +0000 |
commit | 1e8d00719c851d69d36cd66eb115c517c1696b64 (patch) | |
tree | c12e572bf5d1924579ab865b31408efa1edb68e3 /lotuswordpro | |
parent | 864082408b1647db3f0776b6a540461ddb91f12e (diff) |
ofz: turn assert into throw
cause size arg is controllable by the file data
Change-Id: Ia92b56c04271557afbec1ab47620bcb34f1c0e8a
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 072edf700dd2..bc968a550f43 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) { |