From: Quanah Gibson-Mount Date: Thu, 13 Jan 2011 20:30:54 +0000 (+0000) Subject: Catch ber_scanf errors properly X-Git-Tag: OPENLDAP_REL_ENG_2_4_24~72 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ac741d2b0f5b70316150307ee0de87efda0b26b2;p=openldap Catch ber_scanf errors properly --- diff --git a/servers/slapd/connection.c b/servers/slapd/connection.c index 79d99003af..b9397df38e 100644 --- a/servers/slapd/connection.c +++ b/servers/slapd/connection.c @@ -1525,8 +1525,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 ); diff --git a/servers/slapd/filter.c b/servers/slapd/filter.c index d2f1172ed1..246b4ac6b1 100644 --- a/servers/slapd/filter.c +++ b/servers/slapd/filter.c @@ -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; }