From: Pierangelo Masarati Date: Mon, 3 Jan 2005 18:09:03 +0000 (+0000) Subject: fix group limits when objectClass/attribute are provided X-Git-Tag: OPENLDAP_REL_ENG_2_3_BP~470 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2ed3625a13c63c74a7f502464be7feec18f37f92;p=openldap fix group limits when objectClass/attribute are provided --- diff --git a/servers/slapd/limits.c b/servers/slapd/limits.c index e2505f6cf9..49892a049a 100644 --- a/servers/slapd/limits.c +++ b/servers/slapd/limits.c @@ -494,8 +494,12 @@ limits_parse( struct berval oc, ad; oc.bv_val = pattern + 1; + pattern = strchr( pattern, '=' ); + if ( pattern == NULL ) { + return -1; + } - ad.bv_val = strchr(pattern, '/'); + ad.bv_val = strchr( oc.bv_val, '/' ); if ( ad.bv_val != NULL ) { const char *text = NULL; int rc; @@ -503,18 +507,14 @@ limits_parse( oc.bv_len = ad.bv_val - oc.bv_val; ad.bv_val++; - ad.bv_len = strlen( ad.bv_val ); + ad.bv_len = pattern - ad.bv_val; rc = slap_bv2ad( &ad, &group_ad, &text ); if ( rc != LDAP_SUCCESS ) { goto no_ad; } - pattern = ad.bv_val + ad.bv_len; - } else { - oc.bv_len = strlen( oc.bv_val ); - - pattern = oc.bv_val + oc.bv_len; + oc.bv_len = pattern - oc.bv_val; } group_oc = oc_bvfind( &oc );