diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-12-23 23:48:30 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-12-23 23:48:30 +0100 |
commit | 8f19720dd2782684a0c73d1deb5e1ac3e1fb086d (patch) | |
tree | e01822721829b03d0a8915580b016f6fadf77595 /src/libsystemd-bus/bus-message.c | |
parent | 85feb8e4d9b0ef65c338e1a1a16665d0cb8d544a (diff) |
bus: fix assert when serializing fixed size struct to gvariant
Diffstat (limited to 'src/libsystemd-bus/bus-message.c')
-rw-r--r-- | src/libsystemd-bus/bus-message.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index 39a85d58f7..9092a66977 100644 --- a/src/libsystemd-bus/bus-message.c +++ b/src/libsystemd-bus/bus-message.c @@ -2055,7 +2055,7 @@ static int bus_message_close_struct(sd_bus_message *m, struct bus_container *c, return r; } - assert(i <= c->n_offsets); + assert(!c->need_offsets || i <= c->n_offsets); /* We need to add an offset for each item that has a * variable size and that is not the last one in the @@ -2067,7 +2067,8 @@ static int bus_message_close_struct(sd_bus_message *m, struct bus_container *c, p += n; } - assert(i == c->n_offsets); + assert(!c->need_offsets || i == c->n_offsets); + assert(c->need_offsets || n_variable == 0); if (n_variable <= 0) { a = message_extend_body(m, 1, 0, add_offset); |