tor

The Tor anonymity network
git clone https://git.dasho.dev/tor.git
Log | Files | Refs | README | LICENSE

commit 3f2d1f7f0730a17b81d2fb94df9b6a5b8b277893
parent 71dd1d716ac83d98ab4592f46b984338a1a7685b
Author: Nick Mathewson <nickm@torproject.org>
Date:   Mon,  5 Jun 2017 12:00:41 -0400

Merge branch 'maint-0.2.6' into maint-0.2.7-redux

Diffstat:
Achanges/bug22490 | 3+++
Msrc/or/geoip.c | 2+-
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/changes/bug22490 b/changes/bug22490 @@ -0,0 +1,3 @@ + o Minor bugfixes (correctness): + - Avoid undefined behavior when parsing IPv6 entries from the geoip6 + file. Fixes bug 22490; bugfix on 0.2.4.6-alpha. diff --git a/src/or/geoip.c b/src/or/geoip.c @@ -145,6 +145,7 @@ geoip_parse_entry(const char *line, sa_family_t family) if (*line == '#') return 0; + char buf[512]; if (family == AF_INET) { unsigned int low, high; if (tor_sscanf(line,"%u,%u,%2s", &low, &high, c) == 3 || @@ -155,7 +156,6 @@ geoip_parse_entry(const char *line, sa_family_t family) goto fail; country = c; } else { /* AF_INET6 */ - char buf[512]; char *low_str, *high_str; struct in6_addr low, high; char *strtok_state;