From b3273dafc730e6973045f94a849553a9b5280d2d Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Thu, 7 Nov 2013 17:11:25 +0100 Subject: bus: also check for NULL when appending trivial types --- src/libsystemd-bus/bus-message.c | 6 ++++++ 1 file changed, 6 insertions(+) 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; -- cgit v1.2.3-54-g00ecf