diff options
author | Nick Mathewson <nickm@torproject.org> | 2012-09-05 13:27:54 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2012-09-05 13:27:54 -0400 |
commit | 9d9ca264ec7505cdaf4a0032eac4489be6a52076 (patch) | |
tree | 79bc3ef1fc00d5ac9e90dbbc40f903668991c95b /src | |
parent | acfd487e7dbf5fa1408a2bba7afff54bc7d0118e (diff) | |
download | tor-9d9ca264ec7505cdaf4a0032eac4489be6a52076.tar.gz tor-9d9ca264ec7505cdaf4a0032eac4489be6a52076.zip |
Avoid segfault if EntryGuardPathBias precedes EntryGuard
Fix for bug 6774; bugfix on 0.2.3.17-beta.
Diffstat (limited to 'src')
-rw-r--r-- | src/or/circuitbuild.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index e5576018a6..9d52b5e021 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -4877,6 +4877,12 @@ entry_guards_parse_state(or_state_t *state, int set, char **msg) const or_options_t *options = get_options(); unsigned hop_cnt, success_cnt; + if (!node) { + *msg = tor_strdup("Unable to parse entry nodes: " + "EntryGuardPathBias without EntryGuard"); + break; + } + if (tor_sscanf(line->value, "%u %u", &success_cnt, &hop_cnt) != 2) { log_warn(LD_GENERAL, "Unable to parse guard path bias info: " "Misformated EntryGuardPathBias %s", escaped(line->value)); |