From: Pierangelo Masarati Date: Mon, 7 Nov 2005 22:53:43 +0000 (+0000) Subject: don't allow '{' in TK_BAREWORD (ITS#4116) X-Git-Tag: OPENLDAP_REL_ENG_2_2_MP~70 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5be72fe816c19d055357b2d63b9692f9429cde50;p=openldap don't allow '{' in TK_BAREWORD (ITS#4116) --- diff --git a/libraries/libldap/schema.c b/libraries/libldap/schema.c index bff6c5bdbe..f478e00324 100644 --- a/libraries/libldap/schema.c +++ b/libraries/libldap/schema.c @@ -1027,6 +1027,9 @@ get_token( const char ** sp, char ** token_val ) **sp != ')' && **sp != '$' && **sp != '\'' && + /* for suggested minimum upper bound on the number + * of characters */ + **sp != '{' && **sp != '\0' ) (*sp)++; q = *sp; @@ -2053,7 +2056,8 @@ ldap_str2attributetype( LDAP_CONST char * s, if ( !at->at_oid ) { if ( ( flags & ( LDAP_SCHEMA_ALLOW_NO_OID | LDAP_SCHEMA_ALLOW_OID_MACRO ) ) - && (ss == savepos) ) { + && (ss == savepos) ) + { /* Backtracking */ ss = savepos; kind = get_token(&ss,&sval); @@ -2070,11 +2074,13 @@ ldap_str2attributetype( LDAP_CONST char * s, !strcasecmp(sval, "COLLECTIVE") || !strcasecmp(sval, "NO-USER-MODIFICATION") || !strcasecmp(sval, "USAGE") || - !strncasecmp(sval, "X-", 2) ) { + !strncasecmp(sval, "X-", 2) ) + { /* Missing OID, backtrack */ ss = savepos; } else if ( flags - & LDAP_SCHEMA_ALLOW_OID_MACRO) { + & LDAP_SCHEMA_ALLOW_OID_MACRO) + { /* Non-numerical OID ... */ int len = ss-savepos; at->at_oid = LDAP_MALLOC(len+1);