This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libc/14895] corruption in popen pclose


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]