Check that we were actually allocated BIGNUMs in dsa_builtin_paramgen2
[openssl.git] / crypto / bio / b_sock.c
index e0038f01887dca6c5b66f609243de5a959e0c083..071acda48e83e6fdbbaffa9b4f68c89ed44bc40b 100644 (file)
@@ -141,7 +141,7 @@ int BIO_get_port(const char *str, unsigned short *port_ptr)
 int BIO_sock_error(int sock)
 {
     int j = 0, i;
-    socklen_t size = 0;
+    socklen_t size = sizeof(j);
 
     /*
      * Note: under Windows the third parameter is of type (char *) whereas
@@ -151,7 +151,7 @@ int BIO_sock_error(int sock)
      */
     i = getsockopt(sock, SOL_SOCKET, SO_ERROR, (void *)&j, &size);
     if (i < 0)
-        return (1);
+        return (get_last_socket_error());
     else
         return (j);
 }
@@ -205,7 +205,7 @@ int BIO_sock_init(void)
     return (1);
 }
 
-void bio_sock_cleanup_intern(void)
+void bio_sock_cleanup_int(void)
 {
 # ifdef OPENSSL_SYS_WINDOWS
     if (wsa_init_done) {