summaryrefslogtreecommitdiff
path: root/src/common/compat.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-07-05 13:42:47 -0400
committerNick Mathewson <nickm@torproject.org>2017-07-05 13:42:47 -0400
commit5ff0f1ab9e3a0b82b177b3f710201d0ad35b69c4 (patch)
tree839ba79f64b266a6f9f94252e8004e8123ff1eca /src/common/compat.c
parent3483f7c00349be6cba7b703f2e5ee94563d0c6eb (diff)
parent6cd6d488dc2469df82d74f0fcc3c84f5b45e8447 (diff)
downloadtor-5ff0f1ab9e3a0b82b177b3f710201d0ad35b69c4.tar.gz
tor-5ff0f1ab9e3a0b82b177b3f710201d0ad35b69c4.zip
Merge branch 'maint-0.2.7-redux' into maint-0.2.8
Diffstat (limited to 'src/common/compat.c')
-rw-r--r--src/common/compat.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/compat.c b/src/common/compat.c
index 23eaa134cf..ede850792f 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -2610,8 +2610,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)