chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
bus: fix assert when serializing fixed size struct to gvariant
[elogind.git]
/
src
/
libsystemd-bus
/
bus-message.c
diff --git
a/src/libsystemd-bus/bus-message.c
b/src/libsystemd-bus/bus-message.c
index 39a85d58f71dc20525bc9ff725d3fb9bad47dc55..9092a6697755fca8d6902217a2661b242afb968f 100644
(file)
--- 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;
}
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
/* 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;
}
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);
if (n_variable <= 0) {
a = message_extend_body(m, 1, 0, add_offset);