diff --git a/hostapd/hostapd_cli.c b/hostapd/hostapd_cli.c index 1c4a84c65..09b7284e5 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); diff --git a/hostapd/main.c b/hostapd/main.c index a9d7da511..a9d91b940 100644 --- a/hostapd/main.c +++ b/hostapd/main.c @@ -97,14 +97,15 @@ static void hostapd_logger_cb(void *ctx, const u8 *addr, unsigned int module, else if (hapd && hapd->conf) os_snprintf(format, maxlen, "%s:%s%s %s", hapd->conf->iface, module_str ? " " : "", - module_str, txt); + module_str ? module_str : "", txt); else if (addr) os_snprintf(format, maxlen, "STA " MACSTR "%s%s: %s", MAC2STR(addr), module_str ? " " : "", - module_str, txt); + module_str ? module_str : "", txt); else os_snprintf(format, maxlen, "%s%s%s", - module_str, module_str ? ": " : "", txt); + module_str ? module_str : "", + module_str ? ": " : "", txt); if ((conf_stdout & module) && level >= conf_stdout_level) { wpa_debug_print_timestamp();