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

[tor-commits] [tor/master] Compute flavor name before dereference, to avoid a STACK warning.



commit 81aec1449b2c765c395c9f5920c287500e747488
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Thu Jan 11 11:31:03 2018 -0500

    Compute flavor name before dereference, to avoid a STACK warning.
    
    (See 24423)
---
 src/or/networkstatus.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/or/networkstatus.c b/src/or/networkstatus.c
index deef62bd4..aa0a8d15c 100644
--- a/src/or/networkstatus.c
+++ b/src/or/networkstatus.c
@@ -2077,6 +2077,7 @@ networkstatus_note_certs_arrived(const char *source_dir)
 {
   int i;
   for (i=0; i<N_CONSENSUS_FLAVORS; ++i) {
+    const char *flavor_name = networkstatus_get_flavor_name(i);
     consensus_waiting_for_certs_t *waiting = &consensus_waiting_for_certs[i];
     if (!waiting->consensus)
       continue;
@@ -2084,7 +2085,7 @@ networkstatus_note_certs_arrived(const char *source_dir)
       char *waiting_body = waiting->body;
       if (!networkstatus_set_current_consensus(
                                  waiting_body,
-                                 networkstatus_get_flavor_name(i),
+                                 flavor_name,
                                  NSSET_WAS_WAITING_FOR_CERTS,
                                  source_dir)) {
         tor_free(waiting_body);



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