[Libreoffice-commits] core.git: xmlsecurity/workben

Miklos Vajna vmiklos at collabora.co.uk
Fri Dec 16 08:14:09 UTC 2016


 xmlsecurity/workben/pdfverify.cxx |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 107bcc88397f7167cf9599255f4e8c4de299e659
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Fri Dec 16 09:11:18 2016 +0100

    cid#1374075 cid#1374076 Executable_pdfverify: uncaught exceptions
    
    SAL_INFO() throwing std::length_error and other uninteresting cases.
    
    Change-Id: I841c7d81ff51c95ea60d63625e296f9886798f92

diff --git a/xmlsecurity/workben/pdfverify.cxx b/xmlsecurity/workben/pdfverify.cxx
index 04c33d8..92504fc 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: */


More information about the Libreoffice-commits mailing list