summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-07-05 13:43:31 -0400
committerNick Mathewson <nickm@torproject.org>2017-07-05 13:43:31 -0400
commit5434b2451e73bd4cd5eb62fb5e6c468eeee70153 (patch)
treede70e85c16f53fdbe3c7c12031e3b3ae3b79dec1 /src/common
parent0f97f963e3c267852a3f28538c5ddb196ce0bb42 (diff)
parent546f5b364bd8198b23b1ad4e66790eb1ce9b438e (diff)
downloadtor-5434b2451e73bd4cd5eb62fb5e6c468eeee70153.tar.gz
tor-5434b2451e73bd4cd5eb62fb5e6c468eeee70153.zip
Merge branch 'maint-0.3.0' into maint-0.3.1
Diffstat (limited to 'src/common')
-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 acd2df7c6e..fb712f26d9 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -2598,8 +2598,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)