summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2017-07-05 13:42:26 -0400
committerNick Mathewson <nickm@torproject.org>2017-07-05 13:42:26 -0400
commitff8c230d7cadb6c24dcf9c121521cff976fc83a5 (patch)
treefe76df5da20a4c5292a4ef4588596867e3e0f045 /src/common
parentccae991662adb3b64bdb1dcd4a942e4d1e163414 (diff)
parent0ee15c92d5486fc73ba49dea7f12bf2f89012cfb (diff)
downloadtor-ff8c230d7cadb6c24dcf9c121521cff976fc83a5.tar.gz
tor-ff8c230d7cadb6c24dcf9c121521cff976fc83a5.zip
Merge branch 'maint-0.2.4' into maint-0.2.5
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 e25ecc462d..53d0623c84 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -2332,8 +2332,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)