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 <j@w1.fi>
This commit is contained in:
Jouni Malinen 2014-06-13 00:48:21 +03:00
parent 137ff332fd
commit 1851e17a64

View file

@ -2027,13 +2027,11 @@ dbus_bool_t wpas_dbus_getter_p2p_group_vendor_ext(DBusMessageIter *iter,
/* Parse WPS Vendor Extensions sent in Beacon/Probe Response */ /* Parse WPS Vendor Extensions sent in Beacon/Probe Response */
for (i = 0; i < MAX_WPS_VENDOR_EXTENSIONS; i++) { for (i = 0; i < MAX_WPS_VENDOR_EXTENSIONS; i++) {
if (hapd->conf->wps_vendor_ext[i] == NULL) if (hapd->conf->wps_vendor_ext[i] == NULL)
vendor_ext[i] = NULL; continue;
else {
vendor_ext[num_vendor_ext++] = vendor_ext[num_vendor_ext++] =
hapd->conf->wps_vendor_ext[i]; hapd->conf->wps_vendor_ext[i];
} }
} }
}
/* Return vendor extensions or no data */ /* Return vendor extensions or no data */
return wpas_dbus_simple_array_array_property_getter(iter, return wpas_dbus_simple_array_array_property_getter(iter,