chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
machinectl: make sure we are not reading an unitialized variable
[elogind.git]
/
src
/
machine
/
machinectl.c
diff --git
a/src/machine/machinectl.c
b/src/machine/machinectl.c
index cc3be98b530d36101675d86c0519e99ff57902ca..574c988e82babca5add01d6bdf430d90bd4ecdaf 100644
(file)
--- 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);