lotuswordpro/source/filter/lwpdrawobj.cxx |    3 +++
 1 file changed, 3 insertions(+)

New commits:
commit af8709defeb90464c8724d3fe5fb8cbbf6efc2b8
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Wed Jan 26 11:57:13 2022 +0000
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Thu Jan 27 11:50:05 2022 +0100

    ofz#44080 throw exception on a negative length
    
    Change-Id: I3e2286cea69908fae3a2dd177d10fca2b7f0c877
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128956
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx 
b/lotuswordpro/source/filter/lwpdrawobj.cxx
index a697b6b0de48..5de7ae30894d 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1093,6 +1093,9 @@ XFFrame* LwpDrawTextBox::CreateDrawObj(const OUString& 
rStyleName )
         aEncoding = LwpCharSetMgr::GetTextCharEncoding();
     }
 
+    if (TextLength < 2)
+        throw BadRead();
+
     XFParagraph* pXFPara = new XFParagraph();
     pXFPara->Add(OUString(reinterpret_cast<char*>(m_aTextRec.pTextString), 
(TextLength-2), aEncoding));
     pXFPara->SetStyleName(rStyleName);

Reply via email to