]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Avoid a segfault when reading an encrypted key that isn't there
authorNick Mathewson <nickm@torproject.org>
Sat, 27 Jun 2015 18:14:13 +0000 (14:14 -0400)
committerNick Mathewson <nickm@torproject.org>
Sat, 27 Jun 2015 18:14:13 +0000 (14:14 -0400)
Patch from cypherpunks. Fixes bug 16449. Bug not in any released tor.

src/or/routerkeys.c

index 2fd7f41a8d2401fe564378068644662658a1fb3a..d075c67e6a715f589adaf71b8494f6a0da8efc00 100644 (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) {