aboutsummaryrefslogtreecommitdiff
path: root/lib/http.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2006-10-17 21:32:56 +0000
committerDaniel Stenberg <daniel@haxx.se>2006-10-17 21:32:56 +0000
commit44d84ac1646cf04ccc2c1a736f3c9d1644ccacec (patch)
tree78c8960a291ba0a11548ab34e88a9a7b1bbcee3f /lib/http.c
parent930f9bd5342e6d514f9ba5b1303762c100621965 (diff)
Avoid typecasting a signed char to an int when using is*() functions, as that
could very well cause a negate number get passed in and thus cause reading outside of the array usually used for this purpose. We avoid this by using the uppercase macro versions introduced just now that does some extra crazy typecasts to avoid byte codes > 127 to cause negative int values.
Diffstat (limited to 'lib/http.c')
-rw-r--r--lib/http.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/http.c b/lib/http.c
index 0b3111f47..e31730e7d 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -569,7 +569,7 @@ CURLcode Curl_http_input_auth(struct connectdata *conn,
}
/* pass all white spaces */
- while(*start && isspace((int)*start))
+ while(*start && ISSPACE(*start))
start++;
/*
@@ -1051,7 +1051,7 @@ Curl_compareheader(char *headerline, /* line to check */
start = &headerline[hlen];
/* pass all white spaces */
- while(*start && isspace((int)*start))
+ while(*start && ISSPACE(*start))
start++;
/* find the end of the header line */
@@ -1558,7 +1558,7 @@ static CURLcode add_custom_headers(struct connectdata *conn,
/* we require a colon for this to be a true header */
ptr++; /* pass the colon */
- while(*ptr && isspace((int)*ptr))
+ while(*ptr && ISSPACE(*ptr))
ptr++;
if(*ptr) {
@@ -1725,12 +1725,12 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
redirected request is being out on thin ice. Except if the host name
is the same as the first one! */
char *start = ptr+strlen("Host:");
- while(*start && isspace((int)*start ))
+ while(*start && ISSPACE(*start ))
start++;
ptr = start; /* start host-scanning here */
/* scan through the string to find the end (space or colon) */
- while(*ptr && !isspace((int)*ptr) && !(':'==*ptr))
+ while(*ptr && !ISSPACE(*ptr) && !(':'==*ptr))
ptr++;
if(ptr != start) {