This is the mail archive of the glibc-bugs@sources.redhat.com 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/323] missing NULL pointer check in s(n)printf


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


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