public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/9857] New: sprintf gives SIGSEGV
@ 2009-02-17 13:06 alx_me at mail dot ru
2009-02-17 13:28 ` [Bug libc/9857] " jakub at redhat dot com
2009-02-17 14:06 ` schwab at suse dot de
0 siblings, 2 replies; 3+ messages in thread
From: alx_me at mail dot ru @ 2009-02-17 13:06 UTC (permalink / raw)
To: glibc-bugs
char n[100];
char *p=0;
sprintf(n,"%s",p);
gives SIGSEGV in glibc 2.6.1 and 2.9
in opposite:
snprintf in such case gives "(NULL)" as expected
sprintf in glibc 2.3.6 and 2.2.3 gives "(NULL)" correctly
--
Summary: sprintf gives SIGSEGV
Product: glibc
Version: 2.8
Status: NEW
Severity: critical
Priority: P2
Component: libc
AssignedTo: drepper at redhat dot com
ReportedBy: alx_me at mail dot ru
CC: glibc-bugs at sources dot redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=9857
------- 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] 3+ messages in thread
* [Bug libc/9857] sprintf gives SIGSEGV
2009-02-17 13:06 [Bug libc/9857] New: sprintf gives SIGSEGV alx_me at mail dot ru
@ 2009-02-17 13:28 ` jakub at redhat dot com
2009-02-17 14:06 ` schwab at suse dot de
1 sibling, 0 replies; 3+ messages in thread
From: jakub at redhat dot com @ 2009-02-17 13:28 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From jakub at redhat dot com 2009-02-17 13:28 -------
Correctly is wrong word, as this is clearly undefined behavior, %s argument is
supposed to be a pointer to the initial element of an array of character type,
which NULL is not. And it actually has nothing to do with glibc, because it is
GCC that optimizes the sprintf call into strcpy.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
http://sourceware.org/bugzilla/show_bug.cgi?id=9857
------- 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] 3+ messages in thread
* [Bug libc/9857] sprintf gives SIGSEGV
2009-02-17 13:06 [Bug libc/9857] New: sprintf gives SIGSEGV alx_me at mail dot ru
2009-02-17 13:28 ` [Bug libc/9857] " jakub at redhat dot com
@ 2009-02-17 14:06 ` schwab at suse dot de
1 sibling, 0 replies; 3+ messages in thread
From: schwab at suse dot de @ 2009-02-17 14:06 UTC (permalink / raw)
To: glibc-bugs
------- Additional Comments From schwab at suse dot de 2009-02-17 14:05 -------
*** Bug 9858 has been marked as a duplicate of this bug. ***
--
http://sourceware.org/bugzilla/show_bug.cgi?id=9857
------- 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] 3+ messages in thread
end of thread, other threads:[~2009-02-17 14:06 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-02-17 13:06 [Bug libc/9857] New: sprintf gives SIGSEGV alx_me at mail dot ru
2009-02-17 13:28 ` [Bug libc/9857] " jakub at redhat dot com
2009-02-17 14:06 ` schwab at suse dot de
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).