summaryrefslogtreecommitdiffstats
path: root/bus
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@codefactory.se>2003-03-17 06:49:33 +0000
committerAnders Carlsson <andersca@codefactory.se>2003-03-17 06:49:33 +0000
commit73d7ba1d1339ede5f638e2962e187555aa8c7aa3 (patch)
treed17f00cbaac458240e579f8609f142d22c045e50 /bus
parentf7c24715b5489b28b47499eb252b941b735fa1bc (diff)
2003-03-17 Anders Carlsson <andersca@codefactory.se>
* bus/dispatch.c: (bus_dispatch): Refetch the service name since it may have been reallocated when dbus_message_set_sender was called. * dbus/dbus-sysdeps.c: (_dbus_accept): Add address and address length variables and use them to stop valgrind from complaining.
Diffstat (limited to 'bus')
-rw-r--r--bus/dispatch.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/bus/dispatch.c b/bus/dispatch.c
index 5365a11d..33289e1f 100644
--- a/bus/dispatch.c
+++ b/bus/dispatch.c
@@ -208,18 +208,25 @@ bus_dispatch (DBusConnection *connection,
{
sender = bus_connection_get_name (connection);
_dbus_assert (sender != NULL);
-
+
if (!dbus_message_set_sender (message, sender))
{
BUS_SET_OOM (&error);
goto out;
}
+
+ /* We need to refetch the service name here, because
+ * dbus_message_set_sender can cause the header to be
+ * reallocated, and thus the service_name pointer will become
+ * invalid.
+ */
+ service_name = dbus_message_get_service (message);
}
if (strcmp (service_name, DBUS_SERVICE_DBUS) == 0) /* to bus driver */
{
if (!bus_driver_handle_message (connection, transaction, message, &error))
- goto out;
+ goto out;
}
else if (!bus_connection_is_active (connection)) /* clients must talk to bus driver first */
{