From 92f84e7864c0c6729c2d87a03c1176ce565c8b99 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 26 Jan 2022 11:57:13 +0000 Subject: ofz#44080 throw exception on a negative length MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I3e2286cea69908fae3a2dd177d10fca2b7f0c877 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128983 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- lotuswordpro/source/filter/lwpdrawobj.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'lotuswordpro') diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx b/lotuswordpro/source/filter/lwpdrawobj.cxx index a46d44d1e51f..2dc4d5cdee9c 100644 --- a/lotuswordpro/source/filter/lwpdrawobj.cxx +++ b/lotuswordpro/source/filter/lwpdrawobj.cxx @@ -1094,6 +1094,9 @@ rtl::Reference LwpDrawTextBox::CreateDrawObj(const OUString& rStyleName aEncoding = LwpCharSetMgr::GetTextCharEncoding(); } + if (TextLength < 2) + throw BadRead(); + XFParagraph* pXFPara = new XFParagraph(); pXFPara->Add(OUString(reinterpret_cast(m_aTextRec.pTextString), (TextLength-2), aEncoding)); pXFPara->SetStyleName(rStyleName); @@ -1107,13 +1110,6 @@ rtl::Reference LwpDrawTextBox::CreateDrawObj(const OUString& rStyleName OUString sName = pXFStyleManager->AddStyle(std::move(pBoxStyle)).m_pStyle->GetStyleName(); xTextBox->SetStyleName(sName); - //todo: add the interface for rotating textbox -// if (m_aTextRec.nTextRotation) -// { -// double fAngle = double(3600-m_aTextRec.nTextRotation)/10; -// xTextBox->SetRotate(fAngle); -// } - return xTextBox; } -- cgit