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.
This commit is contained in:
Christian Engelmayer 2015-01-28 22:42:29 +08:00
parent d5c8ba1690
commit d857faf18e

View File

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