From: Michael Stapelberg Date: Wed, 9 Nov 2011 22:23:33 +0000 (+0000) Subject: Bugfix: Correctly fill the buffer with zeros X-Git-Tag: 4.1~21 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6bdd12a584a8129cfa047cb56cca2dec78afca3e;p=i3%2Fi3 Bugfix: Correctly fill the buffer with zeros --- diff --git a/src/main.c b/src/main.c index 52e00e04..062a4862 100644 --- a/src/main.c +++ b/src/main.c @@ -413,6 +413,7 @@ int main(int argc, char *argv[]) { LOG("CORE DUMPS: Your current working directory is \"%s\".\n", cwd); int patternfd; if ((patternfd = open("/proc/sys/kernel/core_pattern", O_RDONLY)) >= 0) { + memset(cwd, '\0', sizeof(cwd)); if (read(patternfd, cwd, sizeof(cwd)) > 0) /* a trailing newline is included in cwd */ LOG("CORE DUMPS: Your core_pattern is: %s", cwd);