summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-message.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-bus/bus-message.c')
-rw-r--r--src/libsystemd-bus/bus-message.c11
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;