X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=servers%2Fslapd%2Fschema_init.c;h=f1a96bd0815115ba66b3342850ec6981155179f1;hb=2bfe79fe884565801600e309d1fcbefa41fb0f4b;hp=39952664dbf8966fed66c3c3eb3010e40d704141;hpb=eb9a3c18767fe87d2a1f7fbbc6b3d676779eb5b7;p=openldap diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 39952664db..f1a96bd081 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -2353,16 +2353,11 @@ numericStringNormalize( * Integer conversion macros that will use the largest available * type. */ -#if defined(HAVE_STRTOLL) && defined(LLONG_MAX) \ - && defined(LLONG_MIN) && defined(HAVE_LONG_LONG) +#if defined(HAVE_STRTOLL) && defined(HAVE_LONG_LONG) # define SLAP_STRTOL(n,e,b) strtoll(n,e,b) -# define SLAP_LONG_MAX LLONG_MAX -# define SLAP_LONG_MIN LLONG_MIN # define SLAP_LONG long long #else # define SLAP_STRTOL(n,e,b) strtol(n,e,b) -# define SLAP_LONG_MAX LONG_MAX -# define SLAP_LONG_MIN LONG_MIN # define SLAP_LONG long #endif /* HAVE_STRTOLL ... */ @@ -2377,18 +2372,17 @@ integerBitAndMatch( { SLAP_LONG lValue, lAssertedValue; + errno = 0; /* safe to assume integers are NUL terminated? */ lValue = SLAP_STRTOL(value->bv_val, NULL, 10); - if(( lValue == SLAP_LONG_MIN || lValue == SLAP_LONG_MAX) && - errno == ERANGE ) + if( errno == ERANGE ) { return LDAP_CONSTRAINT_VIOLATION; } lAssertedValue = SLAP_STRTOL(((struct berval *)assertedValue)->bv_val, NULL, 10); - if(( lAssertedValue == SLAP_LONG_MIN || lAssertedValue == SLAP_LONG_MAX ) && - errno == ERANGE ) + if( errno == ERANGE ) { return LDAP_CONSTRAINT_VIOLATION; } @@ -2408,18 +2402,17 @@ integerBitOrMatch( { SLAP_LONG lValue, lAssertedValue; + errno = 0; /* safe to assume integers are NUL terminated? */ lValue = SLAP_STRTOL(value->bv_val, NULL, 10); - if(( lValue == SLAP_LONG_MIN || lValue == SLAP_LONG_MAX ) && - errno == ERANGE ) + if( errno == ERANGE ) { return LDAP_CONSTRAINT_VIOLATION; } lAssertedValue = SLAP_STRTOL( ((struct berval *)assertedValue)->bv_val, NULL, 10); - if(( lAssertedValue == SLAP_LONG_MIN || lAssertedValue == SLAP_LONG_MAX ) && - errno == ERANGE ) + if( errno == ERANGE ) { return LDAP_CONSTRAINT_VIOLATION; } @@ -4681,6 +4674,8 @@ schema_destroy( void ) mru_destroy(); syn_destroy(); - ldap_pvt_thread_mutex_destroy( &ad_undef_mutex ); - ldap_pvt_thread_mutex_destroy( &oc_undef_mutex ); + if( schema_init_done ) { + ldap_pvt_thread_mutex_destroy( &ad_undef_mutex ); + ldap_pvt_thread_mutex_destroy( &oc_undef_mutex ); + } }