[PATCH] fdisk: Backport disk check from util-linux

Denys Vlasenko vda.linux at googlemail.com
Mon May 2 00:49:22 UTC 2011


On Sunday 01 May 2011 19:20, Lauri Kasanen wrote:
> Hi Denys
> 
> +       if (len != 0 && isdigit(disk[len - 1]))
> 
> There's no need to check for len being 0 here, because:
> 
> sprintf(devname, "/dev/%s", ptname);
> 
> The string passed always contains at least 5 chars ("/dev/").

It is a bit too subtle. I prefer more paranoid code here.
-- 
vda


More information about the busybox mailing list