summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShengzhe Zhao <a18689@motorola.com>2009-08-08 00:53:06 +0800
committerSan Mehat <san@google.com>2009-08-07 08:12:50 -0700
commitea128a499ca81c7ca92751b7a4e8f6405c4b6322 (patch)
treef3ca2b19c7fe9791bca879313ad7f64787b337d1
parent6702a4436d04b4fbe1be2f11ce5c1cd9ce64574c (diff)
downloadandroid_external_fsck_msdos-ea128a499ca81c7ca92751b7a4e8f6405c4b6322.tar.gz
android_external_fsck_msdos-ea128a499ca81c7ca92751b7a4e8f6405c4b6322.tar.bz2
android_external_fsck_msdos-ea128a499ca81c7ca92751b7a4e8f6405c4b6322.zip
fix the issue that variable lfcl in dir.c get enormous value.
Signed-off-by: Shengzhe Zhao <a18689@motorola.com> Signed-off-by: San Mehat <san@google.com>
-rw-r--r--dir.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/dir.c b/dir.c
index b2f090e..5837463 100644
--- a/dir.c
+++ b/dir.c
@@ -935,6 +935,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