This is the mail archive of the newlib@sources.redhat.com mailing list for the newlib 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]

NULL guards for string functions


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


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