[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[tor-commits] [tor/maint-0.2.2] Avoid possible segfault when handling networkstatus vote with bad flavor
commit 57e35ad3d91724882c345ac709666a551a977f0f
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date: Fri Aug 3 10:53:00 2012 -0400
Avoid possible segfault when handling networkstatus vote with bad flavor
Fix for 6530; fix on 0.2.2.6-alpha.
---
changes/bug6530 | 4 ++++
src/or/routerparse.c | 2 +-
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/changes/bug6530 b/changes/bug6530
new file mode 100644
index 0000000..a6b7caa
--- /dev/null
+++ b/changes/bug6530
@@ -0,0 +1,4 @@
+ o Major bugfixes:
+ - Avoid a read of uninitializd RAM when reading a vote or consensus
+ document with an unrecognized flavor name. Fixes bug 6530; bugfix on
+ 0.2.2.6-alpha.
diff --git a/src/or/routerparse.c b/src/or/routerparse.c
index 8c4f582..2ff546b 100644
--- a/src/or/routerparse.c
+++ b/src/or/routerparse.c
@@ -2821,7 +2821,7 @@ networkstatus_parse_vote_from_string(const char *s, const char **eos_out,
int flavor = networkstatus_parse_flavor_name(tok->args[1]);
if (flavor < 0) {
log_warn(LD_DIR, "Can't parse document with unknown flavor %s",
- escaped(tok->args[2]));
+ escaped(tok->args[1]));
goto err;
}
ns->flavor = flav = flavor;
_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits