[hackers][ubase][PATCH] Fix segfault in killall5 without -o

From: Platon Ryzhikov <ihummer63_AT_yandex.ru>
Date: Thu, 28 Jun 2018 22:58:10 +0300

---
 killall5.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/killall5.c b/killall5.c
index 14790b9..4d22b98 100644
--- a/killall5.c
+++ b/killall5.c
_AT_@ -73,7 +73,7 @@ main(int argc, char *argv[])
        SLIST_INIT(&omitpid_head);
-       for (p = strtok(arg, ","); p; p = strtok(NULL, ",")) {
+       if (arg) for (p = strtok(arg, ","); p; p = strtok(NULL, ",")) {
                pe = emalloc(sizeof(*pe));
                pe->pid = estrtol(p, 10);
                SLIST_INSERT_HEAD(&omitpid_head, pe, entry);
--
2.18.0
Received on Thu Jun 28 2018 - 21:58:10 CEST

This archive was generated by hypermail 2.3.0 : Thu Jun 28 2018 - 22:00:27 CEST