]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lib: [procutils.c] improve robustness
authorKarel Zak <kzak@redhat.com>
Mon, 20 Jun 2011 11:58:41 +0000 (13:58 +0200)
committerKarel Zak <kzak@redhat.com>
Mon, 20 Jun 2011 11:58:41 +0000 (13:58 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/procutils.c

index 2c9e83722d333ea938e5adc0817018a357ef79db..2ab322522f7a01e0e1cb559b0ed9a54ca71688e7 100644 (file)
@@ -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;