aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/bio/b_sock.c
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2001-06-25 14:12:45 +0000
committerRichard Levitte <levitte@openssl.org>2001-06-25 14:12:45 +0000
commitb1460627f30ac4a315b87c5b00b8363b11bcf673 (patch)
tree4df8f7e4d2ffc72e6d971af1d7cb3342b69c4495 /crypto/bio/b_sock.c
parent5abc8ae6f95881bbf97c4a0f59237f76238db5e1 (diff)
downloadopenssl-b1460627f30ac4a315b87c5b00b8363b11bcf673.tar.gz
Make get_ip() a bit more strict in it's parsing of IP addresses, and
at the same time a bit more accepting with host names.
Diffstat (limited to 'crypto/bio/b_sock.c')
-rw-r--r--crypto/bio/b_sock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c
index d4b44b62bb..5b66603d7d 100644
--- a/crypto/bio/b_sock.c
+++ b/crypto/bio/b_sock.c
@@ -494,16 +494,16 @@ static int get_ip(const char *str, unsigned char ip[4])
{
ok=1;
tmp[num]=tmp[num]*10+c-'0';
- if (tmp[num] > 255) return(-1);
+ if (tmp[num] > 255) return(0);
}
else if (c == '.')
{
if (!ok) return(-1);
- if (num == 3) break;
+ if (num == 3) return(0);
num++;
ok=0;
}
- else if ((num == 3) && ok)
+ else if (c == '\0' && (num == 3) && ok)
break;
else
return(0);