summaryrefslogtreecommitdiff
path: root/src/libelogind/sd-bus/bus-message.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2018-07-27 15:39:46 +0200
committerSven Eden <sven.eden@prydeworx.com>2018-10-29 10:18:24 +0100
commitff04443a773f4339f3be98e05e3f0ecc0c45d2ce (patch)
tree166202f844a3b07dcf74c28dae2bce93783ed5ec /src/libelogind/sd-bus/bus-message.c
parent3e97e583ba49c666e12c5d772b361bde8cfa464a (diff)
sd-bus: verify destination and sender values when setting
We would verify destination e.g. in sd_bus_message_new_call, but allow setting any value later on with sd_bus_message_set_destination. I assume this check was omitted not on purpose. (cherry picked from commit 3d51a011f11523694f03c74cdd011c89beba05cc)
Diffstat (limited to 'src/libelogind/sd-bus/bus-message.c')
-rw-r--r--src/libelogind/sd-bus/bus-message.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libelogind/sd-bus/bus-message.c b/src/libelogind/sd-bus/bus-message.c
index 4fb06c2a1..906f19c76 100644
--- a/src/libelogind/sd-bus/bus-message.c
+++ b/src/libelogind/sd-bus/bus-message.c
@@ -5433,6 +5433,7 @@ int bus_message_parse_fields(sd_bus_message *m) {
_public_ int sd_bus_message_set_destination(sd_bus_message *m, const char *destination) {
assert_return(m, -EINVAL);
assert_return(destination, -EINVAL);
+ assert_return(service_name_is_valid(destination), -EINVAL);
assert_return(!m->sealed, -EPERM);
assert_return(!m->destination, -EEXIST);
@@ -5442,6 +5443,7 @@ _public_ int sd_bus_message_set_destination(sd_bus_message *m, const char *desti
_public_ int sd_bus_message_set_sender(sd_bus_message *m, const char *sender) {
assert_return(m, -EINVAL);
assert_return(sender, -EINVAL);
+ assert_return(service_name_is_valid(sender), -EINVAL);
assert_return(!m->sealed, -EPERM);
assert_return(!m->sender, -EEXIST);