From kde-commits Fri Dec 06 15:21:42 2002 From: Oswald Buddenhagen Date: Fri, 06 Dec 2002 15:21:42 +0000 To: kde-commits Subject: Re: kdeutils/klaptopdaemon [POSSIBLY UNSAFE] X-MARC-Message: https://marc.info/?l=kde-commits&m=103918812712812 On Fri, Dec 06, 2002 at 04:12:16PM +0100, Lubos Lunak wrote: > but %s in scanf() without a size limit is simply baaaaad. > yeah, the kernel could be attempting to crack your box. :)))) > f = fopen("/proc/apm", "r"); > + s = fscanf(f, "%255s %d.%d %x %x %x %x %d%% %d %s\n", seriously, if you can prove that it's poinless to add additional safety, then don't bother to make the code less readable. maybe add a comment. greetings -- Hi! I'm a .signature virus! Copy me into your ~/.signature, please! -- Chaos, panic, and disorder - my work here is done.