diff options
Diffstat (limited to 'xmlsecurity/source/pdfio/pdfdocument.cxx')
-rw-r--r-- | xmlsecurity/source/pdfio/pdfdocument.cxx | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/xmlsecurity/source/pdfio/pdfdocument.cxx b/xmlsecurity/source/pdfio/pdfdocument.cxx index 3b01578ec777..6e807a4d4cb1 100644 --- a/xmlsecurity/source/pdfio/pdfdocument.cxx +++ b/xmlsecurity/source/pdfio/pdfdocument.cxx @@ -1380,7 +1380,15 @@ bool PDFDocument::ValidateSignature(SvStream& rStream, PDFObjectElement* pSignat // Then convert this string to a local UNO DateTime. util::DateTime aUNODateTime; - utl::ISO8601parseDateTime(aBuffer.toString(), aUNODateTime); + try + { + utl::ISO8601parseDateTime(aBuffer.toString(), aUNODateTime); + } + catch (const std::length_error&) + { + SAL_WARN("xmlsecurity.pdfio", "PDFDocument::ValidateSignature: failed to parse signature date string"); + return false; + } DateTime aDateTime(aUNODateTime); aDateTime.ConvertToLocalTime(); rInformation.stDateTime = aDateTime.GetUNODateTime(); |