Glibc and strlcpy
Posted Dec 18, 2004 5:53 UTC (Sat) by
ncm (subscriber, #165)
In reply to:
Students uncover dozens of Unix software flaws (News.com) by pjdc
Parent article:
Students uncover dozens of Unix software flaws (News.com)
Ulrich is right, as far as he goes.
However, by not providing bindings for functions with those
names, he encourages sloppy programmers porting programs that
call them to grab the BSD implementation and add it in.
If Glibc were to implement strlcpy etc. but, instead of
returning a value to be checked, simply log an error
and call abort(), then the bugs would have attention called
to them. They could not just silently fail no matter how
sloppily coded. Of course, sloppy code shouldn't be run at
all (there are a lot more ways to fail than strcpy!). A
program that is always aborting is less likely to be run.
Problem solved.
(
Log in to post comments)