From d5c752eacdc72545328f1d5153f26ceb5fc6cfc0 Mon Sep 17 00:00:00 2001 From: Florian Forster Date: Sun, 26 Aug 2007 19:07:10 +0200 Subject: [PATCH] processes plugin: Fix a possible segfault. --- src/processes.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/processes.c b/src/processes.c index ccf1571f..4b59351c 100644 --- a/src/processes.c +++ b/src/processes.c @@ -642,11 +642,14 @@ static int *ps_read_tasks (int pid) closedir (dh); + if (list_len == 0) + return (NULL); + assert (list_len < list_size); assert (list[list_len] == 0); return (list); -} +} /* int *ps_read_tasks */ int ps_read_process (int pid, procstat_t *ps, char *state) { -- 2.30.2