summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-06-20 14:47:34 -0400
committerRich Felker <dalias@aerifal.cx>2012-06-20 14:47:34 -0400
commit9799560f79d37fb53d821b2f0b591a6ff260ebc3 (patch)
tree2dda22409bb1ba24ffc8def0ed54a3d0cce8a797
parent9c21f4342c787e04a9e31ad8a1d87a65c89968ca (diff)
downloadmusl-9799560f79d37fb53d821b2f0b591a6ff260ebc3.tar.gz
musl-9799560f79d37fb53d821b2f0b591a6ff260ebc3.tar.bz2
musl-9799560f79d37fb53d821b2f0b591a6ff260ebc3.tar.xz
musl-9799560f79d37fb53d821b2f0b591a6ff260ebc3.zip
fix invalid memory access in pclose
-rw-r--r--src/stdio/pclose.c3
1 files changed, 2 insertions, 1 deletions
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;
}