This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
NULL guards for string functions
- From: "Karsten Fleischer" <K dot Fleischer at omnium dot de>
- To: <newlib at sources dot redhat dot com>
- Date: Sun, 17 Aug 2003 03:06:12 +0200
- Subject: NULL guards for string functions
- Organization: Omnium Software Engineering
Hi,
I noticed that the newlib string functions are not guarded against NULL
pointers and will cause coredumps if NULL arguments are passed.
Some cygwin kernel functions call newlib string functions without
checking for NULL args before (for example: mount() calls strpbrk();
mount(0,0,0) will crash).
I believe that C89/C99 standards do not impose a NULL check, but since
these functions are used in a kernel-like environment, I think they
ought to do.
Karsten