Blame 0001-coverity-1259905-do-not-let-AbiDocument-parse-throw.patch

8a6526c
From 2f372e8adf8e6b1f8cf70f08adddcf66be54d94a Mon Sep 17 00:00:00 2001
8a6526c
From: David Tardon <dtardon@redhat.com>
8a6526c
Date: Sat, 20 Dec 2014 18:40:45 +0100
8a6526c
Subject: [PATCH] coverity#1259905 do not let AbiDocument::parse throw
8a6526c
8a6526c
This also fixes coverity#1259906 and coverity#1259907 .
8a6526c
8a6526c
Change-Id: I55d892517ac93ca43478d51d8e4a20c704ff6790
8a6526c
---
8a6526c
 src/lib/AbiDocument.cpp | 7 ++++++-
8a6526c
 1 file changed, 6 insertions(+), 1 deletion(-)
8a6526c
8a6526c
diff --git a/src/lib/AbiDocument.cpp b/src/lib/AbiDocument.cpp
8a6526c
index b8ab661..23ff750 100644
8a6526c
--- a/src/lib/AbiDocument.cpp
8a6526c
+++ b/src/lib/AbiDocument.cpp
8a6526c
@@ -110,7 +110,7 @@ is not protected
8a6526c
 \return A value that indicates whether the conversion was successful and in case it
8a6526c
 was not, it indicates the reason of the error
8a6526c
 */
8a6526c
-ABWAPI bool libabw::AbiDocument::parse(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *textInterface)
8a6526c
+ABWAPI bool libabw::AbiDocument::parse(librevenge::RVNGInputStream *input, librevenge::RVNGTextInterface *textInterface) try
8a6526c
 {
8a6526c
   ABW_DEBUG_MSG(("AbiDocument::parse\n"));
8a6526c
   if (!input)
8a6526c
@@ -122,4 +122,9 @@ ABWAPI bool libabw::AbiDocument::parse(librevenge::RVNGInputStream *input, libre
8a6526c
     return true;
8a6526c
   return false;
8a6526c
 }
8a6526c
+catch (...)
8a6526c
+{
8a6526c
+  return false;
8a6526c
+}
8a6526c
+
8a6526c
 /* vim:set shiftwidth=2 softtabstop=2 expandtab: */
8a6526c
-- 
8a6526c
2.3.5
8a6526c