From bba9f384c041b4f2d642670a72dea20afd3011a8 Mon Sep 17 00:00:00 2001 From: Qualys Security Advisory Date: Thu, 1 Jan 1970 00:00:00 +0000 Subject: [PATCH] pidof: Do not skip the NULL terminator in cmdline. This should never happen (cmdline[0] should always be non-NULL), but just in case. --- pidof.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pidof.c b/pidof.c index c2b2eb4c..7394c8a6 100644 --- a/pidof.c +++ b/pidof.c @@ -161,7 +161,7 @@ static void select_procs (void) } } - if (!is_omitted(task.XXXID) && task.cmdline) { + if (!is_omitted(task.XXXID) && task.cmdline && *task.cmdline) { cmd_arg0 = *task.cmdline;