[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: kdeutils/klaptopdaemon [POSSIBLY UNSAFE]
From:       Oswald Buddenhagen <ossi () kde ! org>
Date:       2002-12-06 15:21:42
[Download RAW message or body]

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.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic