oss-fuzz: qpwfuzzer doesn't pass sanity check

Step #5:     #6 0x9d06d2f in __cxa_throw (/tmp/not-out/qpwfuzzer+0x9d06d2f)
Step #5:     #7 0x476ab6a in SvStream::ReadUInt16(unsigned short&) (/tmp/not-out/qpwfuzzer+0x476ab6a)
Step #5:     #8 0x512b10 in ScQProReader::nextRecord() (/tmp/not-out/qpwfuzzer+0x512b10)
Step #5:     #9 0x513a7e in ScQProReader::parse(ScDocument&) (/tmp/not-out/qpwfuzzer+0x513a7e)
Step #5:     #10 0x514bdc in TestImportQPW (/tmp/not-out/qpwfuzzer+0x514bdc)

Change-Id: I42ea56988bcb54a57979535108e5ed90225d1f68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108149
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2020-12-22 09:53:11 +00:00
parent 898993aa62
commit a7d1d107ec

View File

@@ -254,7 +254,16 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportQPW(SvStream &rStream)
aDocument.SetHardRecalcState(ScDocument::HardRecalcState::ETERNAL);
ScQProReader aReader(&rStream);
ErrCode eRet = aReader.parse(aDocument);
ErrCode eRet;
try
{
eRet = aReader.parse(aDocument);
}
catch (SvStreamEOFException&)
{
eRet = SCERR_IMPORT_OPEN;
}
return eRet == ERRCODE_NONE;
}