diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-01-26 11:57:13 +0000 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2022-01-27 11:49:51 +0100 |
commit | f4209871f1054ac7dcc5d4b90ce8fc2087288c2b (patch) | |
tree | 813da4e626da45f32bd229b7015afadfeba38cc8 /lotuswordpro/source | |
parent | 938a6a01168c6e091cea6735b1e4037c075dbabb (diff) |
ofz#44080 throw exception on a negative length
Change-Id: I3e2286cea69908fae3a2dd177d10fca2b7f0c877
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128955
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r-- | lotuswordpro/source/filter/lwpdrawobj.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx b/lotuswordpro/source/filter/lwpdrawobj.cxx index dbd906a5c0bd..79707ebdad6b 100644 --- a/lotuswordpro/source/filter/lwpdrawobj.cxx +++ b/lotuswordpro/source/filter/lwpdrawobj.cxx @@ -1094,6 +1094,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); |