summaryrefslogtreecommitdiff
path: root/src/stdio
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 /src/stdio
parent9c21f4342c787e04a9e31ad8a1d87a65c89968ca (diff)
downloadmusl-9799560f79d37fb53d821b2f0b591a6ff260ebc3.tar.gz
fix invalid memory access in pclose
Diffstat (limited to 'src/stdio')
-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;
}