]> git.sur5r.net Git - openldap/commitdiff
Catch ber_scanf errors properly
authorQuanah Gibson-Mount <quanah@openldap.org>
Thu, 13 Jan 2011 20:30:54 +0000 (20:30 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 13 Jan 2011 20:30:54 +0000 (20:30 +0000)
servers/slapd/connection.c
servers/slapd/filter.c

index 79d99003af4b977dc796aa23a55ffc159aff45cc..b9397df38e29e896b70ede5e1fcd8c4225631287 100644 (file)
@@ -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 );
index d2f1172ed1ea1848be239c3d4e5c4337604bb342..246b4ac6b13c0cd856f6d097bf281f6c0a064f3a 100644 (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;
                }