]> granicus.if.org Git - procps-ng/commitdiff
pgrep: avoid SEGV when lightweight and list-full options are used together
authorEero Häkkinen <Eero+gitorious@xn--Hkkinen-5wa.fi>
Fri, 5 Sep 2014 21:35:16 +0000 (00:35 +0300)
committerEero Häkkinen <Eero+gitorious@xn--Hkkinen-5wa.fi>
Fri, 5 Sep 2014 21:35:16 +0000 (00:35 +0300)
do not segfault

pgrep.c

diff --git a/pgrep.c b/pgrep.c
index 037677996c009e7f97dd89009ab591c8b1431d0b..3ba363433be4e7425321dbe097bf9c643a0018a8 100644 (file)
--- a/pgrep.c
+++ b/pgrep.c
@@ -629,7 +629,7 @@ static struct el * select_procs (int *num)
                                                if (list == NULL)
                                                        exit (EXIT_FATAL);
                                        }
-                                       if (opt_long) {
+                                       if (opt_long || opt_longlong) {
                                                list[matches].str = xstrdup (cmdoutput);
                                                list[matches++].num = subtask.XXXID;
                                        } else {