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"
This commit is contained in:
cinap_lenrek 2018-12-26 05:04:56 +01:00
parent 1b619dea42
commit 27921a1ba0

View file

@ -199,7 +199,8 @@ execsh(char *args, char *cmd, Bufblock *buf, Envy *e)
perror(shell); perror(shell);
_exits("exec"); _exits("exec");
} }
close(out[1]); if(buf)
close(out[1]);
close(in[0]); close(in[0]);
p = cmd+strlen(cmd); p = cmd+strlen(cmd);
while(cmd < p){ while(cmd < p){