if (*dp - keys == 0)
return LDNS_STATUS_SYNTAX_SVCPARAM_VALUE_ERR;
- if (**s && !isspace(**s))
+ if (**s && !isspace((unsigned char)**s))
return LDNS_STATUS_SYNTAX_SVCPARAM_VALUE_ERR;
/* In draft-ietf-dnsop-svcb-https-02 Section 7:
}
*s += 1;
- } else while (**s && !isspace(**s)) {
+ } else while (**s && !isspace((unsigned char)**s)) {
if (**s == ',') {
len = *dp - val;
if (len == 0 || len > 255)
if (len == 0 || len > 255)
return LDNS_STATUS_INVALID_STR;
val[-1] = len;
- return **s && !isspace(**s) ? LDNS_STATUS_SYNTAX_SVCPARAM_VALUE_ERR
- : LDNS_STATUS_OK;
+ return **s && !isspace((unsigned char)**s)
+ ? LDNS_STATUS_SYNTAX_SVCPARAM_VALUE_ERR
+ : LDNS_STATUS_OK;
}
static ldns_status
}
*s += 1;
- } else while (**s && !isspace(**s)) {
+ } else while (**s && !isspace((unsigned char)**s)) {
if (*dp + 1 > eod)
return LDNS_STATUS_RDATA_OVERFLOW;
else
*dp += 1;
}
- return **s && !isspace(**s) ? LDNS_STATUS_SYNTAX_SVCPARAM_VALUE_ERR
- : LDNS_STATUS_OK;
+ return **s && !isspace((unsigned char)**s)
+ ? LDNS_STATUS_SYNTAX_SVCPARAM_VALUE_ERR
+ : LDNS_STATUS_OK;
}
static ldns_status
char ipv4_str[16];
size_t len;
- while (isdigit(**s) || **s == '.')
+ while (isdigit((unsigned char)**s) || **s == '.')
*s += 1;
len = *s - ipv4_start;
return LDNS_STATUS_INVALID_STR;
*s += 1;
}
- return **s && !isspace(**s) ? LDNS_STATUS_SYNTAX_SVCPARAM_VALUE_ERR
- : LDNS_STATUS_OK;
+ return **s && !isspace((unsigned char)**s)
+ ? LDNS_STATUS_SYNTAX_SVCPARAM_VALUE_ERR
+ : LDNS_STATUS_OK;
}
static ldns_status
quoted = true;
}
b64_str = *s;
- while (isalnum(**s) || **s == '+' || **s == '/' || **s == '=')
+ while (isalnum((unsigned char)**s) || **s == '+'
+ || **s == '/'
+ || **s == '=')
*s += 1;
len = *s - b64_str;
return LDNS_STATUS_INVALID_STR;
*s += 1;
}
- if (**s && !isspace(**s))
+ if (**s && !isspace((unsigned char)**s))
return LDNS_STATUS_SYNTAX_SVCPARAM_VALUE_ERR;
out_len = ldns_b64_pton_calculate_size(len);
char ipv6_str[INET6_ADDRSTRLEN];
size_t len;
- while (isxdigit(**s) || **s == ':' || **s == '.')
+ while (isxdigit((unsigned char)**s) || **s == ':' || **s == '.')
*s += 1;
len = *s - ipv6_start;
return LDNS_STATUS_INVALID_STR;
*s += 1;
}
- return **s && !isspace(**s) ? LDNS_STATUS_SYNTAX_SVCPARAM_VALUE_ERR
- : LDNS_STATUS_OK;
+ return **s && !isspace((unsigned char)**s)
+ ? LDNS_STATUS_SYNTAX_SVCPARAM_VALUE_ERR
+ : LDNS_STATUS_OK;
}
struct struct_svcparam_key_def {
unsigned long int num;
/* parse key */
- while (islower(**s) || isdigit(**s) || **s == '-')
+ while (islower((unsigned char)**s) || isdigit((unsigned char)**s)
+ || **s == '-')
*s += 1;
len = *s - key_str;
ldns_write_uint16(*dp, key);
ldns_write_uint16(*dp + 2, 0);
*dp += 4;
- if (isspace(**s) || !**s)
+ if (isspace((unsigned char)**s) || !**s)
return LDNS_STATUS_OK;
else if (**s != '=')
/* Fill data with parsed bytes */
for (;;) {
- while (isspace(*str))
+ while (isspace((unsigned char)*str))
str += 1;
if(!*str)
break;