]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10370 libldap: don't assert on network input
authorHoward Chu <hyc@openldap.org>
Wed, 23 Jul 2025 21:05:25 +0000 (22:05 +0100)
committerHoward Chu <hyc@openldap.org>
Wed, 23 Jul 2025 21:05:25 +0000 (22:05 +0100)
libraries/libldap/result.c

index 148f81cd8c5660150c8cf0daf5f5b4298a52e2f3..c72ca0faac7dbfef85a41b875acaf7c622d50b74 100644 (file)
@@ -1004,14 +1004,13 @@ nextresp2:
                        static struct berval    bv_nod = BER_BVC( LDAP_NOTICE_OF_DISCONNECTION );
                        struct berval           resoid = BER_BVNULL;
 
-                       if ( ber_scanf( &tmpber, "m", &resoid ) == LBER_ERROR ) {
+                       if (( ber_scanf( &tmpber, "m", &resoid ) == LBER_ERROR ) ||
+                               BER_BVISEMPTY( &resoid )) {
                                ld->ld_errno = LDAP_DECODING_ERROR;
                                ber_free( ber, 1 );
                                return -1;
                        }
 
-                       assert( !BER_BVISEMPTY( &resoid ) );
-
                        is_nod = ber_bvcmp( &resoid, &bv_nod ) == 0;
 
                        tag = ber_peek_tag( &tmpber, &len );