diff --git a/NEWS b/NEWS index 41032e37..681d9d04 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +procps-ng-3.3.14 +---------------- + * pgrep: Don't segfault on non match Debian #894917 + procps-ng-3.3.13 ---------------- * library: Increment to 7:0:1 diff --git a/pgrep.c b/pgrep.c index 051457ef..004b6243 100644 --- a/pgrep.c +++ b/pgrep.c @@ -592,7 +592,7 @@ static struct el * select_procs (int *num) *num = matches; - if ((!opt_full) && (strlen(opt_pattern) > 15)) + if ((!matches) && (!opt_full) && opt_pattern && (strlen(opt_pattern) > 15)) xwarnx(_("pattern that searches for process name longer than 15 characters will result in zero matches\n" "Try `%s -f' option to match against the complete command line."), program_invocation_short_name);