mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-04-18 15:20:35 +08:00
Cast ctype.h arguments to unsigned char.
This commit is contained in:
parent
f963a16150
commit
120e39b533
@ -619,17 +619,19 @@ parse_ldif_control( char *line,
|
||||
pcolon = s; /* Save this position for later */
|
||||
if (*s++ != ':') /* Make sure colon follows */
|
||||
return ( LDAP_PARAM_ERROR );
|
||||
while (*s && isspace(*s)) s++; /* Skip white space before OID */
|
||||
while (*s && isspace((unsigned char)*s))
|
||||
s++; /* Skip white space before OID */
|
||||
|
||||
/* OID should come next. Validate and extract it. */
|
||||
if (*s == 0)
|
||||
return ( LDAP_PARAM_ERROR );
|
||||
oidStart = s;
|
||||
while (isdigit(*s) || *s == '.') s++; /* OID should be digits or . */
|
||||
while (isdigit((unsigned char)*s) || *s == '.')
|
||||
s++; /* OID should be digits or . */
|
||||
if (s == oidStart)
|
||||
return ( LDAP_PARAM_ERROR ); /* OID was not present */
|
||||
if (*s) { /* End of OID should be space or NULL */
|
||||
if (!isspace(*s))
|
||||
if (!isspace((unsigned char)*s))
|
||||
return ( LDAP_PARAM_ERROR ); /* else OID contained invalid chars */
|
||||
*s++ = 0; /* Replace space with null to terminate */
|
||||
}
|
||||
@ -640,7 +642,8 @@ parse_ldif_control( char *line,
|
||||
return ( LDAP_NO_MEMORY );
|
||||
|
||||
/* Optional Criticality field is next. */
|
||||
while (*s && isspace(*s)) s++; /* Skip white space before criticality */
|
||||
while (*s && isspace((unsigned char)*s))
|
||||
s++; /* Skip white space before criticality */
|
||||
if (strncasecmp(s, "true", 4) == 0) {
|
||||
criticality = 1;
|
||||
s += 4;
|
||||
@ -651,7 +654,8 @@ parse_ldif_control( char *line,
|
||||
}
|
||||
|
||||
/* Optional value field is next */
|
||||
while (*s && isspace(*s)) s++; /* Skip white space before value */
|
||||
while (*s && isspace((unsigned char)*s))
|
||||
s++; /* Skip white space before value */
|
||||
if (*s) {
|
||||
if (*s != ':') { /* If value is present, must start with : */
|
||||
rc = LDAP_PARAM_ERROR;
|
||||
|
@ -737,7 +737,7 @@ getNextPage:
|
||||
}
|
||||
buf[i] = '\0';
|
||||
|
||||
if ( i > 0 && isdigit( buf[0] ) ) {
|
||||
if ( i > 0 && isdigit( (unsigned char)buf[0] ) ) {
|
||||
int num = sscanf( buf, "%d", &tmpSize );
|
||||
if ( num != 1 ) {
|
||||
fprintf( stderr, "Invalid value for PagedResultsControl, %s.\n", buf);
|
||||
|
@ -1004,7 +1004,7 @@ ldap_pvt_tls_check_hostname( LDAP *ld, void *s, const char *name_in )
|
||||
LDAP_FREE(n2);
|
||||
} else
|
||||
#endif
|
||||
if ((ptr = strrchr(name, '.')) && isdigit(ptr[1])) {
|
||||
if ((ptr = strrchr(name, '.')) && isdigit((unsigned char)ptr[1])) {
|
||||
if (inet_aton(name, (struct in_addr *)&addr))
|
||||
ntype = IS_IP4;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user