Fixed memory initialization error in pidof. Fix provided by Markus Fischer.

This commit is contained in:
Jesse
2023-03-24 11:18:02 -03:00
parent b70b2776ed
commit b6aacf3b68
2 changed files with 2 additions and 0 deletions

View File

@@ -662,6 +662,7 @@ int readproc()
/* Try to stat the executable. */
snprintf(path, sizeof(path), "/proc/%s/exe", d->d_name);
p->pathname = (char *)xmalloc(PATH_MAX);
memset(p->pathname, 0, PATH_MAX);
if (readlink(path, p->pathname, PATH_MAX) == -1) {
p->pathname = NULL;
}