]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/os-ip.c
Fix ITS#1843, don't deref NULL string in ldap_pvt_str2upper
[openldap] / libraries / libldap / os-ip.c
index 3ebe3e719d7c57f99d9a7bddcc7ff71a3e6ee034..0084743d8498fe922a32e9aade7835416abbe656 100644 (file)
@@ -152,7 +152,7 @@ ldap_pvt_is_socket_ready(LDAP *ld, int s)
 #if defined( notyet ) /* && defined( SO_ERROR ) */
 {
        int so_errno;
-       int dummy = sizeof(so_errno);
+       socklen_t dummy = sizeof(so_errno);
        if ( getsockopt( s, SOL_SOCKET, SO_ERROR, &so_errno, &dummy )
                == AC_SOCKET_ERROR )
        {
@@ -170,7 +170,7 @@ ldap_pvt_is_socket_ready(LDAP *ld, int s)
        /* error slippery */
        struct sockaddr_in sin;
        char ch;
-       int dummy = sizeof(sin);
+       socklen_t dummy = sizeof(sin);
        if ( getpeername( s, (struct sockaddr *) &sin, &dummy )
                == AC_SOCKET_ERROR )
        {
@@ -344,7 +344,7 @@ ldap_connect_to_host(LDAP *ld, Sockbuf *sb,
                hints.ai_socktype = socktype;
 
                snprintf(serv, sizeof serv, "%d", port );
-               if ( err = getaddrinfo(host, serv, &hints, &res) ) {
+               if ( ( err = getaddrinfo(host, serv, &hints, &res) ) ) {
                        osip_debug(ld, "ldap_connect_to_host: getaddrinfo failed: %s\n",
                                AC_GAI_STRERROR(err), 0, 0);
                        return -1;