summaryrefslogtreecommitdiff
path: root/bus
diff options
context:
space:
mode:
authorRalf Habacker <ralf.habacker@freenet.de>2021-12-09 09:51:09 +0100
committerRalf Habacker <ralf.habacker@freenet.de>2021-12-09 12:54:22 +0100
commit3a2e0ba5fec9a162ff5968975ab4b5499ac13bd8 (patch)
tree4b5a726eeb50558d968b0e2db883fea0645167cd /bus
parent5b804ed77d336770354939e24b5b09ed95d1b4ba (diff)
downloaddbus-3a2e0ba5fec9a162ff5968975ab4b5499ac13bd8.tar.gz
Avoid assertation in bus_activation_reload()
In the mentioned function a local DBusError instance is now used to fulfill the requirement of dbus_error_has_name() that the parameter 'error' must not be null. See #360
Diffstat (limited to 'bus')
-rw-r--r--bus/activation.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/bus/activation.c b/bus/activation.c
index 19ac869a..48a44a30 100644
--- a/bus/activation.c
+++ b/bus/activation.c
@@ -898,6 +898,7 @@ bus_activation_reload (BusActivation *activation,
{
DBusList *link;
char *dir;
+ DBusError local_error = DBUS_ERROR_INIT;
if (activation->server_address != NULL)
dbus_free (activation->server_address);
@@ -965,13 +966,18 @@ bus_activation_reload (BusActivation *activation,
}
/* only fail on OOM, it is ok if we can't read the directory */
- if (!update_directory (activation, s_dir, error))
- {
- if (dbus_error_has_name (error, DBUS_ERROR_NO_MEMORY))
- goto failed;
- else
- dbus_error_free (error);
- }
+ if (!update_directory (activation, s_dir, &local_error))
+ {
+ if (dbus_error_has_name (&local_error, DBUS_ERROR_NO_MEMORY))
+ {
+ dbus_move_error (&local_error, error);
+ goto failed;
+ }
+ else
+ {
+ dbus_error_free (&local_error);
+ }
+ }
link = _dbus_list_get_next_link (directories, link);
}