From 365f2e9054c59da1515c52fe8852216ce678cf38 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 19 Oct 2016 08:21:27 +0200 Subject: cid#1374076 uncaught exception Change-Id: Ifdbfc9f905f2ed7778830a0f2cc114d27feb36da --- xmlsecurity/source/pdfio/pdfdocument.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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(); -- cgit