From afbef0b03549b1bc9d3ee5051a67ff80daf5ff8f Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 4 Aug 2008 21:06:37 +0000 Subject: [PATCH] fix check for single-field firstComponentMatch normalization (ITS#5634) --- servers/slapd/schema_init.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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++ ) -- 2.39.5