From 65ccc407fa3e0cd1c065351ae4ff9701f03bf86f Mon Sep 17 00:00:00 2001 From: Joachim Nilsson Date: Thu, 22 Mar 2018 08:08:48 +0100 Subject: [PATCH] Follow-up #100: Remove buggy "optimization", caught by Coverity Scan We cannot allow pid_runpath() to return its 'file' argument because that may be a stack variable in a helper function. Signed-off-by: Joachim Nilsson --- src/pid.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/pid.h b/src/pid.h index 9eaec3d6..f204858f 100644 --- a/src/pid.h +++ b/src/pid.h @@ -55,9 +55,6 @@ static inline char *pid_runpath(const char *file, char *path, size_t len) unknown = 0; } - if (!strncmp(file, prefix, strlen(prefix))) - return (char *)file; - if (!strncmp(file, "/var/run/", 9)) file += 9; else if (!strncmp(file, "/run/", 5))