summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-01-26 11:57:13 +0000
committerMichael Stahl <michael.stahl@allotropia.de>2022-02-03 12:23:39 +0100
commitdbb53be78910ec7377bec876793b9c9d6ccf56a7 (patch)
treef6ac860003051bc1fc3ed02f7b34ec93f574e697 /lotuswordpro
parent98d7589c22fed5a588fd7bf6b8eb9e0ab455e4cc (diff)
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 <xiscofauli@libreoffice.org> (cherry picked from commit af8709defeb90464c8724d3fe5fb8cbbf6efc2b8)
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwpdrawobj.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx b/lotuswordpro/source/filter/lwpdrawobj.cxx
index d902fd258a8b..37a14012622d 100644
--- a/lotuswordpro/source/filter/lwpdrawobj.cxx
+++ b/lotuswordpro/source/filter/lwpdrawobj.cxx
@@ -1092,6 +1092,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);