[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - lotuswordpro/source

Caolán McNamara caolanm at redhat.com
Mon Mar 13 13:39:05 UTC 2017


 lotuswordpro/source/filter/lwpobjstrm.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 562a13c8d2325f7cb80c61f198c87b98d8922e63
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
    (cherry picked from commit 1e8d00719c851d69d36cd66eb115c517c1696b64)
    Reviewed-on: https://gerrit.libreoffice.org/35083
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/lotuswordpro/source/filter/lwpobjstrm.cxx b/lotuswordpro/source/filter/lwpobjstrm.cxx
index 8a28c9f..c9350d8 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