]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/oc.c
don't return entry if requested attr is not present (ITS#5650)
[openldap] / servers / slapd / oc.c
index 8f1bd67ebc5107cb2ae6df5ca28ae4e729e3db00..b6d574be670befad36ef4e3ff4213cfcfb48f027 100644 (file)
@@ -502,6 +502,10 @@ oc_next( ObjectClass **oc )
        }
 #endif
 
+       if ( *oc == NULL ) {
+               return 0;
+       }
+
        *oc = LDAP_STAILQ_NEXT(*oc,soc_next);
 
        return (*oc != NULL);
@@ -892,7 +896,7 @@ oc_schema_info( Entry *e )
 }
 
 int
-register_oc( char *def, ObjectClass **soc, int dupok )
+register_oc( const char *def, ObjectClass **soc, int dupok )
 {
        LDAPObjectClass *oc;
        int code;