dbus: Fix Scan invalid args reporting (uninitialize variable)
authorJouni Malinen <j@w1.fi>
Sat, 26 Dec 2009 12:37:04 +0000 (14:37 +0200)
committerJouni Malinen <j@w1.fi>
Sat, 26 Dec 2009 12:37:04 +0000 (14:37 +0200)
Must initialize key to be NULL since it can be used in an error
message. If the Scan method did not actually include any dict entries,
the uninitialized pointer was used and this could result in
wpa_supplicant crashing.

wpa_supplicant/dbus/dbus_new_handlers.c

index 8ed95cb..6158962 100644 (file)
@@ -905,7 +905,7 @@ DBusMessage * wpas_dbus_handler_scan(DBusMessage *message,
        DBusMessage * reply = NULL;
        DBusMessageIter iter, dict_iter, entry_iter, variant_iter,
                array_iter, sub_array_iter;
-       char *key, *val, *type = NULL;
+       char *key = NULL, *val, *type = NULL;
        int len;
        int freqs_num = 0;
        int ssids_num = 0;