aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Richard <[email protected]>2005-12-05 17:35:51 +0000
committerVincent Richard <[email protected]>2005-12-05 17:35:51 +0000
commit2cb8fef483849ad7b2906e110cfc6516ea43bb9e (patch)
tree33ee45c5a3e65560b3be7815575ec9ccb45cb28e
parentFixed a bug in argument vector. (diff)
downloadvmime-2cb8fef483849ad7b2906e110cfc6516ea43bb9e.tar.gz
vmime-2cb8fef483849ad7b2906e110cfc6516ea43bb9e.zip
Fixed segfault in destructor when chaining 3 exceptions or more.
-rw-r--r--ChangeLog4
-rw-r--r--src/exception.cpp6
-rw-r--r--vmime/exception.hpp2
3 files changed, 12 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index b9743e8d..b5fcddd7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,10 @@ VERSION 0.8.1cvs
2005-12-04 Vincent Richard <[email protected]>
+ * exception.{hpp|cpp}: fixed segfault in destructor when destroying
+ an exception chain with more than 2 elements (thanks to Bertrand
+ Benoit).
+
* posixChildProcess.cpp: fixed a bug in argument vector; last argument
was not NULL (thanks to Bertrand Benoit).
diff --git a/src/exception.cpp b/src/exception.cpp
index 9cfd2201..b01fa033 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -46,6 +46,12 @@ exception::exception(const string& what, const exception& other)
}
+exception::exception(const exception& e)
+ : std::exception(), m_what(e.what()), m_other(e.m_other == NULL ? NULL : e.m_other->clone())
+{
+}
+
+
exception::~exception() throw()
{
delete (m_other);
diff --git a/vmime/exception.hpp b/vmime/exception.hpp
index 04aa9d5a..7a394650 100644
--- a/vmime/exception.hpp
+++ b/vmime/exception.hpp
@@ -51,6 +51,8 @@ private:
public:
exception(const string& what, const exception& other = NO_EXCEPTION);
+ exception(const exception& e);
+
virtual ~exception() throw();
/** Return a description of the error.