From a416d00d0e02dc82131223b199113b0382636e9b Mon Sep 17 00:00:00 2001 From: Rich Felker Date: Sat, 11 Jan 2020 20:16:48 -0500 Subject: sh.c: fix memory corruption due to uninitialized sh_function in sh_run --- toys/pending/sh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toys/pending/sh.c b/toys/pending/sh.c index 482639da..32e33507 100644 --- a/toys/pending/sh.c +++ b/toys/pending/sh.c @@ -1685,7 +1685,7 @@ dprintf(2, "TODO skipped running for((;;)), need math parser\n"); // Parse and run a self-contained command line with no prompt/continuation static int sh_run(char *new) { - struct sh_function scratch; + struct sh_function scratch = { 0 }; int rc; // TODO: parse with len? (End early?) -- cgit v1.2.3