wpa_cli: Support running action script on global control interface
In case wpa_cli is started with an option to execute an action script, but no interface is specified, wpa_cli might crash in wpa_cli_exec() if arg1 == NULL. Fix this be setting arg1 = "global". Signed-off-by: Ilan Peer <ilan.peer@intel.com>
This commit is contained in:
parent
b8f02d8baf
commit
3c58df7ae7
1 changed files with 4 additions and 0 deletions
|
@ -3659,6 +3659,10 @@ static int wpa_cli_exec(const char *program, const char *arg1,
|
||||||
size_t len;
|
size_t len;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
|
/* If no interface is specified, set the global */
|
||||||
|
if (!arg1)
|
||||||
|
arg1 = "global";
|
||||||
|
|
||||||
len = os_strlen(arg1) + os_strlen(arg2) + 2;
|
len = os_strlen(arg1) + os_strlen(arg2) + 2;
|
||||||
arg = os_malloc(len);
|
arg = os_malloc(len);
|
||||||
if (arg == NULL)
|
if (arg == NULL)
|
||||||
|
|
Loading…
Reference in a new issue