]> git.sur5r.net Git - openldap/commitdiff
LDAPworld P4: SLAPD Crash when Schema Checking
authorKurt Zeilenga <kurt@openldap.org>
Sun, 9 Aug 1998 02:36:33 +0000 (02:36 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Sun, 9 Aug 1998 02:36:33 +0000 (02:36 +0000)
servers/slapd/schema.c

index ba16d9b0f13540041d9b221fcc4db4888f99a794..a5c297fbe3995976e2307fcb6101273322c86c93 100644 (file)
@@ -111,14 +111,16 @@ oc_check_allowed( char *type, struct berval **ocl )
                /* if we know about the oc */
                if ( (oc = oc_find( ocl[i]->bv_val )) != NULL ) {
                        /* does it require the type? */
-                       for ( j = 0; oc->oc_required[j] != NULL; j++ ) {
+                       for ( j = 0; oc->oc_required != NULL && 
+                               oc->oc_required[j] != NULL; j++ ) {
                                if ( strcasecmp( oc->oc_required[j], type )
                                    == 0 ) {
                                        return( 0 );
                                }
                        }
                        /* does it allow the type? */
-                       for ( j = 0; oc->oc_allowed[j] != NULL; j++ ) {
+                       for ( j = 0; oc->oc_allowed != NULL && 
+                               oc->oc_allowed[j] != NULL; j++ ) {
                                if ( strcasecmp( oc->oc_allowed[j], type )
                                    == 0 || strcmp( oc->oc_allowed[j], "*" )
                                    == 0 )