summaryrefslogtreecommitdiff
path: root/src/machine
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-18 21:44:58 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-07-18 21:44:58 -0400
commite7e9b6bb0b0bc5b1eb256a44f8afec6b634f26ef (patch)
treea5936dce5da7b7bea60d26d8c5ab76f75e5a85a8 /src/machine
parent1651e2c61e544de9ca947c8b3202552b1272ef57 (diff)
machinectl: make sure we are not reading an unitialized variable
Diffstat (limited to 'src/machine')
-rw-r--r--src/machine/machinectl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index cc3be98b5..574c988e8 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -376,6 +376,8 @@ static int map_netif(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_
r = sd_bus_message_read_array(m, SD_BUS_TYPE_INT32, &v, &l);
if (r < 0)
return r;
+ if (r == 0)
+ return -EBADMSG;
i->n_netif = l / sizeof(int32_t);
i->netif = memdup(v, l);