diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-01-26 11:57:13 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-01-26 14:49:11 +0100 |
commit | 92f84e7864c0c6729c2d87a03c1176ce565c8b99 (patch) | |
tree | cdafff1e35ba13a0235d0aaf41d482849cf1a4c5 /lotuswordpro | |
parent | e4c5c92a2b01c5b46f0e8b0fa6567e15624527fc (diff) |
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 <caolanm@redhat.com>
Diffstat (limited to 'lotuswordpro')
-rw-r--r-- | lotuswordpro/source/filter/lwpdrawobj.cxx | 10 |
1 files changed, 3 insertions, 7 deletions
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; } |