summaryrefslogtreecommitdiff
path: root/src/libsystemd-bus/bus-message.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd-bus/bus-message.c')
-rw-r--r--src/libsystemd-bus/bus-message.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index 5e355127b0..9e712717cc 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -161,7 +161,9 @@ static void *message_extend_fields(sd_bus_message *m, size_t align, size_t sz, b
size_t old_size, new_size, start;
assert(m);
- assert_return(!m->poisoned, NULL);
+
+ if (m->poisoned)
+ return NULL;
old_size = sizeof(struct bus_header) + m->header->fields_size;
start = ALIGN_TO(old_size, align);
@@ -987,7 +989,9 @@ struct bus_body_part *message_append_part(sd_bus_message *m) {
struct bus_body_part *part;
assert(m);
- assert_return(!m->poisoned, NULL);
+
+ if (m->poisoned)
+ return NULL;
if (m->n_body_parts <= 0) {
part = &m->body;
@@ -1134,7 +1138,9 @@ static void *message_extend_body(sd_bus_message *m, size_t align, size_t sz, boo
assert(m);
assert(align > 0);
assert(!m->sealed);
- assert_return(!m->poisoned, NULL);
+
+ if (m->poisoned)
+ return NULL;
start_body = ALIGN_TO((size_t) m->header->body_size, align);
end_body = start_body + sz;