fdisk against my USB flash drive crashes with divide by zero.  It turns
out that get_params() starts with some default values (since there is
no disklabel) and then runs some ioctls: DIOCGFWSECTORS and DIOCGFWHEADS.

The problem is that fdisk checks the error from that ioctl and then
happily uses whatever parameters it returned.  My question is, should I
add the error checking in userland (error == 0 && sector != 0) or in
g_dev_ioctl?  IMO, it should be in g_dev_ioctl so that we only have to
validate the data in one place instead of multiple utilities (fdisk,
disklabel, ...?)

-Nate


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-current" in the body of the message

Reply via email to