diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-07-05 13:42:32 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-07-05 13:42:32 -0400 |
commit | f6420bceec9707324fe23c98a2a70dd2612f183f (patch) | |
tree | 100631d39c5d0c2014f8195293b1e3aacd88555d /src/common/compat.c | |
parent | 3de27618e65affe3688a5d92bce96e1e4ed5a82a (diff) | |
parent | ff8c230d7cadb6c24dcf9c121521cff976fc83a5 (diff) | |
download | tor-f6420bceec9707324fe23c98a2a70dd2612f183f.tar.gz tor-f6420bceec9707324fe23c98a2a70dd2612f183f.zip |
Merge branch 'maint-0.2.5' into maint-0.2.6
Diffstat (limited to 'src/common/compat.c')
-rw-r--r-- | src/common/compat.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index 1788e32ee3..6b9f1f71f2 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -2370,8 +2370,12 @@ tor_inet_pton(int af, const char *src, void *dst) char *next; ssize_t len; long r = strtol(src, &next, 16); - tor_assert(next != NULL); - tor_assert(next != src); + if (next == NULL || next == src) { + /* The 'next == src' error case can happen on versions of openbsd + * where treats "0xfoo" as an error, rather than as "0" followed by + * "xfoo". */ + return 0; + } len = *next == '\0' ? eow - src : next - src; if (len > 4) |