diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-12-26 05:04:56 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2018-12-26 05:04:56 +0100 |
commit | 27921a1ba0e70a9f6c01f174d69749c689f625b5 (patch) | |
tree | e4c30c25ee83f4da2ed12a3235a0fccfe50de345 /sys/src/cmd/mk | |
parent | 1b619dea42e60be0316f03a358c52c2e86a6d654 (diff) |
mk: fix closing random fd from uninitialized stack variable (thanks BurnZeZ, mycroftiv)
mycroftiv → this is practically "500 mile email" territory - the "6 letter mk bug"
Diffstat (limited to 'sys/src/cmd/mk')
-rw-r--r-- | sys/src/cmd/mk/plan9.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/src/cmd/mk/plan9.c b/sys/src/cmd/mk/plan9.c index d87fcfa4d..485537c84 100644 --- a/sys/src/cmd/mk/plan9.c +++ b/sys/src/cmd/mk/plan9.c @@ -199,7 +199,8 @@ execsh(char *args, char *cmd, Bufblock *buf, Envy *e) perror(shell); _exits("exec"); } - close(out[1]); + if(buf) + close(out[1]); close(in[0]); p = cmd+strlen(cmd); while(cmd < p){ |