aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wpa_cli.c
diff options
context:
space:
mode:
authorIlan Peer <ilan.peer@intel.com>2016-02-29 12:29:58 (GMT)
committerJouni Malinen <j@w1.fi>2016-03-03 14:30:28 (GMT)
commit3c58df7ae7b7467e30f2aa47d2bbecc2d52abb21 (patch)
tree4ddd857dffaff12b7e021c76a67591959cd9ff9c /wpa_supplicant/wpa_cli.c
parentb8f02d8baf4ccbe3a66cfa20bbe6f1c4c7cdf8b2 (diff)
downloadhostap-3c58df7ae7b7467e30f2aa47d2bbecc2d52abb21.zip
hostap-3c58df7ae7b7467e30f2aa47d2bbecc2d52abb21.tar.gz
hostap-3c58df7ae7b7467e30f2aa47d2bbecc2d52abb21.tar.bz2
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>
Diffstat (limited to 'wpa_supplicant/wpa_cli.c')
-rw-r--r--wpa_supplicant/wpa_cli.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c
index f8bf6bd..eecb1dc 100644
--- a/wpa_supplicant/wpa_cli.c
+++ b/wpa_supplicant/wpa_cli.c
@@ -3659,6 +3659,10 @@ static int wpa_cli_exec(const char *program, const char *arg1,
size_t len;
int res;
+ /* If no interface is specified, set the global */
+ if (!arg1)
+ arg1 = "global";
+
len = os_strlen(arg1) + os_strlen(arg2) + 2;
arg = os_malloc(len);
if (arg == NULL)