From 23c6f770cc214a9c9fe29dc964b64400987faa62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 13 Oct 2013 17:40:34 -0400 Subject: [PATCH] bus: make sure we don't try to malloc 0 bytes --- src/libsystemd-bus/bus-message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index bc67c323808..3f68435d21b 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;