This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/14895] corruption in popen pclose
- From: "ajeet.yadav.77 at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sources dot redhat dot com
- Date: Sat, 01 Dec 2012 10:37:00 +0000
- Subject: [Bug libc/14895] corruption in popen pclose
- Auto-submitted: auto-generated
- References: <bug-14895-131@http.sourceware.org/bugzilla/>
http://sourceware.org/bugzilla/show_bug.cgi?id=14895
--- Comment #1 from Ajeet Yadav <ajeet.yadav.77 at gmail dot com> 2012-12-01 10:37:00 UTC ---
Yesturday I have been able to fix this issue with below patch, now this problem
no longer occurs.
But still my interest is 1> Why this patch fixes the problem ? 2> What change
between 2.11.1 and 2.14.1 might have caused this problem
------------------------------------------------------------------------------
diff --git a/libio/iopopen.c b/libio/iopopen.c
--- a/libio/iopopen.c
+++ b/libio/iopopen.c
@@ -299,6 +299,7 @@ _IO_new_popen (command, mode)
new_f = (struct locked_FILE *) malloc (sizeof (struct locked_FILE));
if (new_f == NULL)
return NULL;
+ memset(new_f, 0, sizeof (struct locked_FILE));
#ifdef _IO_MTSAFE_IO
new_f->fpx.file.file._lock = &new_f->lock;
#endif
------------------------------------------------------------------------------
--
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.