diff options
author | Nick Mathewson <nickm@torproject.org> | 2017-07-05 13:43:21 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2017-07-05 13:43:21 -0400 |
commit | 32c0066e4baa2ca16902a70b941d8d3afbc279ff (patch) | |
tree | 7cc360fa9450abe7207455f988bc34158a995643 /src/common/compat.c | |
parent | bb97f680e74170673246b3de32e847ade46840f2 (diff) | |
parent | 5ff0f1ab9e3a0b82b177b3f710201d0ad35b69c4 (diff) | |
download | tor-32c0066e4baa2ca16902a70b941d8d3afbc279ff.tar.gz tor-32c0066e4baa2ca16902a70b941d8d3afbc279ff.zip |
Merge branch 'maint-0.2.8' into maint-0.2.9
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 8d6a491c42..6b12753c95 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -2579,8 +2579,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) |