summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/bio/b_sock.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libcrypto/bio/b_sock.c')
-rw-r--r--src/lib/libcrypto/bio/b_sock.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/libcrypto/bio/b_sock.c b/src/lib/libcrypto/bio/b_sock.c
index 64310058b4..62cc3f1a0c 100644
--- a/src/lib/libcrypto/bio/b_sock.c
+++ b/src/lib/libcrypto/bio/b_sock.c
@@ -113,8 +113,8 @@ int BIO_get_host_ip(const char *str, unsigned char *ip)
113 113
114 /* At this point, we have something that is most probably correct 114 /* At this point, we have something that is most probably correct
115 in some way, so let's init the socket. */ 115 in some way, so let's init the socket. */
116 if (!BIO_sock_init()) 116 if (BIO_sock_init() != 1)
117 return(0); /* don't generate another error code here */ 117 return 0; /* don't generate another error code here */
118 118
119 /* If the string actually contained an IP address, we need not do 119 /* If the string actually contained an IP address, we need not do
120 anything more */ 120 anything more */
@@ -519,15 +519,15 @@ int BIO_get_accept_socket(char *host, int bind_mode)
519 { 519 {
520 int ret=0; 520 int ret=0;
521 struct sockaddr_in server,client; 521 struct sockaddr_in server,client;
522 int s= -1,cs; 522 int s=INVALID_SOCKET,cs;
523 unsigned char ip[4]; 523 unsigned char ip[4];
524 unsigned short port; 524 unsigned short port;
525 char *str,*e; 525 char *str=NULL,*e;
526 const char *h,*p; 526 const char *h,*p;
527 unsigned long l; 527 unsigned long l;
528 int err_num; 528 int err_num;
529 529
530 if (!BIO_sock_init()) return(INVALID_SOCKET); 530 if (BIO_sock_init() != 1) return(INVALID_SOCKET);
531 531
532 if ((str=BUF_strdup(host)) == NULL) return(INVALID_SOCKET); 532 if ((str=BUF_strdup(host)) == NULL) return(INVALID_SOCKET);
533 533
@@ -553,7 +553,7 @@ int BIO_get_accept_socket(char *host, int bind_mode)
553 h="*"; 553 h="*";
554 } 554 }
555 555
556 if (!BIO_get_port(p,&port)) return(INVALID_SOCKET); 556 if (!BIO_get_port(p,&port)) goto err;
557 557
558 memset((char *)&server,0,sizeof(server)); 558 memset((char *)&server,0,sizeof(server));
559 server.sin_family=AF_INET; 559 server.sin_family=AF_INET;
@@ -563,7 +563,7 @@ int BIO_get_accept_socket(char *host, int bind_mode)
563 server.sin_addr.s_addr=INADDR_ANY; 563 server.sin_addr.s_addr=INADDR_ANY;
564 else 564 else
565 { 565 {
566 if (!BIO_get_host_ip(h,&(ip[0]))) return(INVALID_SOCKET); 566 if (!BIO_get_host_ip(h,&(ip[0]))) goto err;
567 l=(unsigned long) 567 l=(unsigned long)
568 ((unsigned long)ip[0]<<24L)| 568 ((unsigned long)ip[0]<<24L)|
569 ((unsigned long)ip[1]<<16L)| 569 ((unsigned long)ip[1]<<16L)|