From: Pierangelo Masarati Date: Mon, 4 Aug 2008 21:06:37 +0000 (+0000) Subject: fix check for single-field firstComponentMatch normalization (ITS#5634) X-Git-Tag: LOCKER_IDS~19 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=afbef0b03549b1bc9d3ee5051a67ff80daf5ff8f;p=openldap fix check for single-field firstComponentMatch normalization (ITS#5634) --- diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 36d51ba23c..fd386a74f2 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -4536,8 +4536,10 @@ firstComponentNormalize( if( val->bv_len < 3 ) return LDAP_INVALID_SYNTAX; - if( val->bv_val[0] != '(' /*')'*/ && - val->bv_val[0] != '{' /*'}'*/ ) + if( ! ( val->bv_val[0] == '(' /*')'*/ + && val->bv_val[val->bv_len - 1] == /*'('*/ ')' ) + && ! ( val->bv_val[0] == '{' /*'}'*/ + && val->bv_val[val->bv_len - 1] == /*'('*/ '}' ) ) { return LDAP_INVALID_SYNTAX; } @@ -4552,7 +4554,7 @@ firstComponentNormalize( /* grab next word */ comp.bv_val = &val->bv_val[len]; - len = val->bv_len - len; + len = val->bv_len - len - STRLENOF(/*"{"*/ "}"); for( comp.bv_len = 0; !ASCII_SPACE(comp.bv_val[comp.bv_len]) && comp.bv_len < len; comp.bv_len++ )