mirror of
https://github.com/curl/curl.git
synced 2026-08-25 12:03:39 +03:00
setopt: allow CURLOPT_INTERFACE to be set to NULL
Ref: https://github.com/curl/curl/discussions/14299#discussioncomment-10393909
Regression from 3060557af7 (shipped in 8.9.0)
Closes #14629
This commit is contained in:
parent
3065f106e3
commit
b0b4b481b5
4 changed files with 19 additions and 21 deletions
22
lib/setopt.c
22
lib/setopt.c
|
|
@ -139,30 +139,24 @@ static CURLcode setstropt_userpwd(char *option, char **userp, char **passwdp)
|
|||
return CURLE_OK;
|
||||
}
|
||||
|
||||
static CURLcode setstropt_interface(
|
||||
char *option, char **devp, char **ifacep, char **hostp)
|
||||
static CURLcode setstropt_interface(char *option, char **devp,
|
||||
char **ifacep, char **hostp)
|
||||
{
|
||||
char *dev = NULL;
|
||||
char *iface = NULL;
|
||||
char *host = NULL;
|
||||
size_t len;
|
||||
CURLcode result;
|
||||
|
||||
DEBUGASSERT(devp);
|
||||
DEBUGASSERT(ifacep);
|
||||
DEBUGASSERT(hostp);
|
||||
|
||||
/* Parse the interface details */
|
||||
if(!option || !*option)
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
len = strlen(option);
|
||||
if(len > 255)
|
||||
return CURLE_BAD_FUNCTION_ARGUMENT;
|
||||
|
||||
result = Curl_parse_interface(option, len, &dev, &iface, &host);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
if(option) {
|
||||
/* Parse the interface details if set, otherwise clear them all */
|
||||
result = Curl_parse_interface(option, &dev, &iface, &host);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
free(*devp);
|
||||
*devp = dev;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue