summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2013-05-15 01:36:09 +0200
committerLennart Poettering <lennart@poettering.net>2013-05-15 01:36:09 +0200
commit13c299d3a8603db8fdfc715eaea69ce5acd7aecb (patch)
tree473811b4cbc15f05dde71361835baf9ad5775228 /src
parent47e6ce32bb5bc8353c2070b8247be82410f4d78e (diff)
bus: minor fixes
Diffstat (limited to 'src')
-rw-r--r--src/libsystemd-bus/bus-message.c3
-rw-r--r--src/libsystemd-bus/bus-socket.c4
2 files changed, 5 insertions, 2 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index 5783140cf8..721dafe38b 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -3568,6 +3568,9 @@ int bus_message_seal(sd_bus_message *m, uint64_t serial) {
if (m->n_containers > 0)
return -EBADMSG;
+ if (m->poisoned)
+ return -ESTALE;
+
/* If there's a non-trivial signature set, then add it in here */
if (!isempty(m->root_container.signature)) {
r = message_append_field_signature(m, SD_BUS_MESSAGE_HEADER_SIGNATURE, m->root_container.signature, NULL);
diff --git a/src/libsystemd-bus/bus-socket.c b/src/libsystemd-bus/bus-socket.c
index 4dafe1fdb7..4a07869157 100644
--- a/src/libsystemd-bus/bus-socket.c
+++ b/src/libsystemd-bus/bus-socket.c
@@ -72,7 +72,7 @@ static int append_iovec(sd_bus_message *m, const void *p, size_t sz) {
static int bus_message_setup_iovec(sd_bus_message *m) {
struct bus_body_part *part;
- unsigned n;
+ unsigned n, i;
int r;
assert(m);
@@ -102,7 +102,7 @@ static int bus_message_setup_iovec(sd_bus_message *m) {
return r;
}
- for (part = &m->body; part && part->size > 0; part = part->next) {
+ for (i = 0, part = &m->body; i < m->n_body_parts; i++, part = part->next) {
r = append_iovec(m, part->data, part->size);
if (r < 0)
return r;