Restore lfcl when LOSTDIR's chain was corrupted and overwritten

with invalid value.

Obtained from:	Android https://android.googlesource.com/platform/external/fsck_msdos/+/4d6d6f8a3674ad67f970e2ae908d34f64e4854cf%5E%21/
MFC after:	2 weeks
This commit is contained in:
Xin LI
2019-04-04 23:34:03 +00:00
parent fff4eaebbf
commit fbf8a5605f
+1
View File
@@ -973,6 +973,7 @@ reconnect(int dosfs, struct bootblock *boot, struct fatEntry *fat, cl_t head)
if (lfcl < CLUST_FIRST || lfcl >= boot->NumClusters) {
/* Extend LOSTDIR? XXX */
pwarn("No space in %s\n", LOSTDIR);
lfcl = (lostDir->head < boot->NumClusters) ? lostDir->head : 0;
return FSERROR;
}
lfoff = lfcl * boot->ClusterSize