]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
dbus: Clean up P2P group vendor ext getter
authorJouni Malinen <j@w1.fi>
Thu, 12 Jun 2014 21:48:21 +0000 (00:48 +0300)
committerJouni Malinen <j@w1.fi>
Thu, 12 Jun 2014 21:48:21 +0000 (00:48 +0300)
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>
wpa_supplicant/dbus/dbus_new_handlers_p2p.c

index af319e6f526e857eb276756bba761532df90d588..857b5275792851703054ab04663555a68b17e560 100644 (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);
 }