pidof: Do not skip the NULL terminator in cmdline.

This should never happen (cmdline[0] should always be non-NULL), but
just in case.
This commit is contained in:
Qualys Security Advisory authored and Craig Small committed 2018-05-19 07:32:21 +10:00
1 parent 6cadda2b4f
commit bba9f384c0
1 file changed
+1 -1
+1 -1
View File
@@ -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;