commit - 4107583e32017d94beda9de6f531ca82bb1e7ffe
commit + 52772181b5adf4709a8219ef283210564a184352
blob - cd335b4cabb6330bebc0345986b18abea64a2bf2
blob + c12729b8a3524c30d4d34b190ed4e5c6904af783
--- gg.c
+++ gg.c
if (memmem(buf, len, "\r\n", 2) == NULL)
errx(1, "invalid reply: no \\r\\n");
- if (!isdigit(buf[0]) || !isdigit(buf[1]) || buf[2] != ' ')
+ if (!isdigit((unsigned char)buf[0]) ||
+ !isdigit((unsigned char)buf[1]) ||
+ buf[2] != ' ')
errx(1, "invalid reply: invalid response format");
code = (buf[0] - '0') * 10 + buf[1] - '0';
blob - 8725cdd504e5b6c8289d0e0594933c46c942c612
blob + 7414f0288e681cca468f8b6df769bb7616a38e37
--- iri.c
+++ iri.c
static inline int
unreserved(int p)
{
- return isalnum(p)
+ return isalnum((unsigned char)p)
|| p == '-'
|| p == '.'
|| p == '_'
if (*s != '%')
return 1;
- if (!isxdigit(s[1]) || !isxdigit(s[2]))
+ if (!isxdigit((unsigned char)s[1]) ||
+ !isxdigit((unsigned char)s[2]))
return 0;
if (s[1] == '0' && s[2] == '0')
{
p->parsed->schema = p->iri;
- if (!isalpha(*p->iri)) {
+ if (!isalpha((unsigned char)*p->iri)) {
p->err = "illegal character in scheme";
return 0;
}
*/
*p->iri = tolower(*p->iri);
p->iri++;
- } while (isalnum(*p->iri)
+ } while (isalnum((unsigned char)*p->iri)
|| *p->iri == '+'
|| *p->iri == '-'
|| *p->iri == '.');
p->parsed->port = p->iri;
- for (; isdigit(*p->iri); p->iri++) {
+ for (; isdigit((unsigned char)*p->iri); p->iri++) {
i = i * 10 + *p->iri - '0';
if (i > UINT16_MAX) {
p->err = "port number too large";
blob - 532517baddf989a7767481f967c199079d78d406
blob + 5c6a91426cb1bf2580eea77a599e979308c34635
--- proxy.c
+++ proxy.c
}
if (len < 3 || len > 1029 ||
- !isdigit(hdr[0]) ||
- !isdigit(hdr[1]) ||
- !isspace(hdr[2])) {
+ !isdigit((unsigned char)hdr[0]) ||
+ !isdigit((unsigned char)hdr[1]) ||
+ !isspace((unsigned char)hdr[2])) {
free(hdr);
log_warn(c, "upstream server is trying to send a "
"header that's too long.");
blob - 2258e67a25485efa2c76dee0fd7d91da4546d78c
blob + d29658cabede295997a6e41bc00f055a280ffbba
--- server.c
+++ server.c
}
if (len < 3 || len > 1029 ||
- !isdigit(header[0]) ||
- !isdigit(header[1]) ||
- !isspace(header[2])) {
+ !isdigit((unsigned char)header[0]) ||
+ !isdigit((unsigned char)header[1]) ||
+ !isspace((unsigned char)header[2])) {
free(header);
log_warn(client, "CGI script is trying to send a "
"malformed header");