Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sbin/fsck_msdos



Module Name:    src
Committed By:   christos
Date:           Sat Jan 11 16:29:07 UTC 2020

Modified Files:
        src/sbin/fsck_msdos: boot.c

Log Message:
Don't add the 2 reserved clusters before we determine if we using fat16/fat32.
>From FreeBSD: https://reviews.freebsd.org/D23082:

Correct off-by-two issue when determining FAT type.

In the code we used NumClusters as the upper (non-inclusive) boundary
of valid cluster number, so the actual value was 2 (CLUST_FIRST) more
than the real number of clusters. This causes a FAT16 media with
65524 clusters be treated as FAT32 and might affect FAT12 media with
4084 clusters as well.

To fix this, we increment NumClusters by CLUST_FIRST after the type
determination.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sbin/fsck_msdos/boot.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index