Author: delphij
Date: Tue Jan 14 06:28:07 2020
New Revision: 356722
URL: https://svnweb.freebsd.org/changeset/base/356722

Log:
  MFC r356628: Require FAT to occupy at least one sector.

Modified:
  stable/12/sbin/fsck_msdosfs/boot.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/sbin/fsck_msdosfs/boot.c
==============================================================================
--- stable/12/sbin/fsck_msdosfs/boot.c  Tue Jan 14 06:15:41 2020        
(r356721)
+++ stable/12/sbin/fsck_msdosfs/boot.c  Tue Jan 14 06:28:07 2020        
(r356722)
@@ -253,7 +253,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-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to