tftp: mark protocol as not possible to do over CONNECT

... and make connect_init() refusing trying to tunnel protocols marked
as not working. Avoids a double-free.

Reported-by: Even Rouault
Fixes #8018
Closes #8020
This commit is contained in:
Daniel Stenberg 2021-11-15 16:51:32 +01:00
parent 2511a41bf9
commit 4d97fe5473
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 14 additions and 7 deletions

View file

@ -158,6 +158,10 @@ static CURLcode connect_init(struct Curl_easy *data, bool reinit)
{
struct http_connect_state *s;
struct connectdata *conn = data->conn;
if(conn->handler->flags & PROTOPT_NOTCPPROXY) {
failf(data, "%s cannot be done over CONNECT", conn->handler->scheme);
return CURLE_UNSUPPORTED_PROTOCOL;
}
if(!reinit) {
CURLcode result;
DEBUGASSERT(!conn->connect_state);