summaryrefslogtreecommitdiffstats
path: root/service
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2015-04-19 17:14:59 +0200
committerFelix Fietkau <nbd@openwrt.org>2015-04-19 17:15:06 +0200
commit312d0fc22d32171b5b2f6cf5272b11784888dfbe (patch)
tree5dafc3b546b4911ff4e663e70503abd6db61c588 /service
parent27159f21f76b973a9fa3ec92b8fee2e390d43a43 (diff)
downloadunitd-312d0fc22d32171b5b2f6cf5272b11784888dfbe.tar
unitd-312d0fc22d32171b5b2f6cf5272b11784888dfbe.zip
instance: avoid dumping invalid service instances - prevents a potential crash
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
Diffstat (limited to 'service')
-rw-r--r--service/instance.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/service/instance.c b/service/instance.c
index f5b61fa..1fb65fa 100644
--- a/service/instance.c
+++ b/service/instance.c
@@ -871,6 +871,9 @@ void instance_dump(struct blob_buf *b, struct service_instance *in, int verbose)
{
void *i;
+ if (!in->valid)
+ return;
+
i = blobmsg_open_table(b, in->name);
blobmsg_add_u8(b, "running", in->proc.pending);
if (in->proc.pending)