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/13983] __libc_message() shouldn't blindly write to STDERR_FILENO


http://sourceware.org/bugzilla/show_bug.cgi?id=13983

Marek Polacek <polacek at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |polacek at redhat dot com

--- Comment #1 from Marek Polacek <polacek at redhat dot com> 2012-04-15 23:18:13 UTC ---
E.g. here:

$ cat x.c
#include <stdio.h>
#include <string.h>

int
main (void)
{
  fclose (stderr);
  char a[5] = { };
  strcpy (a, "foobarbaz");
}
$ gcc -O2 -D_FORTIFY_SOURCE=2 x.c
$ LIBC_FATAL_STDERR_=1 ./testrun.sh ./a.out
Aborted

we use stderr stream after it's been closed, which is undefined; it looks like
we really should check STDERR_FILENO before writing to it.

-- 
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]