[systemd-devel] [PATCH 6/7] libsystemd-bus: gracefully handle 0-sized payload vectors
Daniel Mack
zonque at gmail.com
Fri Nov 15 10:32:22 PST 2013
Such messages arise when 1:1-bridging legacy clients to kdbus.
---
src/libsystemd-bus/bus-kernel.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/libsystemd-bus/bus-kernel.c b/src/libsystemd-bus/bus-kernel.c
index 94eabfc..6626db1 100644
--- a/src/libsystemd-bus/bus-kernel.c
+++ b/src/libsystemd-bus/bus-kernel.c
@@ -52,7 +52,9 @@ int bus_kernel_parse_unique_name(const char *s, uint64_t *id) {
static void append_payload_vec(struct kdbus_item **d, const void *p, size_t sz) {
assert(d);
- assert(sz > 0);
+
+ if (sz == 0)
+ return;
*d = ALIGN8_PTR(*d);
--
1.8.4.2
More information about the systemd-devel
mailing list