This is the mail archive of the
glibc-bugs@sources.redhat.com
mailing list for the glibc project.
[Bug libc/323] missing NULL pointer check in s(n)printf
- From: "jakub at redhat dot com" <sourceware-bugzilla at sources dot redhat dot com>
- To: glibc-bugs at sources dot redhat dot com
- Date: 13 Aug 2004 12:14:44 -0000
- Subject: [Bug libc/323] missing NULL pointer check in s(n)printf
- References: <20040813120753.323.g.tenchio@telco-tech.de>
- Reply-to: sourceware-bugzilla at sources dot redhat dot com
------- Additional Comments From jakub at redhat dot com 2004-08-13 12:14 -------
No, it is not necessary. ISO C99 says the first argument of sprintf is an array,
not just any pointer. NULL pointer is not a valid array, so this is undefined
behaviour. So segfaulting is completely valid behaviour for this.
If you call strlen (NULL), it will segfault the same.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |INVALID
http://sources.redhat.com/bugzilla/show_bug.cgi?id=323
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.