Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jul 2018 05:40:03 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r336755 - stable/11/sbin/fsck_msdosfs
Message-ID:  <201807270540.w6R5e37o018258@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Fri Jul 27 05:40:03 2018
New Revision: 336755
URL: https://svnweb.freebsd.org/changeset/base/336755

Log:
  MFC r336236: Detect and handle invalid number of FATs.

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

Modified: stable/11/sbin/fsck_msdosfs/boot.c
==============================================================================
--- stable/11/sbin/fsck_msdosfs/boot.c	Fri Jul 27 05:21:20 2018	(r336754)
+++ stable/11/sbin/fsck_msdosfs/boot.c	Fri Jul 27 05:40:03 2018	(r336755)
@@ -87,6 +87,10 @@ readboot(int dosfs, struct bootblock *boot)
 		pfatal("Invalid sector size: %u", boot->bpbBytesPerSec);
 		return FSFATAL;
 	}
+	if (boot->bpbFATs == 0) {
+		pfatal("Invalid number of FATs: %u", boot->bpbFATs);
+		return FSFATAL;
+	}
 	if (!boot->bpbRootDirEnts)
 		boot->flags |= FAT32;
 	if (boot->flags & FAT32) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807270540.w6R5e37o018258>