misc: ISSPACE() => ISBLANK()

Instances of ISSPACE() use that should rather use ISBLANK(). I think
somewhat carelessly used because it sounds as if it checks for space or
whitespace, but also includes %0a to %0d.

For parsing purposes, we should only accept what we must and not be
overly liberal. It leads to surprises and surprises lead to bad things.

Closes #9432
This commit is contained in:
Daniel Stenberg 2022-09-05 23:21:15 +02:00
parent 8dd95da35b
commit 6f9fb7ec2d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
20 changed files with 32 additions and 32 deletions

View file

@ -207,7 +207,7 @@ static CURLcode namevalue(char *header, size_t hlen, unsigned int type,
return CURLE_BAD_FUNCTION_ARGUMENT;
/* skip all leading space letters */
while(*header && ISSPACE(*header))
while(*header && ISBLANK(*header))
header++;
*value = header;
@ -237,7 +237,7 @@ static CURLcode unfold_value(struct Curl_easy *data, const char *value,
vlen--;
/* save only one leading space */
while((vlen > 1) && ISSPACE(value[0]) && ISSPACE(value[1])) {
while((vlen > 1) && ISBLANK(value[0]) && ISBLANK(value[1])) {
vlen--;
value++;
}