lotuswordpro/source/filter/lwpdrawobj.cxx | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
New commits: commit 92f84e7864c0c6729c2d87a03c1176ce565c8b99 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Jan 26 11:57:13 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Jan 26 14:49:11 2022 +0100 ofz#44080 throw exception on a negative length Change-Id: I3e2286cea69908fae3a2dd177d10fca2b7f0c877 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128983 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> 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<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); @@ -1107,13 +1110,6 @@ rtl::Reference<XFFrame> 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; }