Skip to content

Commit

Permalink
loader: dosfs fails to access directory data with large cluster number
Browse files Browse the repository at this point in the history
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.

(cherry picked from commit 79a0d14)
  • Loading branch information
Toomas Soome authored and Toomas Soome committed Oct 10, 2024
1 parent 66ce3c8 commit c66f901
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion stand/libsa/dosfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -816,7 +816,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)
Expand Down

0 comments on commit c66f901

Please sign in to comment.