bus: also check for NULL when appending trivial types

This commit is contained in:
Lennart Poettering
2013-11-07 17:11:25 +01:00
parent 15912917ef
commit b3273dafc7
+6
View File
@@ -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;