summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-10-13 17:40:34 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2013-10-13 17:56:55 -0400
commit23c6f770cc214a9c9fe29dc964b64400987faa62 (patch)
tree313262e66fc311f3f436ecd5efcae43ed5aa39e8
parent1ca208fb4f93e5869704af1812cbff7130a2fc03 (diff)
bus: make sure we don't try to malloc 0 bytes
-rw-r--r--src/libsystemd-bus/bus-message.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c
index bc67c32380..3f68435d21 100644
--- a/src/libsystemd-bus/bus-message.c
+++ b/src/libsystemd-bus/bus-message.c
@@ -1284,7 +1284,7 @@ static int part_make_space(
part->munmap_this = true;
} else {
- n = realloc(part->data, sz);
+ n = realloc(part->data, MAX(sz, 1u));
if (!n) {
m->poisoned = true;
return -ENOMEM;