提交 9799560f 编写于 作者: R Rich Felker

fix invalid memory access in pclose

上级 9c21f434
......@@ -3,8 +3,9 @@
int pclose(FILE *f)
{
int status;
pid_t pid = f->pipe_pid;
fclose(f);
while (waitpid(f->pipe_pid, &status, 0) == -1)
while (waitpid(pid, &status, 0) == -1)
if (errno != EINTR) return -1;
return status;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册