From 5be72fe816c19d055357b2d63b9692f9429cde50 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Mon, 7 Nov 2005 22:53:43 +0000 Subject: [PATCH] don't allow '{' in TK_BAREWORD (ITS#4116) --- libraries/libldap/schema.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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); -- 2.39.5