]> git.ipfire.org Git - thirdparty/hostap.git/commit
D-Bus: Fix memory leak when using array of array of bytes
authorReinette Chatre <reinette.chatre@intel.com>
Fri, 26 Aug 2011 23:55:29 +0000 (16:55 -0700)
committerJouni Malinen <j@w1.fi>
Wed, 21 Sep 2011 22:01:20 +0000 (01:01 +0300)
commitaf9d709019761b501e7f5848ef06e10d1248970e
tree6b7cca9ae055468b8cff24da8c777be2fc18e326
parent3a26a2c9dfef45896603abb529a38f0e88c361fa
D-Bus: Fix memory leak when using array of array of bytes

When parsing a dict entry which is an array of an array of bytes the entry
representing the dict entry has DBUS_TYPE_ARRAY as its type and
WPAS_DBUS_TYPE_ARRAY as its array_type. The function freeing this parsed
data incorrectly tested the entry type for WPAS_DBUS_TYPE_ARRAY while doing
no testing of this value for array_type. This results in a memory leak
whenever a D-Bus message with this type of data is parsed.

Messages affected are:
fi.w1.wpa_supplicant1.Interface.P2PDevice
using RequestedDeviceTypes with Find method
using SecondaryDeviceTypes or VendorExtension with P2PDeviceProperties

fi.w1.wpa_supplicant1.Group
using WPSVendorExtensions with Properties property

All of the above messages are parsed with the same function,
wpa_dbus_dict_get_entry, so the assignment of the entry's type and
array_type is consistent. The parsed data is also consistently freed with
the same function, wpa_dbus_dict_entry_clear, so we can use the same checks
to free the data correctly.

Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Angie Chinchilla <angie.v.chinchilla@intel.com>
wpa_supplicant/dbus/dbus_dict_helpers.c