From 6bdd12a584a8129cfa047cb56cca2dec78afca3e Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Wed, 9 Nov 2011 22:23:33 +0000 Subject: [PATCH] Bugfix: Correctly fill the buffer with zeros --- src/main.c | 1 + 1 file changed, 1 insertion(+) 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); -- 2.39.5