summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-05-29 08:49:37 -0700
committerandroid code review <noreply-gerritcodereview@google.com>2012-05-29 08:49:37 -0700
commited86a9f77e796aa5923a5b2d1455a7739b86e60b (patch)
tree816978ab1a5455edfc896935c5569c4682977f6e
parentf717a6ed5b25287fa9417096f90e7c047ace0c15 (diff)
parent6c29bbe8d58e6fe8755935a04166ecf82ff31f47 (diff)
downloadandroid_external_fsck_msdos-ed86a9f77e796aa5923a5b2d1455a7739b86e60b.tar.gz
android_external_fsck_msdos-ed86a9f77e796aa5923a5b2d1455a7739b86e60b.tar.bz2
android_external_fsck_msdos-ed86a9f77e796aa5923a5b2d1455a7739b86e60b.zip
Merge "Detect and handle invalid number of FATs"
-rw-r--r--boot.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/boot.c b/boot.c
index 6e797fd..52bf011 100644
--- a/boot.c
+++ b/boot.c
@@ -205,6 +205,10 @@ readboot(dosfs, boot)
pfatal("Invalid sector size: %u", boot->BytesPerSec);
return FSFATAL;
}
+ if (boot->FATs == 0) {
+ pfatal("Invalid number of FATs: %u", boot->FATs);
+ return FSFATAL;
+ }
if (boot->Sectors) {
boot->HugeSectors = 0;
boot->NumSectors = boot->Sectors;