From 1851e17a64eb5efb0b4bc36ffe2aaa5fe7e0abb0 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 13 Jun 2014 00:48:21 +0300 Subject: [PATCH] dbus: Clean up P2P group vendor ext getter The vendor_ext[i] = NULL setting did not make any sense since num_vendor_ext should have been used to index the vendor_ext array. The old code did not do any harm since i >= num_vendor_ext and none of the already set entries could have been cleared. Anyway, better clean this by making it skip the setting to NULL similarly to what was already done in the P2P peer vendor ext getter. Signed-off-by: Jouni Malinen --- wpa_supplicant/dbus/dbus_new_handlers_p2p.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c index af319e6f5..857b52757 100644 --- a/wpa_supplicant/dbus/dbus_new_handlers_p2p.c +++ b/wpa_supplicant/dbus/dbus_new_handlers_p2p.c @@ -2027,11 +2027,9 @@ dbus_bool_t wpas_dbus_getter_p2p_group_vendor_ext(DBusMessageIter *iter, /* Parse WPS Vendor Extensions sent in Beacon/Probe Response */ for (i = 0; i < MAX_WPS_VENDOR_EXTENSIONS; i++) { if (hapd->conf->wps_vendor_ext[i] == NULL) - vendor_ext[i] = NULL; - else { - vendor_ext[num_vendor_ext++] = - hapd->conf->wps_vendor_ext[i]; - } + continue; + vendor_ext[num_vendor_ext++] = + hapd->conf->wps_vendor_ext[i]; } } @@ -2040,7 +2038,7 @@ dbus_bool_t wpas_dbus_getter_p2p_group_vendor_ext(DBusMessageIter *iter, DBUS_TYPE_BYTE, vendor_ext, num_vendor_ext, - error); + error); }