Date: Thu, 17 Dec 1998 15:02:50 -0800 From: Don Lewis <Don.Lewis@tsc.tdk.com> To: Eivind Eklund <eivind@yes.no>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/lib/libc/gen getpwent.c Message-ID: <199812172302.PAA08353@salsa.gv.tsc.tdk.com> In-Reply-To: Eivind Eklund <eivind@yes.no> "Re: cvs commit: src/lib/libc/gen getpwent.c" (Dec 17, 5:54pm)
next in thread | previous in thread | raw e-mail | index | archive | help
On Dec 17, 5:54pm, Eivind Eklund wrote: } Subject: Re: cvs commit: src/lib/libc/gen getpwent.c } This illustrate a point I have made repeatedly, both on Bugtraq and in } various *BSD-lists: Truncation is usually wrong. If you are on an } error path, look for some way to get a correct error return instead of } truncating. In this case, it was trivial. In some cases it isn't } (but remember - abort() is a usable error return, too), and truncation } is the only option - but don't reach for it as your first tool. This is one of my pet peeves as well. I worry that just globally substituting snprintf and friends will turn a reliable segmentation fault into a root exploit because of silent truncation. If you start seeing core files around, then at least you know that someone might be knocking on the door ... To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199812172302.PAA08353>