summaryrefslogtreecommitdiff
path: root/src/shared/bus-unit-util.c
diff options
context:
space:
mode:
authorChristian Hesse <mail@eworm.de>2016-05-26 15:57:37 +0200
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-06-09 02:19:43 -0400
commite75cd4c1e74bf004a1bea586bae72fb11ed35d9f (patch)
tree978c3974dcc60fab482dad976c5e50995d09367e /src/shared/bus-unit-util.c
parent2d900c86dac10aeaedee7d734491ec23bd90ca16 (diff)
{machine,system}ctl: always pass &changes and &n_changes (#3350)
We have to pass addresses of changes and n_changes to bus_deserialize_and_dump_unit_file_changes(). Otherwise we are hit by missing information (subsequent calls to unit_file_changes_add() to not add anything). Also prevent null pointer dereference in bus_deserialize_and_dump_unit_file_changes() by asserting. Fixes #3339
Diffstat (limited to 'src/shared/bus-unit-util.c')
-rw-r--r--src/shared/bus-unit-util.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c
index f6559cd854..f68c4a41ac 100644
--- a/src/shared/bus-unit-util.c
+++ b/src/shared/bus-unit-util.c
@@ -865,6 +865,11 @@ int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, Un
const char *type, *path, *source;
int r;
+ /* changes is dereferenced when calling unit_file_dump_changes() later,
+ * so we have to make sure this is not NULL. */
+ assert(changes);
+ assert(n_changes);
+
r = sd_bus_message_enter_container(m, SD_BUS_TYPE_ARRAY, "(sss)");
if (r < 0)
return bus_log_parse_error(r);