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.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index b5a311530b..209fd71c13 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -2196,6 +2196,13 @@ int bus_body_part_map(struct bus_body_part *part) {
if (part->size <= 0)
return 0;
+ /* For smaller zero parts (as used for padding) we don't need to map anything... */
+ if (part->memfd < 0 && part->is_zero && part->size < 8) {
+ static const uint8_t zeroes[7] = { };
+ part->data = (void*) zeroes;
+ return 0;
+ }
+
psz = PAGE_ALIGN(part->size);
if (part->memfd >= 0)
@@ -2222,9 +2229,6 @@ void bus_body_part_unmap(struct bus_body_part *part) {
if (part->memfd < 0)
return;
- if (!part->sealed)
- return;
-
if (!part->data)
return;