]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
http: Fix CURLOPT_HTTP200ALIASES
authorVladimir Panteleev <git@cy.md>
Mon, 20 Dec 2021 16:49:59 +0000 (16:49 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Tue, 21 Dec 2021 07:44:55 +0000 (08:44 +0100)
The httpcode < 100 check was also triggered when none of the fields were
parsed, thus making the if(!nc) block unreachable.

Closes #8171

lib/http.c

index 1bef121a9c2ded1b44e15092d93a905fc50753b6..caa14bbd9d8f9cb5ecbbbaa9ccdb0dfa2e521909 100644 (file)
@@ -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;
         }