[systemd-devel] [PATCH 2/5] systemctl: check if iterator was initialized succesfully
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Fri Mar 1 13:46:47 PST 2013
On Fri, Mar 01, 2013 at 06:29:58PM +0100, Lukas Nykryn wrote:
> ---
> src/systemctl/systemctl.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
> index c67c6c9..99286cf 100644
> --- a/src/systemctl/systemctl.c
> +++ b/src/systemctl/systemctl.c
> @@ -2084,7 +2084,11 @@ static int get_cgroup_attr(DBusConnection *bus, char **args) {
> if (r < 0)
> return r;
>
> - dbus_message_iter_init(reply, &iter);
> + if (!dbus_message_iter_init(reply, &iter)) {
> + log_error("Failed to initialize iterator.");
> + return -EIO;
> + }
> +
> r = bus_parse_strv_iter(&iter, &list);
> if (r < 0) {
> log_error("Failed to parse value list.");
Applied.
Zbyszek
More information about the systemd-devel
mailing list