]> 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 42879ee76e362aebbf22a2afd96e386a9d045e67..b6d574be670befad36ef4e3ff4213cfcfb48f027 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2007 The OpenLDAP Foundation.
+ * Copyright 1998-2008 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -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;