]> git.sur5r.net Git - openldap/commitdiff
ITS#7477 check for invalid LDIF
authorHoward Chu <hyc@symas.com>
Fri, 4 Jan 2013 13:09:56 +0000 (05:09 -0800)
committerHoward Chu <hyc@symas.com>
Fri, 4 Jan 2013 13:09:56 +0000 (05:09 -0800)
clients/tools/ldapmodify.c

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