]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libfdisk: (dos) Fix upper bound cylinder check in check()
authorPali Rohár <pali.rohar@gmail.com>
Tue, 6 Jul 2021 16:26:52 +0000 (18:26 +0200)
committerPali Rohár <pali.rohar@gmail.com>
Thu, 15 Jul 2021 19:49:30 +0000 (21:49 +0200)
commitc0a0e567d84b5fb6cffb58c72c5d40191f30d441
treeb95d1cb637ea3d7f7a59117b4e2ef02777e6396a
parented5a0f331bd825b9613445fdf2032b6af8ef7949
libfdisk: (dos) Fix upper bound cylinder check in check()

To check if LBA sector can be represented in CHS without overflow it is
required to check for cylinder value which belongs to the LBA sector. And
not the total number of disk cylinders. Note that maximal representable
total number of disk cylinders is 1024 and therefore the last cylinder
which which can be stored in CHS tuple is 1023. Hence strict inequality is
used.

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
libfdisk/src/dos.c