Catch ber_scanf errors properly

This commit is contained in:
Hallvard Furuseth 2011-01-12 14:41:33 +00:00
parent dd640af54f
commit 6223282235
2 changed files with 3 additions and 4 deletions

View File

@ -1526,8 +1526,8 @@ connection_input( Connection *conn , conn_readinfo *cri )
#ifdef LDAP_CONNECTIONLESS
if( conn->c_is_udp ) {
if( tag == LBER_OCTETSTRING ) {
ber_get_stringa( ber, &cdn );
tag = ber_peek_tag(ber, &len);
if ( (tag = ber_get_stringa( ber, &cdn )) != LBER_ERROR )
tag = ber_peek_tag( ber, &len );
}
if( tag != LDAP_REQ_ABANDON && tag != LDAP_REQ_SEARCH ) {
Debug( LDAP_DEBUG_ANY, "invalid req for UDP 0x%lx\n", tag, 0, 0 );

View File

@ -402,8 +402,7 @@ get_ssa(
{
unsigned usage;
rc = ber_scanf( ber, "m", &value );
if ( rc == LBER_ERROR ) {
if ( ber_scanf( ber, "m", &value ) == LBER_ERROR ) {
rc = SLAPD_DISCONNECT;
goto return_error;
}