Commit ec5eba53 authored by Howard Chu's avatar Howard Chu Committed by Quanah Gibson-Mount
Browse files

ITS#9328 cldap: check for error on connected socket

libldap doesn't use a connected socket for UDP sessions, but 3rd
parties can, passed in with ldap_init_fd().
parent 1c7a4f1e
...@@ -486,7 +486,8 @@ retry: ...@@ -486,7 +486,8 @@ retry:
#ifdef LDAP_CONNECTIONLESS #ifdef LDAP_CONNECTIONLESS
if ( LDAP_IS_UDP(ld) ) { if ( LDAP_IS_UDP(ld) ) {
struct sockaddr_storage from; struct sockaddr_storage from;
ber_int_sb_read( lc->lconn_sb, &from, sizeof(struct sockaddr_storage) ); if ( ber_int_sb_read( lc->lconn_sb, &from, sizeof(struct sockaddr_storage) ) < 0 )
goto fail;
if ( ld->ld_options.ldo_version == LDAP_VERSION2 ) isv2 = 1; if ( ld->ld_options.ldo_version == LDAP_VERSION2 ) isv2 = 1;
} }
nextresp3: nextresp3:
...@@ -502,10 +503,11 @@ nextresp3: ...@@ -502,10 +503,11 @@ nextresp3:
break; break;
case LBER_DEFAULT: case LBER_DEFAULT:
fail:
err = sock_errno(); err = sock_errno();
#ifdef LDAP_DEBUG #ifdef LDAP_DEBUG
Debug( LDAP_DEBUG_CONNS, Debug( LDAP_DEBUG_CONNS,
"ber_get_next failed.\n", 0, 0, 0 ); "ber_get_next failed, errno=%d.\n", err, 0, 0 );
#endif #endif
if ( err == EWOULDBLOCK ) return LDAP_MSG_X_KEEP_LOOKING; if ( err == EWOULDBLOCK ) return LDAP_MSG_X_KEEP_LOOKING;
if ( err == EAGAIN ) return LDAP_MSG_X_KEEP_LOOKING; if ( err == EAGAIN ) return LDAP_MSG_X_KEEP_LOOKING;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment