瀏覽代碼

Don't follow the NULL pointer.

If dirvote_create_microdescriptor() returns NULL, don't use md.

Found by "f. tp.".

Fixes bug 6797.
Linus Nordberg 11 年之前
父節點
當前提交
93ee62297f
共有 2 個文件被更改,包括 5 次插入2 次删除
  1. 3 0
      changes/bug6797
  2. 2 2
      src/or/dirserv.c

+ 3 - 0
changes/bug6797

@@ -0,0 +1,3 @@
+  o Minor bugfixes:
+    - Don't follow the NULL pointer. Found by "f. tp.". Fixes bug
+      6797; bugfix on 0.2.4.1-alpha.

+ 2 - 2
src/or/dirserv.c

@@ -2800,9 +2800,9 @@ dirserv_generate_networkstatus_vote_obj(crypto_pk_t *private_key,
           h->microdesc_hash_line = tor_strdup(buf);
           h->next = vrs->microdesc;
           vrs->microdesc = h;
+          md->last_listed = now;
+          smartlist_add(microdescriptors, md);
         }
-        md->last_listed = now;
-        smartlist_add(microdescriptors, md);
       }
 
       smartlist_add(routerstatuses, vrs);