aboutsummaryrefslogtreecommitdiff
path: root/src/or/routerparse.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2014-09-02 11:55:53 -0400
committerNick Mathewson <nickm@torproject.org>2014-09-02 11:56:56 -0400
commitefcab439564dcadc5bc14609a9205d73d236e966 (patch)
tree32b90aeed52b5d76bb862bd824b16bf0e2c7829a /src/or/routerparse.c
parent8139db372528ca02cd572f3f7848e9d174a9b12e (diff)
downloadtor-efcab439564dcadc5bc14609a9205d73d236e966.tar.gz
tor-efcab439564dcadc5bc14609a9205d73d236e966.zip
Fix a number of clang analyzer false-positives
Most of these are in somewhat non-obvious code where it is probably a good idea to initialize variables and add extra assertions anyway. Closes 13036. Patches from "teor".
Diffstat (limited to 'src/or/routerparse.c')
-rw-r--r--src/or/routerparse.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 5add728d6d..f990cebd82 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -923,7 +923,7 @@ router_parse_list_from_string(const char **s, const char *eos,
{
routerinfo_t *router;
extrainfo_t *extrainfo;
- signed_descriptor_t *signed_desc;
+ signed_descriptor_t *signed_desc = NULL;
void *elt;
const char *end, *start;
int have_extrainfo;
@@ -980,6 +980,7 @@ router_parse_list_from_string(const char **s, const char *eos,
continue;
}
if (saved_location != SAVED_NOWHERE) {
+ tor_assert(signed_desc);
signed_desc->saved_location = saved_location;
signed_desc->saved_offset = *s - start;
}