From 107bcc88397f7167cf9599255f4e8c4de299e659 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Fri, 16 Dec 2016 09:11:18 +0100 Subject: cid#1374075 cid#1374076 Executable_pdfverify: uncaught exceptions SAL_INFO() throwing std::length_error and other uninteresting cases. Change-Id: I841c7d81ff51c95ea60d63625e296f9886798f92 --- xmlsecurity/workben/pdfverify.cxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/xmlsecurity/workben/pdfverify.cxx b/xmlsecurity/workben/pdfverify.cxx index 04c33d8fc139..92504fcba42d 100644 --- a/xmlsecurity/workben/pdfverify.cxx +++ b/xmlsecurity/workben/pdfverify.cxx @@ -22,7 +22,9 @@ using namespace com::sun::star; -SAL_IMPLEMENT_MAIN_WITH_ARGS(nArgc, pArgv) +namespace +{ +int pdfVerify(int nArgc, char** pArgv) { if (nArgc < 2) { @@ -151,5 +153,19 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(nArgc, pArgv) return 0; } +} + +SAL_IMPLEMENT_MAIN_WITH_ARGS(nArgc, pArgv) +{ + try + { + return pdfVerify(nArgc, pArgv); + } + catch (...) + { + std::cerr << "pdfverify: uncaught exception while invoking pdfVerify()" << std::endl; + return 1; + } +} /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit