Calling strcmp/strncmp/strcasecmp/strncasecmp with NULL parameter

Steven Keuchel steven.keuchel@freenet.de
Wed Aug 18 07:46:00 GMT 2004


On Tuesday 17 August 2004 21:16, you wrote:
> [Steven Keuchel]
> > What does the C Standard say about this ?
> 
> I suggest you have a look at
> <URL:http://www.opengroup.org/onlinepubs/009695399/toc.htm>, and
> discover that the standard consider it undefined behaviour to call for
> example strcmp() with illegal arguments.  The code calling strcmp()
> like this is broken, and need to be fixed.
> 

Well changing the code isn't so easy because i came accross this when 
debugging a third party library. The manpages do not say anything that 
calling these functions with illegal arguments will result in undefined 
behaviour. Maybe you can add it.



More information about the Libc-alpha mailing list