Hi,
On Tue, 2004-03-02 at 14:24, Szakacsits Szabolcs wrote:
> As people started to use and report issues with volumes over a terrabyte,
> I'm creating some test cases.
>
> The first try immediately segfaulted:
>
> touch ntfs.img
> mkntfs -FQ -c 512 ntfs.img 3000000000
>
> Problem is integer overflow at:
>
> 2783: for (i = opts.nr_clusters; i < lcn_bitmap_byte_size << 3; i++)
> 2784: ntfs_bit_set(lcn_bitmap, (u64)i, 1);
>
> i and lcn_bitmap_byte_size are int, nr_clusters is long long. However
> there is a comment in the source on nr_clusters, "Note: Win2k treats
> clusters as 32-bit entities!"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/ntfs.asp
Look at the bottom of that page.
Of course we really shouldn't segfault, we should be checking for
maximum supported size and aborting gracefully...
Best regards,
Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ &
http://www-stu.christs.cam.ac.uk/~aia21/
|