diff --git a/src/content/content.cpp b/src/content/content.cpp index e94c0ecee..359d70fb4 100644 --- a/src/content/content.cpp +++ b/src/content/content.cpp @@ -53,6 +53,13 @@ Content::Content (ContentPrivate &p) : ClonableObject(p) { } +Content::~Content () { + L_D(); + /* Fills the body with zeros before releasing since it may contain + private data like cipher keys or decoded messages. */ + d->body.assign(d->body.size(), 0); +} + Content &Content::operator= (const Content &src) { L_D(); if (this != &src) { diff --git a/src/content/content.h b/src/content/content.h index 4635898bf..d51c51e7e 100644 --- a/src/content/content.h +++ b/src/content/content.h @@ -40,6 +40,7 @@ public: Content (); Content (const Content &src); Content (Content &&src); + ~Content (); Content &operator= (const Content &src); Content &operator= (Content &&src);