ofz#43458 avoid OOM

Change-Id: Id0e1e985c446c147a219ba2f5157a41deae656a4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128193
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2022-01-09 16:16:39 +00:00
parent 27e9de358b
commit e28f4b6bcc

View File

@@ -1047,6 +1047,8 @@ void LwpDrawTextBox::Read()
// the 71 is the fixed length before text content in textbox record
sal_Int16 TextLength = m_aObjHeader.nRecLen - 71;
if (TextLength < 0)
throw BadRead();
m_aTextRec.pTextString = new sal_uInt8 [TextLength];
m_pStream->ReadBytes(m_aTextRec.pTextString, TextLength);