mirror of
https://github.com/curl/curl.git
synced 2026-07-24 00:27:16 +03:00
socks: fix query when filter context is null
socks connection filter context may be NULL at the time of a query, accomodate for that. Closes #17885
This commit is contained in:
parent
51369ae78b
commit
74a94e699a
1 changed files with 9 additions and 7 deletions
16
lib/socks.c
16
lib/socks.c
|
|
@ -1193,13 +1193,15 @@ static CURLcode socks_cf_query(struct Curl_cfilter *cf,
|
|||
{
|
||||
struct socks_state *sx = cf->ctx;
|
||||
|
||||
switch(query) {
|
||||
case CF_QUERY_HOST_PORT:
|
||||
*pres1 = sx->remote_port;
|
||||
*((const char **)pres2) = sx->hostname;
|
||||
return CURLE_OK;
|
||||
default:
|
||||
break;
|
||||
if(sx) {
|
||||
switch(query) {
|
||||
case CF_QUERY_HOST_PORT:
|
||||
*pres1 = sx->remote_port;
|
||||
*((const char **)pres2) = sx->hostname;
|
||||
return CURLE_OK;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
return cf->next ?
|
||||
cf->next->cft->query(cf->next, data, query, pres1, pres2) :
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue