chiark / gitweb /
bus: it's OK to send messages with an empty payload but non-empty signature
[elogind.git] / src / libsystemd-bus / bus-message.c
index 35a46786009881d336550a60e20ac766979d82c2..32af8609b3d0c0264aac21e99e33a389f02cf073 100644 (file)
@@ -4150,6 +4150,9 @@ _public_ int sd_bus_message_rewind(sd_bus_message *m, int complete) {
                 m->rindex = c->begin;
         }
 
+        c->offset_index = 0;
+        c->item_size = c->n_offsets > 0 ? c->offsets[0] : c->end;
+
         return !isempty(c->signature);
 }
 
@@ -4848,7 +4851,7 @@ int bus_message_parse_fields(sd_bus_message *m) {
         uint32_t unix_fds = 0;
         void *offsets = NULL;
         unsigned n_offsets = 0;
-        size_t sz;
+        size_t sz = 0;
         unsigned i = 0;
 
         assert(m);
@@ -5082,9 +5085,6 @@ int bus_message_parse_fields(sd_bus_message *m) {
         if (m->n_fds != unix_fds)
                 return -EBADMSG;
 
-        if (isempty(m->root_container.signature) != (BUS_MESSAGE_BODY_SIZE(m) == 0))
-                return -EBADMSG;
-
         switch (m->header->type) {
 
         case SD_BUS_MESSAGE_SIGNAL: