소스 검색

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>

Jaroslav Skarvada 13 년 전
부모
커밋
4a8f8a6645
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/fat.c

+ 1 - 1
src/fat.c

@@ -474,7 +474,7 @@ void reclaim_file(DOS_FS * fs)
 	    DIR_ENT de;
 	    loff_t offset;
 	    files++;
-	    offset = alloc_rootdir_entry(fs, &de, "FSCK%04dREC");
+	    offset = alloc_rootdir_entry(fs, &de, "FSCK%04d");
 	    de.start = CT_LE_W(i & 0xffff);
 	    if (fs->fat_bits == 32)
 		de.starthi = CT_LE_W(i >> 16);