[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Fix null dereference on key setup error.



commit 24a2bb08abb08e03de8ff962167179cdb4659ed2
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu May 28 12:46:06 2015 -0400

    Fix null dereference on key setup error.
    
    CID 1301369
---
 src/or/routerkeys.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/or/routerkeys.c b/src/or/routerkeys.c
index 7b7a6d0..59169cd 100644
--- a/src/or/routerkeys.c
+++ b/src/or/routerkeys.c
@@ -199,7 +199,8 @@ ed_key_init_from_file(const char *fname, uint32_t flags,
   goto cleanup;
 
  err:
-  memwipe(keypair, 0, sizeof(*keypair));
+  if (keypair)
+    memwipe(keypair, 0, sizeof(*keypair));
   tor_free(keypair);
   tor_cert_free(cert);
   if (cert_out)

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits