瀏覽代碼

workaround for user error: some people were putting "Address " in their
torrc, and they had a buggy resolver that resolved " " to 0.0.0.0. Oops.


svn:r4150

Roger Dingledine 20 年之前
父節點
當前提交
729e720095
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      src/or/config.c

+ 8 - 1
src/or/config.c

@@ -951,7 +951,14 @@ resolve_my_address(const char *address, uint32_t *addr)
 
   tor_assert(addr);
 
-  if (address) {
+  /* workaround: some people were leaving "Address  " in their torrc,
+   * and they had a buggy resolver that resolved " " to 0.0.0.0. Oops.
+   */
+  if (address)
+    while (TOR_ISSPACE(*address))
+      address++;
+
+  if (address && *address) {
     strlcpy(hostname, address, sizeof(hostname));
   } else { /* then we need to guess our address */
     explicit_ip = 0; /* it's implicit */