[tor-commits] [tor/master] Fix crash bug from 4a8eaad7 (Bug 6255)

nickm at torproject.org nickm at torproject.org
Fri Jun 29 04:39:26 UTC 2012


commit 6abdcdf11641b9d7e84d438ece781dcfb689a705
Author: Nick Mathewson <nickm at torproject.org>
Date:   Fri Jun 29 00:32:27 2012 -0400

    Fix crash bug from 4a8eaad7 (Bug 6255)
    
    We were doing a tor_strclear() on client_keys_str when it might not
    even be set.
    
    Fix for bug 6255; bug not in any release of Tor.  Thanks to katmagic
    for finding this one!
---
 src/or/rendservice.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/or/rendservice.c b/src/or/rendservice.c
index 8acc226..689cfb1 100644
--- a/src/or/rendservice.c
+++ b/src/or/rendservice.c
@@ -724,7 +724,6 @@ rend_service_load_auth_keys(rend_service_t *s, const char *hfname)
     } else {
       log_info(LD_CONFIG, "Parsed %d previously stored client entries.",
                strmap_size(parsed_clients));
-      tor_free(client_keys_str);
     }
   }
 
@@ -870,8 +869,10 @@ rend_service_load_auth_keys(rend_service_t *s, const char *hfname)
   if (open_hfile)
     abort_writing_to_file(open_hfile);
  done:
-  tor_strclear(client_keys_str);
-  tor_free(client_keys_str);
+  if (client_keys_str) {
+    tor_strclear(client_keys_str);
+    tor_free(client_keys_str);
+  }
   strmap_free(parsed_clients, rend_authorized_client_strmap_item_free);
 
   memset(cfname, 0, sizeof(cfname));





More information about the tor-commits mailing list