Avoid a segfault when reading an encrypted key that isn't there

Patch from cypherpunks. Fixes bug 16449. Bug not in any released tor.
This commit is contained in:
Nick Mathewson 2015-06-27 14:14:13 -04:00
parent 80fb1ef8ba
commit 48f69685f5

View File

@ -63,7 +63,7 @@ read_encrypted_secret_key(ed25519_secret_key_t *out,
r = 1;
done:
memwipe(encrypted_key, 0, encrypted_len);
memwipe(encrypted_key, 0, sizeof(encrypted_key));
memwipe(pwbuf, 0, sizeof(pwbuf));
tor_free(tag);
if (secret) {