Date: Sun, 17 Jul 2011 21:08:16 +0000 (UTC) From: Ryan Stone <rstone@FreeBSD.org> To: cvs-src-old@freebsd.org Subject: cvs commit: src/sbin/fdisk fdisk.c Message-ID: <201107172108.p6HL8R1O094512@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
rstone 2011-07-17 21:08:16 UTC
FreeBSD src repository
Modified files:
sbin/fdisk fdisk.c
Log:
SVN rev 224150 on 2011-07-17 21:08:16Z by rstone
The MBR uses a 32-bit unsigned integer to store the size of a slice, but
fdisk(1) internally uses a signed int. Should a user attempt to specify
a slice containing more than 2^31 - 1 sectors, an error will be reported
on systems with sizeof(long) == 4 and the slice size will be silently
truncated on systems with sizeof(long) > 4.
Instead use an unsigned long to store the slice size in fdisk(1). This
allows the user to specify a slice size up to the maximum permitted by
the MBR on-disk format and does not have any problems with silent
truncation should the use specify an slice size larger than 2^32 on systems
with sizeof(long) > 4.
Submitted by: Mark Johnston (markjdb AT gmail DOT com)
MFC after: 2 weeks
Revision Changes Path
1.101 +4 -4 src/sbin/fdisk/fdisk.c
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201107172108.p6HL8R1O094512>
