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,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);
}