aboutsummaryrefslogtreecommitdiff
path: root/toys
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2020-01-11 20:16:48 -0500
committerRob Landley <rob@landley.net>2020-01-11 19:37:59 -0600
commita416d00d0e02dc82131223b199113b0382636e9b (patch)
tree0258f68ac574d32295a9a3e7d4ec9e37b2f77d56 /toys
parentc6e79470ab5cfe3fc75fe95bfedaf44304d264ec (diff)
downloadtoybox-a416d00d0e02dc82131223b199113b0382636e9b.tar.gz
sh.c: fix memory corruption due to uninitialized sh_function in sh_run
Diffstat (limited to 'toys')
-rw-r--r--toys/pending/sh.c2
1 files changed, 1 insertions, 1 deletions
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?)