The httpcode < 100 check was also triggered when none of the fields were
parsed, thus making the if(!nc) block unreachable.
Closes #8171
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;
}