From: Jouni Malinen Date: Thu, 18 Feb 2016 09:59:58 +0000 (+0200) Subject: nl80211: Avoid wpa_printf %s call with NULL pointer in set_param() X-Git-Tag: hostap_2_6~889 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99a94f55884e3069009981cd03c0c5c635b7a09f;p=thirdparty%2Fhostap.git 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 --- 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")) {