diff --git a/doc/Changelog b/doc/Changelog index 1819ad5..62ad2da 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -7,6 +7,7 @@ sysvinit (3.07) released; urgency=low This is now fixed as we check both the realpath and symbolic path for processes. In other words, "pidof /tmp/sleep" and "pidof /usr/bin/sleep" will return the same PIDs when /tmp/sleep is a symbolic link to /usr/bin/sleep. + * Fixed memory initialization error in pidof. Fix provided by Markus Fischer. sysvinit (3.06) released; urgency=low diff --git a/src/killall5.c b/src/killall5.c index 75750d3..9ab0782 100644 --- a/src/killall5.c +++ b/src/killall5.c @@ -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; }