From 99a94f55884e3069009981cd03c0c5c635b7a09f Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Thu, 18 Feb 2016 11:59:58 +0200 Subject: [PATCH] nl80211: Avoid wpa_printf %s call with NULL pointer in set_param() While most C libraries print "(null)" when NULL is used as an argument to printf format string %s, this is not really necessary to print here, so move the debug print to be after the NULL check. Signed-off-by: Jouni Malinen --- src/drivers/driver_nl80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/driver_nl80211.c b/src/drivers/driver_nl80211.c index 0f312a0ac..e4c90a9f0 100644 --- a/src/drivers/driver_nl80211.c +++ b/src/drivers/driver_nl80211.c @@ -6691,9 +6691,9 @@ static int nl80211_send_frame(void *priv, const u8 *data, size_t data_len, static int nl80211_set_param(void *priv, const char *param) { - wpa_printf(MSG_DEBUG, "nl80211: driver param='%s'", param); if (param == NULL) return 0; + wpa_printf(MSG_DEBUG, "nl80211: driver param='%s'", param); #ifdef CONFIG_P2P if (os_strstr(param, "use_p2p_group_interface=1")) {