diff options
author | Nick Mathewson <nickm@torproject.org> | 2014-04-25 01:24:39 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2014-04-25 01:24:39 -0400 |
commit | d3c05a79f0b3e688e43edfffe9886664777517f7 (patch) | |
tree | caf18aa657f83c5bf224bd2750dc5e81d2000e3d /src/common/compat.c | |
parent | 12b1d64b0378450fb8c69dfe81fde2d1cd1b36b1 (diff) | |
parent | 5470795b834a788ec482f22091d58b27a1999a2d (diff) | |
download | tor-d3c05a79f0b3e688e43edfffe9886664777517f7.tar.gz tor-d3c05a79f0b3e688e43edfffe9886664777517f7.zip |
Merge branch 'scanbuild_fixes'
Diffstat (limited to 'src/common/compat.c')
-rw-r--r-- | src/common/compat.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/compat.c b/src/common/compat.c index 9b96a35fed..1ba264a0cc 100644 --- a/src/common/compat.c +++ b/src/common/compat.c @@ -2198,8 +2198,10 @@ tor_inet_pton(int af, const char *src, void *dst) else { unsigned byte1,byte2,byte3,byte4; char more; - for (eow = dot-1; eow >= src && TOR_ISDIGIT(*eow); --eow) + for (eow = dot-1; eow > src && TOR_ISDIGIT(*eow); --eow) ; + if (*eow != ':') + return 0; ++eow; /* We use "scanf" because some platform inet_aton()s are too lax |