mirror of
https://github.com/troglobit/finit.git
synced 2026-10-28 12:30:44 +00:00
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:
1 parent
7fe9f3c4b6
commit
65ccc407fa
1 file changed
-3
@@ -55,9 +55,6 @@ static inline char *pid_runpath(const char *file, char *path, size_t len)
|
|||||||
unknown = 0;
|
unknown = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strncmp(file, prefix, strlen(prefix)))
|
|
||||||
return (char *)file;
|
|
||||||
|
|
||||||
if (!strncmp(file, "/var/run/", 9))
|
if (!strncmp(file, "/var/run/", 9))
|
||||||
file += 9;
|
file += 9;
|
||||||
else if (!strncmp(file, "/run/", 5))
|
else if (!strncmp(file, "/run/", 5))
|
||||||
|
|||||||
Reference in new issue
Block a user