]> git.sur5r.net Git - openldap/commitdiff
ITS#7477 check for invalid LDIF
authorHoward Chu <hyc@openldap.org>
Wed, 19 Dec 2012 17:15:09 +0000 (09:15 -0800)
committerHoward Chu <hyc@openldap.org>
Wed, 19 Dec 2012 17:15:09 +0000 (09:15 -0800)
libraries/libldap/ldifutil.c

index 4bee36ea7eb1e6617e61f481878e86ccdc4590d9..449b5ab963ba4832878ce3b2e89339e3e30c8768 100644 (file)
@@ -356,6 +356,13 @@ short_input:
                /* Make sure all attributes with multiple values are contiguous */
                for (; i<lr->lr_lines; i++) {
                        for (j=i+1; j<lr->lr_lines; j++) {
+                               if ( !lr->lr_btype[j].bv_val ) {
+                                       fprintf( stderr,
+                                               _("%s: missing attributeDescription (line %d, entry \"%s\")\n"),
+                                               errstr, linenum+j, dn );
+                                       rc = LDAP_PARAM_ERROR;
+                                       goto leave;
+                               }
                                if ( BV_CASEMATCH( lr->lr_btype+i, lr->lr_btype+j )) {
                                        nmods--;
                                        /* out of order, move intervening attributes down */