]> git.sur5r.net Git - i3/i3/commitdiff
Bugfix: Correctly fill the buffer with zeros
authorMichael Stapelberg <michael@stapelberg.de>
Wed, 9 Nov 2011 22:23:33 +0000 (22:23 +0000)
committerMichael Stapelberg <michael@stapelberg.de>
Wed, 9 Nov 2011 22:23:33 +0000 (22:23 +0000)
src/main.c

index 52e00e04c26a44b0e49918c4c878f8c223c972ef..062a48626d8765d1a99bd803847fe952b8fa424f 100644 (file)
@@ -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);