From 4ef26746158b26c89057e6be81bc88ce553ebcdb Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 20 Jun 2011 13:58:41 +0200 Subject: lib: [procutils.c] improve robustness Signed-off-by: Karel Zak --- lib/procutils.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/procutils.c') diff --git a/lib/procutils.c b/lib/procutils.c index 2c9e83722..2ab322522 100644 --- a/lib/procutils.c +++ b/lib/procutils.c @@ -72,6 +72,9 @@ int proc_next_tid(struct proc_tasks *tasks, pid_t *tid) struct dirent *d; char *end; + if (!tasks || !tid) + return -1; + *tid = 0; errno = 0; -- cgit v1.2.3-55-g7522