D-Bus: Fix string array dict entry parser in out-of-memory case
authorJouni Malinen <j@w1.fi>
Tue, 6 Jan 2015 15:04:24 +0000 (17:04 +0200)
committerJouni Malinen <j@w1.fi>
Wed, 7 Jan 2015 11:19:00 +0000 (13:19 +0200)
commitf2d57282ad45ce78d21d5e3718affb3b12f28776
tree01272aac3090545cf1fd2a64f7f6dfb90d477f3e
parentc61bc23aa28091e47166622ffd35b4178e99a823
D-Bus: Fix string array dict entry parser in out-of-memory case

entry->strarray_value was left to point to freed memory in case
os_realloc_array() failed. This resulted in the following
wpa_dbus_dict_entry_clear() trying to free an already freed memory area.
In addition, the separately allocated strings in the array would have
been leaked in such a case. Furthermore, wpa_dbus_dict_entry_clear() was
not prepared for the possibility of the initial os_calloc() call failing
and entry->strarray_value being NULL without array_len being cleared to
zero. That would have resulted in reading uninitialized memory and NULL
pointer dereference.

Signed-off-by: Jouni Malinen <j@w1.fi>
wpa_supplicant/dbus/dbus_dict_helpers.c