Don't follow the NULL pointer.

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

Found by "f. tp.".

Fixes bug 6797.
This commit is contained in:
Linus Nordberg 2012-09-05 14:00:55 +02:00
parent f6639d5676
commit 93ee62297f
2 changed files with 5 additions and 2 deletions

3
changes/bug6797 Normal file
View File

@ -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.

View 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);