]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Don't follow the NULL pointer.
authorLinus Nordberg <linus@torproject.org>
Wed, 5 Sep 2012 12:00:55 +0000 (14:00 +0200)
committerLinus Nordberg <linus@torproject.org>
Sun, 9 Sep 2012 22:43:48 +0000 (00:43 +0200)
If dirvote_create_microdescriptor() returns NULL, don't use md.

Found by "f. tp.".

Fixes bug 6797.

changes/bug6797 [new file with mode: 0644]
src/or/dirserv.c

diff --git a/changes/bug6797 b/changes/bug6797
new file mode 100644 (file)
index 0000000..f52f899
--- /dev/null
@@ -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.
index 7f4690678e648740cf6d5593f1237bea495a203a..e7a2623575c51cd639eda197ee2872571f8ef871 100644 (file)
@@ -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);