From: Zbigniew Jędrzejewski-Szmek Date: Sun, 13 Oct 2013 21:40:34 +0000 (-0400) Subject: bus: make sure we don't try to malloc 0 bytes X-Git-Tag: v209~1897 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=23c6f770cc214a9c9fe29dc964b64400987faa62 bus: make sure we don't try to malloc 0 bytes --- diff --git a/src/libsystemd-bus/bus-message.c b/src/libsystemd-bus/bus-message.c index bc67c3238..3f68435d2 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;