]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10429 Empty types are not valid LDIF, reject sooner
authorOndřej Kuzník <ondra@mistotebe.net>
Wed, 28 Jan 2026 10:25:55 +0000 (10:25 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 29 Jan 2026 16:14:30 +0000 (16:14 +0000)
libraries/libldap/ldif.c

index 33bebb59a57fa1f9ff0e20bf6e205cb48169649f..9ed37eb1143f2c1c94eb34ac4a5603aa8a2b070d 100644 (file)
@@ -136,6 +136,14 @@ ldif_parse_line2(
        *s++ = '\0';
        type->bv_len = p - type->bv_val + 1;
 
+       if ( BER_BVISEMPTY( type ) ) {
+               /* no type is present, error out */
+               ber_pvt_log_printf( LDAP_DEBUG_PARSE, ldif_debug,
+                       _("ldif_parse_line: empty type is invalid\n") );
+               if ( !freeval ) ber_memfree( line );
+               return( -1 );
+       }
+
        url = 0;
        b64 = 0;