From 25c945e2ef03bc043c2f421b930a59c73534473f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Thu, 2 Sep 2021 23:37:53 +0200 Subject: [PATCH] PCP: do not set exe to empty string In case the executable is an empty string, e.g. if pcp is run by an unprivileged user, do not set procExe to an empty value, which breaks the formatting of the PROCEXE column and the merged-cmdline logic. --- pcp/PCPProcessList.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pcp/PCPProcessList.c b/pcp/PCPProcessList.c index 3001d5e8..b55b5a42 100644 --- a/pcp/PCPProcessList.c +++ b/pcp/PCPProcessList.c @@ -317,7 +317,7 @@ static void PCPProcessList_updateCmdline(Process* process, int pid, int offset, Process_updateComm(process, comm); if (PCPMetric_instance(PCP_PROC_EXE, pid, offset, &value, PM_TYPE_STRING)) { - Process_updateExe(process, value.cp); + Process_updateExe(process, value.cp[0] ? value.cp : NULL); free(value.cp); } }