Browse Source

Avoid a double-free when parsing malformed DirServer lines.

svn:r9264
Roger Dingledine 17 years ago
parent
commit
7b88380690
2 changed files with 2 additions and 1 deletions
  1. 1 0
      ChangeLog
  2. 1 1
      src/or/config.c

+ 1 - 0
ChangeLog

@@ -137,6 +137,7 @@ Changes in version 0.1.2.5-alpha - 2007-01-03
       if their identity keys are as expected.
     - When the user uses bad syntax in the Log config line, stop
       suggesting other bad syntax as a replacement.
+    - Avoid a double-free when parsing malformed DirServer lines.
 
   o Controller features:
     - Have GETINFO dir/status/* work on hosts with DirPort disabled.

+ 1 - 1
src/or/config.c

@@ -3385,6 +3385,7 @@ parse_dir_server_line(const char *line, int validate_only)
     goto err;
   }
   addrport = smartlist_get(items, 0);
+  smartlist_del_keeporder(items, 0);
   if (parse_addr_port(LOG_WARN, addrport, &address, NULL, &dir_port)<0) {
     log_warn(LD_CONFIG, "Error parsing DirServer address '%s'", addrport);
     goto err;
@@ -3393,7 +3394,6 @@ parse_dir_server_line(const char *line, int validate_only)
     log_warn(LD_CONFIG, "Missing port in DirServer address '%s'",addrport);
     goto err;
   }
-  smartlist_del_keeporder(items, 0);
 
   fingerprint = smartlist_join_strings(items, "", 0, NULL);
   if (strlen(fingerprint) != HEX_DIGEST_LEN) {