public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/11571] New: getlogin_r (NULL, 0) segfaults
@ 2010-05-05 16:01 rjones at redhat dot com
  2010-05-05 16:03 ` [Bug libc/11571] " rjones at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: rjones at redhat dot com @ 2010-05-05 16:01 UTC (permalink / raw)
  To: glibc-bugs

#include <unistd.h>

main ()
{
  getlogin_r (NULL, 0);
}
----
$ gcc -g test.c -o test
$ ./test 
Segmentation fault (core dumped)
----

This seems to be a regression in glibc 2.12, since glibc 2.11.90
did not segfault under these conditions.

The stack trace is:

Program received signal SIGSEGV, Segmentation fault.
__strncpy_sse2 (s1=0x0, s2=0x7fffffffdee1 "jones", n=18446744073709551615)
    at ./strncpy.c:43
43		  *++s1 = c;
(gdb) bt
#0  __strncpy_sse2 (s1=0x0, s2=0x7fffffffdee1 "jones", n=18446744073709551615)
    at ./strncpy.c:43
#1  0x00007ffff7b071d2 in __getlogin_r_loginuid (name=0x0, namesize=0)
    at ../sysdeps/unix/sysv/linux/getlogin_r.c:84
#2  0x00007ffff7b07299 in getlogin_r (name=0x0, namesize=0)
    at ../sysdeps/unix/sysv/linux/getlogin_r.c:103
#3  0x00000000004004d7 in main () at test.c:5

-- 
           Summary: getlogin_r (NULL, 0) segfaults
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: rjones at redhat dot com
                CC: glibc-bugs at sources dot redhat dot com


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

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <bug-11571-131@http.sourceware.org/bugzilla/>]

end of thread, other threads:[~2014-06-30 18:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-05 16:01 [Bug libc/11571] New: getlogin_r (NULL, 0) segfaults rjones at redhat dot com
2010-05-05 16:03 ` [Bug libc/11571] " rjones at redhat dot com
2010-05-05 16:09 ` rjones at redhat dot com
2010-05-05 16:45 ` drepper at redhat dot com
     [not found] <bug-11571-131@http.sourceware.org/bugzilla/>
2014-06-30 18:07 ` fweimer at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).