From: Rich Felker Date: Wed, 20 Jun 2012 18:47:34 +0000 (-0400) Subject: fix invalid memory access in pclose X-Git-Tag: v0.9.2~10 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9799560f79d37fb53d821b2f0b591a6ff260ebc3;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; }