]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
nl80211: Avoid wpa_printf %s call with NULL pointer in set_param()
authorJouni Malinen <jouni@qca.qualcomm.com>
Thu, 18 Feb 2016 09:59:58 +0000 (11:59 +0200)
committerJouni Malinen <j@w1.fi>
Thu, 18 Feb 2016 09:59:58 +0000 (11:59 +0200)
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 <jouni@qca.qualcomm.com>
src/drivers/driver_nl80211.c

index 0f312a0ac27e1b7b6e2d3152641a20f1964da2d3..e4c90a9f0f3761e7ab3278b41af9b2a27359adb0 100644 (file)
@@ -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")) {