From: Rich Felker Date: Wed, 20 Jun 2012 18:47:34 +0000 (-0400) Subject: fix invalid memory access in pclose X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=9799560f79d37fb53d821b2f0b591a6ff260ebc3;hp=9c21f4342c787e04a9e31ad8a1d87a65c89968ca;p=musl fix invalid memory access in pclose --- diff --git a/src/stdio/pclose.c b/src/stdio/pclose.c index c2fe7a24..7c777966 100644 --- a/src/stdio/pclose.c +++ b/src/stdio/pclose.c @@ -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; }