aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-09-04 19:01:29 (GMT)
committerJouni Malinen <j@w1.fi>2010-09-05 14:36:16 (GMT)
commit6b6988607d9739e989731bd4354d6be44ef36d35 (patch)
treec337686b4ffc579d438cabb3bf6b16dec3d9bef3
parent51f5df11e02fb8b2d971770df7466b438095abaf (diff)
downloadhostap-07-6b6988607d9739e989731bd4354d6be44ef36d35.zip
hostap-07-6b6988607d9739e989731bd4354d6be44ef36d35.tar.gz
hostap-07-6b6988607d9739e989731bd4354d6be44ef36d35.tar.bz2
dbus: Verify WPA/RSN IE parser result before returning data
(cherry picked from commit af3e1b0ec2f450024e8db2b710b1348b70312916)
-rw-r--r--wpa_supplicant/dbus/dbus_new_handlers.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
index 602ad34..e2b5e50 100644
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
@@ -2726,8 +2726,11 @@ DBusMessage * wpas_dbus_getter_bss_wpa(DBusMessage *message,
os_memset(&wpa_data, 0, sizeof(wpa_data));
ie = wpa_bss_get_vendor_ie(res, WPA_IE_VENDOR_TYPE);
- if (ie)
- wpa_parse_wpa_ie(ie, 2 + ie[1], &wpa_data);
+ if (ie) {
+ if (wpa_parse_wpa_ie(ie, 2 + ie[1], &wpa_data) < 0)
+ return wpas_dbus_error_unknown_error(message,
+ "invalid WPA IE");
+ }
return wpas_dbus_get_bss_security_prop(message, &wpa_data);
}
@@ -2756,8 +2759,11 @@ DBusMessage * wpas_dbus_getter_bss_rsn(DBusMessage *message,
os_memset(&wpa_data, 0, sizeof(wpa_data));
ie = wpa_bss_get_ie(res, WLAN_EID_RSN);
- if (ie)
- wpa_parse_wpa_ie(ie, 2 + ie[1], &wpa_data);
+ if (ie) {
+ if (wpa_parse_wpa_ie(ie, 2 + ie[1], &wpa_data) < 0)
+ return wpas_dbus_error_unknown_error(message,
+ "invalid RSN IE");
+ }
return wpas_dbus_get_bss_security_prop(message, &wpa_data);
}