2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-30 05:57:52 +00:00

Merge branch '2567-warning-array-subscript-is-of-type-char-on-netbsd-9' into 'main'

Resolve "warning: array subscript is of type 'char' on NetBSD 9"

Closes #2567

See merge request isc-projects/bind9!4794
This commit is contained in:
Mark Andrews 2021-03-15 03:33:21 +00:00
commit a9339fe7fc
3 changed files with 19 additions and 14 deletions

View File

@ -1,3 +1,6 @@
5598. [port] Cast (char) to (unsigned char) when calling ctype
tests. [GL #2567]
5597. [bug] When serve-stale was enabled and starting the recursive
resolution process for a query failed, a named instance
could crash if it was configured as both a recursive and

View File

@ -2585,9 +2585,9 @@ typedef struct isc_httpparser_state {
} isc_httpparser_state_t;
#define MATCH(ch) (st->str[0] == (ch))
#define MATCH_ALPHA() isalpha(st->str[0])
#define MATCH_ALNUM() isalnum(st->str[0])
#define MATCH_XDIGIT() isxdigit(st->str[0])
#define MATCH_ALPHA() isalpha((unsigned char)(st->str[0]))
#define MATCH_ALNUM() isalnum((unsigned char)(st->str[0]))
#define MATCH_XDIGIT() isxdigit((unsigned char)(st->str[0]))
#define ADVANCE() st->str++
#define GETP() (st->str)

View File

@ -191,15 +191,17 @@ typedef enum {
((c) == '-' || (c) == '_' || (c) == '.' || (c) == '!' || (c) == '~' || \
(c) == '*' || (c) == '\'' || (c) == '(' || (c) == ')')
#define IS_USERINFO_CHAR(c) \
(isalnum(c) || IS_MARK(c) || (c) == '%' || (c) == ';' || (c) == ':' || \
(c) == '&' || (c) == '=' || (c) == '+' || (c) == '$' || (c) == ',')
(isalnum((unsigned char)c) || IS_MARK(c) || (c) == '%' || \
(c) == ';' || (c) == ':' || (c) == '&' || (c) == '=' || (c) == '+' || \
(c) == '$' || (c) == ',')
#if HTTP_PARSER_STRICT
#define IS_URL_CHAR(c) (BIT_AT(normal_url_char, (unsigned char)c))
#define IS_HOST_CHAR(c) (isalnum(c) || (c) == '.' || (c) == '-')
#define IS_HOST_CHAR(c) (isalnum((unsigned char)c) || (c) == '.' || (c) == '-')
#else
#define IS_URL_CHAR(c) (BIT_AT(normal_url_char, (unsigned char)c) || ((c)&0x80))
#define IS_HOST_CHAR(c) (isalnum(c) || (c) == '.' || (c) == '-' || (c) == '_')
#define IS_HOST_CHAR(c) \
(isalnum((unsigned char)c) || (c) == '.' || (c) == '-' || (c) == '_')
#endif
/*
@ -237,14 +239,14 @@ parse_url_char(state_t s, const char ch) {
return (s_req_path);
}
if (isalpha(ch)) {
if (isalpha((unsigned char)ch)) {
return (s_req_schema);
}
break;
case s_req_schema:
if (isalpha(ch)) {
if (isalpha((unsigned char)ch)) {
return (s);
}
@ -410,7 +412,7 @@ http_parse_host_char(host_state_t s, const char ch) {
/* FALLTHROUGH */
case s_http_host_v6_start:
if (isxdigit(ch) || ch == ':' || ch == '.') {
if (isxdigit((unsigned char)ch) || ch == ':' || ch == '.') {
return (s_http_host_v6);
}
@ -427,8 +429,8 @@ http_parse_host_char(host_state_t s, const char ch) {
/* FALLTHROUGH */
case s_http_host_v6_zone_start:
/* RFC 6874 Zone ID consists of 1*( unreserved / pct-encoded) */
if (isalnum(ch) || ch == '%' || ch == '.' || ch == '-' ||
ch == '_' || ch == '~')
if (isalnum((unsigned char)ch) || ch == '%' || ch == '.' ||
ch == '-' || ch == '_' || ch == '~')
{
return (s_http_host_v6_zone);
}
@ -436,7 +438,7 @@ http_parse_host_char(host_state_t s, const char ch) {
case s_http_host_port:
case s_http_host_port_start:
if (isdigit(ch)) {
if (isdigit((unsigned char)ch)) {
return (s_http_host_port);
}