[Libreoffice-commits] core.git: lotuswordpro/source
Caolán McNamara
caolanm at redhat.com
Sat Mar 11 20:21:28 UTC 2017
lotuswordpro/source/filter/lwpobjstrm.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 1e8d00719c851d69d36cd66eb115c517c1696b64
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 11 20:20:02 2017 +0000
ofz: turn assert into throw
cause size arg is controllable by the file data
Change-Id: Ia92b56c04271557afbec1ab47620bcb34f1c0e8a
diff --git a/lotuswordpro/source/filter/lwpobjstrm.cxx b/lotuswordpro/source/filter/lwpobjstrm.cxx
index 072edf7..bc968a5 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)
{
More information about the Libreoffice-commits
mailing list