From: Yu Watanabe Date: Mon, 9 Nov 2020 05:33:16 +0000 (+0900) Subject: sd-bus: fix possible division by 0 X-Git-Tag: v247-rc2~17^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=291bb0b01cae22c3c14882fd5a0ad557c92d9298;p=thirdparty%2Fsystemd.git sd-bus: fix possible division by 0 Fixes #17541. --- diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c index f966dda2294..b8cd5e64177 100644 --- a/src/libsystemd/sd-bus/bus-message.c +++ b/src/libsystemd/sd-bus/bus-message.c @@ -3189,6 +3189,8 @@ static int container_next_item(sd_bus_message *m, struct bus_container *c, size_ int sz; sz = bus_gvariant_get_size(c->signature); + if (sz == 0) + return -EBADMSG; if (sz < 0) { int alignment;