summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-05-29 15:08:55 +0000
committerNick Mathewson <nickm@torproject.org>2007-05-29 15:08:55 +0000
commit69c712f1899d3e42fd563136e78af4cb62472b56 (patch)
treee253bfc3e6dc69035cc30a309a2f12800bbf4b55
parentfd3aa5c85d8dbae3663cefdb7be7de0d1c281a57 (diff)
downloadtor-69c712f1899d3e42fd563136e78af4cb62472b56.tar.gz
tor-69c712f1899d3e42fd563136e78af4cb62472b56.zip
r13048@catbus: nickm | 2007-05-29 11:08:53 -0400
Oops; better version of previous patch that does not get caught in an infinite loop. svn:r10391
-rw-r--r--src/or/routerparse.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index fc4438c952..a21952c2f0 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -900,23 +900,26 @@ router_parse_list_from_string(const char **s, const char *eos,
if (!end)
break;
+ elt = NULL;
+
if (have_extrainfo && want_extrainfo) {
routerlist_t *rl = router_get_routerlist();
extrainfo = extrainfo_parse_entry_from_string(*s, end,
saved_location != SAVED_IN_CACHE,
rl->identity_map);
- if (!extrainfo)
- continue;
- signed_desc = &extrainfo->cache_info;
- elt = extrainfo;
+ if (extrainfo) {
+ signed_desc = &extrainfo->cache_info;
+ elt = extrainfo;
+ }
} else if (!have_extrainfo && !want_extrainfo) {
router = router_parse_entry_from_string(*s, end,
saved_location != SAVED_IN_CACHE);
- if (!router)
- continue;
- signed_desc = &router->cache_info;
- elt = router;
- } else {
+ if (router) {
+ signed_desc = &router->cache_info;
+ elt = router;
+ }
+ }
+ if (!elt) {
*s = end;
continue;
}