From: Jouni Malinen Date: Thu, 12 Jun 2014 17:02:00 +0000 (+0300) Subject: dbus: Initialize temporary entry properly (CID 62877) X-Git-Tag: hostap_2_3~322 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6446420b24996adf584184d41e8df2e717aef1ba;p=thirdparty%2Fhostap.git dbus: Initialize temporary entry properly (CID 62877) The tmpentry variable was not initialized and _wpa_dbus_dict_entry_get_byte_array() does not set tmpentry.type, so it would have been possible for the error path to end up trying to free unexpected type of an entry or not free the memory at all. Signed-off-by: Jouni Malinen --- diff --git a/wpa_supplicant/dbus/dbus_dict_helpers.c b/wpa_supplicant/dbus/dbus_dict_helpers.c index 61a94304b..80a1178e2 100644 --- a/wpa_supplicant/dbus/dbus_dict_helpers.c +++ b/wpa_supplicant/dbus/dbus_dict_helpers.c @@ -881,6 +881,8 @@ static dbus_bool_t _wpa_dbus_dict_entry_get_binarray( } dbus_message_iter_recurse(iter, &iter_array); + os_memset(&tmpentry, 0, sizeof(tmpentry)); + tmpentry.type = DBUS_TYPE_ARRAY; if (_wpa_dbus_dict_entry_get_byte_array(&iter_array, &tmpentry) == FALSE) goto cleanup;