From: Nick Mathewson Date: Sat, 27 Jun 2015 18:14:13 +0000 (-0400) Subject: Avoid a segfault when reading an encrypted key that isn't there X-Git-Tag: tor-0.2.7.2-alpha~70 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48f69685f5df3ca0f39a3da155df3b9a5cfa2b99;p=thirdparty%2Ftor.git Avoid a segfault when reading an encrypted key that isn't there Patch from cypherpunks. Fixes bug 16449. Bug not in any released tor. --- diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c index 2fd7f41a8d..d075c67e6a 100644 --- a/src/or/routerkeys.c +++ b/src/or/routerkeys.c @@ -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) {