changeset 1045:31727a8abd4b

Use m_burn rather than memset
author Thorsten Horstmann <thorsten.horstmann@web.de>
date Tue, 24 Feb 2015 22:48:14 +0800
parents a5b785c12340
children b8f4b7027191 01eea88963f3 359fba4b1a49
files keyimport.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/keyimport.c	Tue Feb 24 22:41:26 2015 +0800
+++ b/keyimport.c	Tue Feb 24 22:48:14 2015 +0800
@@ -464,17 +464,16 @@
 		goto error;
 	}
 
-	memset(buffer, 0, sizeof(buffer));
+	m_burn(buffer, sizeof(buffer));
 	return ret;
 
 	error:
-	memset(buffer, 0, sizeof(buffer));
+	m_burn(buffer, sizeof(buffer));
 	if (ret) {
 		if (ret->keyblob) {
-			memset(ret->keyblob, 0, ret->keyblob_size);
+			m_burn(ret->keyblob, ret->keyblob_size);
 			m_free(ret->keyblob);
 		}
-		memset(&ret, 0, sizeof(ret));
 		m_free(ret);
 	}
 	if (fp) {
@@ -494,9 +493,8 @@
 	if (!key)
 		return 0;
 	ret = key->encrypted;
-	memset(key->keyblob, 0, key->keyblob_size);
+	m_burn(key->keyblob, key->keyblob_size);
 	m_free(key->keyblob);
-	memset(&key, 0, sizeof(key));
 	m_free(key);
 	return ret;
 }