diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-01-26 11:57:13 +0000 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2022-02-04 11:25:37 +0100 |
commit | c874c8af64a340fe594d1223fddd0cb203eebee9 (patch) | |
tree | 87267e750334ce1b41c203428ed5e7cad40c3390 /lotuswordpro | |
parent | 8378557a6b77821d5c8c756db7410702d4c3306f (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.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx b/lotuswordpro/source/filter/lwpdrawobj.cxx index 163367e9f785..8baed94f135a 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); |