aboutsummaryrefslogtreecommitdiffstats
path: root/hostapd/hostapd_cli.c
diff options
context:
space:
mode:
authorSrinivas Girigowda <sgirigow@qca.qualcomm.com>2014-08-28 15:25:32 (GMT)
committerJouni Malinen <j@w1.fi>2014-08-28 15:25:32 (GMT)
commitdb9418bb1b8054b54d9b299e0334850d5e2b77ad (patch)
tree4188744735f54436cccd36e1914ea3117236614e /hostapd/hostapd_cli.c
parentd6df0d7e621904d46e197725aea83d129fa397ac (diff)
downloadhostap-db9418bb1b8054b54d9b299e0334850d5e2b77ad.zip
hostap-db9418bb1b8054b54d9b299e0334850d5e2b77ad.tar.gz
hostap-db9418bb1b8054b54d9b299e0334850d5e2b77ad.tar.bz2
Add printf NULL checks to silence static analyzer
Add NULL checks to take care of issues reported by static analyzer tool on potentially using NULL with printf format %s (which has undefined behavior even though many compilers end up printing "(null)"). Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'hostapd/hostapd_cli.c')
-rw-r--r--hostapd/hostapd_cli.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c
index 1c4a84c..09b7284 100644
--- a/hostapd/hostapd_cli.c
+++ b/hostapd/hostapd_cli.c
@@ -844,6 +844,8 @@ static int hostapd_cli_cmd_interface(struct wpa_ctrl *ctrl, int argc,
hostapd_cli_close_connection();
os_free(ctrl_ifname);
ctrl_ifname = os_strdup(argv[0]);
+ if (ctrl_ifname == NULL)
+ return -1;
if (hostapd_cli_open_connection(ctrl_ifname)) {
printf("Connected to interface '%s.\n", ctrl_ifname);