summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVladimir Panteleev <git@cy.md>2021-12-20 16:49:59 +0000
committerDaniel Stenberg <daniel@haxx.se>2021-12-21 08:44:55 +0100
commit1b9f1f60559979a644cc9cf26f851c4416f20248 (patch)
tree34a16b0755f14527289d4bb7a8f8496df9ce5ab4 /lib
parentef4dc1b5be8c092550617ea0f1b9844a9cdc6ae8 (diff)
downloadcurl-1b9f1f60559979a644cc9cf26f851c4416f20248.tar.gz
http: Fix CURLOPT_HTTP200ALIASES
The httpcode < 100 check was also triggered when none of the fields were parsed, thus making the if(!nc) block unreachable. Closes #8171
Diffstat (limited to 'lib')
-rw-r--r--lib/http.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/http.c b/lib/http.c
index 1bef121a9..caa14bbd9 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -4244,7 +4244,7 @@ CURLcode Curl_http_readwrite_headers(struct Curl_easy *data,
The sscanf() line above will also allow zero-prefixed and negative
numbers, so we check for that too here.
*/
- else if(ISDIGIT(digit4) || (k->httpcode < 100)) {
+ else if(ISDIGIT(digit4) || (nc >= 4 && k->httpcode < 100)) {
failf(data, "Unsupported response code in HTTP response");
return CURLE_UNSUPPORTED_PROTOCOL;
}