diff options
author | Thorsten Horstmann <thorsten.horstmann@web.de> | 2015-02-24 22:48:14 +0800 |
---|---|---|
committer | Thorsten Horstmann <thorsten.horstmann@web.de> | 2015-02-24 22:48:14 +0800 |
commit | 59bb1777be18b8f1b263aaeabe54a32933fc871d (patch) | |
tree | bfd919cc08cdeab826eb4ae84ebb7930d2223ad6 | |
parent | c5f3c550a6c9dc14655e17e1a809d18b953deb27 (diff) |
Use m_burn rather than memset
-rw-r--r-- | keyimport.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/keyimport.c b/keyimport.c index 54eb5c3..8a0d525 100644 --- a/keyimport.c +++ b/keyimport.c @@ -464,17 +464,16 @@ static struct openssh_key *load_openssh_key(const char *filename) 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 @@ static int openssh_encrypted(const char *filename) 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; } |