[PATCH] dbus: Don't pass NULL message ptr to dbus_message_new_error()

Jouni Malinen j
Fri Jul 29 11:35:38 PDT 2011


On Mon, Jul 25, 2011 at 04:48:02PM -0700, Angie Chinchilla wrote:
> Found at least 10 code paths that mistakenly assume
> message is not NULL before invoking
> dbus_message_new_error(message, DBUS_ERROR_NO_MEMORY, NULL).
> Created a wrapper method wpas_dbus_error_no_memory() that
> checks for this case and returns NULL if needed so we don't
> have if (!message) return NULL else return dbus_message_new_error()
> blocks scattered all over the code. Also added a couple of log
> messages to the path that hits this error so the (now gracefully
> handled) errors don't fail silently.

Thanks. Based on the subsequent discussion on the list, I dropped this
patch and instead, used the larger cleanup/fix patch from Dan.

-- 
Jouni Malinen                                            PGP id EFC895FA



More information about the Hostap mailing list