Fixing overflow bug in reclaim_file function, see
https://bugzilla.redhat.com/show_bug.cgi?id=660154 for more information. The problem is that alloc_rootdir_entry counts with 10000 files at max, but the filename buffer is only 8 chars long. Due to pattern mask used it results to only 10 files at max (FSCK0-9REC). If there is more than 10 files, it overflows and hangs. Signed-off-by: Daniel Baumann <mail@daniel-baumann.ch>
This commit is contained in:
parent
e0366dac97
commit
4a8f8a6645
@ -474,7 +474,7 @@ void reclaim_file(DOS_FS * fs)
|
|||||||
DIR_ENT de;
|
DIR_ENT de;
|
||||||
loff_t offset;
|
loff_t offset;
|
||||||
files++;
|
files++;
|
||||||
offset = alloc_rootdir_entry(fs, &de, "FSCK%04dREC");
|
offset = alloc_rootdir_entry(fs, &de, "FSCK%04d");
|
||||||
de.start = CT_LE_W(i & 0xffff);
|
de.start = CT_LE_W(i & 0xffff);
|
||||||
if (fs->fat_bits == 32)
|
if (fs->fat_bits == 32)
|
||||||
de.starthi = CT_LE_W(i >> 16);
|
de.starthi = CT_LE_W(i >> 16);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user