1
commit 8ee69e06336d65b15364f4db82d91775d0fe47c6
2
Author: Paul Stewart <pstew@google.com>
3
Date: Sat Oct 9 17:29:51 2010 +0300
5
dbus_new_handlers: Don't send NULL to dbus_message_new_error
7
The new DBus API helper function wpas_dbus_error_unknown_error
8
function can be called as a result of a failure within internal
9
getter calls, which will call this function with a NULL message
10
parameter. However, dbus_message_new_error looks very unkindly
11
(i.e, abort()) on a NULL message, so in this case, we should not
14
I've observed this course of events during a call to
15
wpas_dbus_getter_bss_wpa with a faileld parse of the IE parameter.
16
We got here through a call to fill_dict_with_properties which
17
explicitly calls getters with a NULL message parameter. Judging
18
from the way it is called, this could easily occur if an AP sends
19
out a malformed (or mis-received) probe response. I usually run
20
into this problem while driving through San Francisco, so I'm
21
exposed to any number of base stations along this path.
23
diff --git a/wpa_supplicant/dbus/dbus_new_handlers.c b/wpa_supplicant/dbus/dbus_new_handlers.c
24
index 73f4e44..0ad51a0 100644
25
--- a/wpa_supplicant/dbus/dbus_new_handlers.c
26
+++ b/wpa_supplicant/dbus/dbus_new_handlers.c
27
@@ -117,6 +117,20 @@ static char * wpas_dbus_new_decompose_object_path(const char *path,
28
DBusMessage * wpas_dbus_error_unknown_error(DBusMessage *message,
32
+ * This function can be called as a result of a failure
33
+ * within internal getter calls, which will call this function
34
+ * with a NULL message parameter. However, dbus_message_new_error
35
+ * looks very unkindly (i.e, abort()) on a NULL message, so
36
+ * in this case, we should not call it.
38
+ if (message == NULL) {
39
+ wpa_printf(MSG_INFO, "dbus: wpas_dbus_error_unknown_error "
40
+ "called with NULL message (arg=%s)",
45
return dbus_message_new_error(message, WPAS_DBUS_ERROR_UNKNOWN_ERROR,