Author: delphij
Date: Sat Jan 11 03:59:06 2020
New Revision: 356628
URL: https://svnweb.freebsd.org/changeset/base/356628

Log:
  Require FAT to occupy at least one sector.
  
  Obtained from:        Android https://r.android.com/1205830
  MFC after:    3 days

Modified:
  head/sbin/fsck_msdosfs/boot.c

Modified: head/sbin/fsck_msdosfs/boot.c
==============================================================================
--- head/sbin/fsck_msdosfs/boot.c       Sat Jan 11 03:18:47 2020        
(r356627)
+++ head/sbin/fsck_msdosfs/boot.c       Sat Jan 11 03:59:06 2020        
(r356628)
@@ -250,7 +250,7 @@ readboot(int dosfs, struct bootblock *boot)
                boot->FATsecs = boot->bpbFATsmall;
        }
 
-       if (boot->FATsecs > UINT32_MAX / boot->bpbFATs) {
+       if (boot->FATsecs < 1 || boot->FATsecs > UINT32_MAX / boot->bpbFATs) {
                pfatal("Invalid FATs(%u) with FATsecs(%zu)",
                        boot->bpbFATs, (size_t)boot->FATsecs);
                return FSFATAL;
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to