Browse Source

Init conn->addr to "unspec" on cpuworker connections

Fixes bug 4532 reported by "troll_un"
Nick Mathewson 14 years ago
parent
commit
5303918091
2 changed files with 4 additions and 0 deletions
  1. 3 0
      changes/bug4532
  2. 1 0
      src/or/cpuworker.c

+ 3 - 0
changes/bug4532

@@ -0,0 +1,3 @@
+  o Minor bugfixes:
+    - Initialize conn->addr to a vaild state in spawn_cpuworker. Fixes bug
+      4532; found by troll_un.

+ 1 - 0
src/or/cpuworker.c

@@ -347,6 +347,7 @@ spawn_cpuworker(void)
   /* set up conn so it's got all the data we need to remember */
   /* set up conn so it's got all the data we need to remember */
   conn->s = fd;
   conn->s = fd;
   conn->address = tor_strdup("localhost");
   conn->address = tor_strdup("localhost");
+  tor_addr_make_unspec(&conn->addr);
 
 
   if (connection_add(conn) < 0) { /* no space, forget it */
   if (connection_add(conn) < 0) { /* no space, forget it */
     log_warn(LD_NET,"connection_add for cpuworker failed. Giving up.");
     log_warn(LD_NET,"connection_add for cpuworker failed. Giving up.");