Fills the body of Content objects on destruction

This commit is a duplicate of bd08e5940c in master
This commit is contained in:
François Grisez 2017-11-17 09:33:09 +01:00
parent e2013f1aa0
commit c50ba6614d
2 changed files with 8 additions and 0 deletions

View file

@ -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) {

View file

@ -40,6 +40,7 @@ public:
Content ();
Content (const Content &src);
Content (Content &&src);
~Content ();
Content &operator= (const Content &src);
Content &operator= (Content &&src);