From c31531589603646370f089e0804e28af4f87be2e Mon Sep 17 00:00:00 2001 From: Gavin Hayes Date: Mon, 2 Oct 2023 16:31:15 -0400 Subject: [PATCH] fleaks.c: initialize command buffer before calling system (#904) --- libc/stdio/fleaks.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libc/stdio/fleaks.c b/libc/stdio/fleaks.c index 67244690a..74865080f 100644 --- a/libc/stdio/fleaks.c +++ b/libc/stdio/fleaks.c @@ -47,10 +47,11 @@ void CheckForFileLeaks(void) { } } if (gotsome) { - char proc[64]; *p++ = '\n'; *p = 0; write(2, msg, p - msg); + char proc[64]; + p = proc; p = stpcpy(p, "ls -hal /proc/"); p = FormatInt32(p, getpid()); p = stpcpy(p, "/fd");