From: Pierangelo Masarati Date: Thu, 24 Nov 2005 22:53:28 +0000 (+0000) Subject: one s/strtol/lutil_atoi/ too much... X-Git-Tag: OPENLDAP_REL_ENG_2_4_BP~708 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=45e188a812bd3e5704b6d604030b52419cf9e364;p=openldap one s/strtol/lutil_atoi/ too much... --- diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 8667d72c52..9590130900 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -3182,13 +3182,15 @@ check_name_index( CfEntryInfo *parent, ConfigType ce_type, Entry *e, dnRdn( &e->e_name, &rdn ); ptr1 = ber_bvchr( &e->e_name, '{' ); if ( ptr1 && ptr1 - e->e_name.bv_val < rdn.bv_len ) { + char *next; ptr2 = strchr( ptr1, '}' ); if (!ptr2 || ptr2 - e->e_name.bv_val > rdn.bv_len) return LDAP_NAMING_VIOLATION; if ( ptr2-ptr1 == 1) return LDAP_NAMING_VIOLATION; gotindex = 1; - if ( lutil_atoi( &index, ptr1 + 1 ) != 0 ) { + index = strtol( ptr1 + 1, &next, 10 ); + if ( next == ptr1 + 1 || next[ 0 ] != '}' ) { return LDAP_NAMING_VIOLATION; } if ( index < 0 ) {