fdisk - Use heads = 255 on file images
authorMatthew Dillon <dillon@apollo.backplane.com>
Tue, 15 Sep 2009 00:54:11 +0000 (17:54 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Tue, 15 Sep 2009 00:54:11 +0000 (17:54 -0700)
commit8155d6763dd54122ebad3d46f4dcad0501fd7139
tree5aad83f7a4872c9129971c41e424d31ef6ae2405
parent702a95cc5a96bcc8b869d9c49c8c2b61292b94cd
fdisk - Use heads = 255 on file images

When operating on a file image use max values for sectors and heads in
order to match the case where the file might exceed the CHS limit.  By
convention the CHS fields are set to all 1's in this case.

If our sectors and heads are not set at max values then the all 1's case
will result in a geometry that overflows the originally specified sectors
and heads which can brick the BIOS.
sbin/fdisk/fdisk.c