diff options
author | Kay Sievers <kay@vrfy.org> | 2013-11-07 16:44:33 +0100 |
---|---|---|
committer | Kay Sievers <kay@vrfy.org> | 2013-11-07 16:57:16 +0100 |
commit | 15912917ef8b96124bd2553d5ae851c1b113efd8 (patch) | |
tree | 3a253906adf58a89addaa1edf67ec5def35145f5 /src/libsystemd-bus/bus-message.c | |
parent | e633ea1c9c5249ed5bf708a2ed6385c4823d4706 (diff) |
bus: message_append_basic() - allow string == NULL
Diffstat (limited to 'src/libsystemd-bus/bus-message.c')
-rw-r--r-- | src/libsystemd-bus/bus-message.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index 9543ae3b26..4b53a6c509 100644 --- a/src/libsystemd-bus/bus-message.c +++ b/src/libsystemd-bus/bus-message.c @@ -1323,7 +1323,6 @@ int message_append_basic(sd_bus_message *m, char type, const void *p, const void int r; assert_return(m, -EINVAL); - assert_return(p, -EINVAL); assert_return(!m->sealed, -EPERM); assert_return(bus_type_is_basic(type), -EINVAL); assert_return(!m->poisoned, -ESTALE); @@ -1380,6 +1379,11 @@ int message_append_basic(sd_bus_message *m, char type, const void *p, const void break; case SD_BUS_TYPE_BOOLEAN: + if (!p) { + r = -EINVAL; + goto fail; + } + align = sz = 4; assert_cc(sizeof(int) == sizeof(uint32_t)); @@ -1391,6 +1395,11 @@ int message_append_basic(sd_bus_message *m, char type, const void *p, const void case SD_BUS_TYPE_UNIX_FD: { int z, *f; + if (!p) { + r = -EINVAL; + goto fail; + } + if (!m->allow_fds) { r = -ENOTSUP; goto fail; |