summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-11-07 17:11:25 +0100
committerLennart Poettering <lennart@poettering.net>2013-11-07 17:11:25 +0100
commitb3273dafc730e6973045f94a849553a9b5280d2d (patch)
treea1e0f2b1205ea4dee08085f643a96d6195d22acf /src
parent15912917ef8b96124bd2553d5ae851c1b113efd8 (diff)
bus: also check for NULL when appending trivial types
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd-bus/bus-message.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index 4b53a6c509..3f9baca806 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -1379,6 +1379,7 @@ 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;
@@ -1434,6 +1435,11 @@ int message_append_basic(sd_bus_message *m, char type, const void *p, const void
}
default:
+ if (!p) {
+ r = -EINVAL;
+ goto fail;
+ }
+
align = bus_type_get_alignment(type);
sz = bus_type_get_size(type);
break;