loader: dosfs fails to access directory data with large cluster number

fsize is using 2 bytes for cluster number, but with fat32 we
actually do have 4 bytes and with large disks the high bytes will be in use.

illumos issue: https://www.illumos.org/issues/16821

Sponsored by:	MNX Cloud, Inc.
MFC after:	1 week
This commit is contained in:
Toomas Soome 2024-10-03 14:54:11 +03:00
parent 65074f6f31
commit 79a0d14fa0

View File

@ -815,7 +815,7 @@ fsize(DOS_FS *fs, DOS_DE *de)
int n;
if (!(size = cv4(de->size)) && de->attr & FA_DIR) {
if (!(c = cv2(de->clus))) {
if (!(c = stclus(fs->fatsz, de))) {
size = fs->dirents * sizeof(DOS_DE);
} else {
if ((n = fatcnt(fs, c)) == -1)