diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-07-05 13:42:37 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-07-05 13:42:37 -0400 |
commit | 6cd6d488dc2469df82d74f0fcc3c84f5b45e8447 (patch) | |
tree | 3ac49e2bd54549fde41743132490a00836eb19fc /src/common/compat.c | |
parent | 9a0fd2dbb187e898f63064c483776538a90562f1 (diff) | |
parent | f6420bceec9707324fe23c98a2a70dd2612f183f (diff) | |
download | tor-6cd6d488dc2469df82d74f0fcc3c84f5b45e8447.tar.gz tor-6cd6d488dc2469df82d74f0fcc3c84f5b45e8447.zip |
Merge branch 'maint-0.2.6' into maint-0.2.7-redux
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 7d72b4b7fd..a1d59e530d 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -2452,8 +2452,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) |