[PATCH] Fix structure clearance in openssh_read()
Christian Engelmayer
cengelma at gmx.at
Sun Dec 14 18:07:02 AWST 2014
When clearing the memory of 'key' in function openssh_read(), only the size
of the pointer to the data instead of the whole size of struct openssh_key
is cleared. Correct the size calculation as detected by Coverity CID 1191543.
Signed-off-by: Christian Engelmayer <cengelma at gmx.at>
---
keyimport.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/keyimport.c b/keyimport.c
index 66a7f55..2f9d3fa 100644
--- a/keyimport.c
+++ b/keyimport.c
@@ -810,7 +810,7 @@ static sign_key *openssh_read(const char *filename, char * UNUSED(passphrase))
}
m_burn(key->keyblob, key->keyblob_size);
m_free(key->keyblob);
- m_burn(key, sizeof(key));
+ m_burn(key, sizeof(*key));
m_free(key);
if (errmsg) {
fprintf(stderr, "Error: %s\n", errmsg);
--
1.9.1
More information about the Dropbear
mailing list