1
0
mirror of https://github.com/systemd/systemd.git synced 2025-03-14 04:58:28 +03:00

sd-bus: initialize return values on success in sd_bus_message_read_array()

Fixes: #17346
This commit is contained in:
Lennart Poettering 2020-10-14 16:35:55 +02:00
parent 7848cb8c57
commit 6293d958a4

View File

@ -4795,8 +4795,13 @@ _public_ int sd_bus_message_read_array(
assert_return(!BUS_MESSAGE_NEED_BSWAP(m), -EOPNOTSUPP);
r = sd_bus_message_enter_container(m, SD_BUS_TYPE_ARRAY, CHAR_TO_STR(type));
if (r <= 0)
if (r < 0)
return r;
if (r == 0) {
*ptr = NULL;
*size = 0;
return 0;
}
c = message_get_last_container(m);