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 <troglobit@gmail.com>
This commit is contained in:
Joachim Nilsson
2018-03-22 08:08:48 +01:00
parent 7fe9f3c4b6
commit 65ccc407fa
-3
View File
@@ -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))