未验证 提交 b9ea45e4 编写于 作者: R Richard Stanway 提交者: GitHub

Merge pull request #2977 from futr/fix-non-terminated-str

libobs: Fix os_get_executable_path_ptr on Linux
......@@ -287,7 +287,10 @@ char *os_get_executable_path_ptr(const char *name)
}
count = pathlen;
#else
ssize_t count = readlink("/proc/self/exe", exe, PATH_MAX);
ssize_t count = readlink("/proc/self/exe", exe, PATH_MAX - 1);
if (count >= 0) {
exe[count] = '\0';
}
#endif
const char *path_out = NULL;
struct dstr path;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册