diff options
author | Richard Levitte <levitte@openssl.org> | 2000-07-31 22:49:27 +0000 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2000-07-31 22:49:27 +0000 |
commit | 173e243aaef55ac811365c1b5853ab0571b2c3dd (patch) | |
tree | 9c37b70d73636b11bd4db5e4bde20b47f92d8774 /crypto/bio | |
parent | cc244b371deb21351ec60426c4fa41386bb43316 (diff) |
If a ip address is successfully parsed, the WSA structure under Win32 wasn't
properly initialised. Fixed.
Bug reported by DeJuan Jackson <djackson@inverge.com>
Diffstat (limited to 'crypto/bio')
-rw-r--r-- | crypto/bio/b_sock.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/bio/b_sock.c b/crypto/bio/b_sock.c index b2958788b6..64310058b4 100644 --- a/crypto/bio/b_sock.c +++ b/crypto/bio/b_sock.c @@ -105,17 +105,22 @@ int BIO_get_host_ip(const char *str, unsigned char *ip) struct hostent *he; i=get_ip(str,ip); - if (i > 0) return(1); if (i < 0) { BIOerr(BIO_F_BIO_GET_HOST_IP,BIO_R_INVALID_IP_ADDRESS); goto err; } - /* do a gethostbyname */ + /* At this point, we have something that is most probably correct + in some way, so let's init the socket. */ if (!BIO_sock_init()) return(0); /* don't generate another error code here */ + /* If the string actually contained an IP address, we need not do + anything more */ + if (i > 0) return(1); + + /* do a gethostbyname */ CRYPTO_w_lock(CRYPTO_LOCK_GETHOSTBYNAME); locked = 1; he=BIO_gethostbyname(str); |