aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/wifi_display.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2014-02-06 14:03:42 (GMT)
committerJouni Malinen <j@w1.fi>2014-02-06 14:03:42 (GMT)
commitbab6677a3105f15b19b6be4a189e7baf61b4f791 (patch)
treea259570c92c7f8b62aad4a91eae7c8949c9253ff /wpa_supplicant/wifi_display.c
parent334ec001bbd31c5bc83d6593e58dfbbf6b8785a2 (diff)
downloadhostap-bab6677a3105f15b19b6be4a189e7baf61b4f791.zip
hostap-bab6677a3105f15b19b6be4a189e7baf61b4f791.tar.gz
hostap-bab6677a3105f15b19b6be4a189e7baf61b4f791.tar.bz2
Handle Wi-Fi Display commands more carefully if P2P is disabled
If P2P was disabled (e.g., due to driver not supporting it or through p2p_disabled=1 configuration), setting Wi-Fi Display parameters could result in segmentation fault when the WFD IE is updated without the P2P module being initialized. Fix this by skipping the update if P2P module is not in use. In addition, show Wi-Fi Display as disabled in "GET wifi_display" and refuse to enable it with "SET wifi_display 1" if P2P is not enabled. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wpa_supplicant/wifi_display.c')
-rw-r--r--wpa_supplicant/wifi_display.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/wpa_supplicant/wifi_display.c b/wpa_supplicant/wifi_display.c
index 578199e..8435b63 100644
--- a/wpa_supplicant/wifi_display.c
+++ b/wpa_supplicant/wifi_display.c
@@ -41,6 +41,9 @@ static int wifi_display_update_wfd_ie(struct wpa_global *global)
struct wpabuf *ie, *buf;
size_t len, plen;
+ if (global->p2p == NULL)
+ return 0;
+
wpa_printf(MSG_DEBUG, "WFD: Update WFD IE");
if (!global->wifi_display) {