Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Nov 2017 08:28:17 +0000 (UTC)
From:      Xin LI <delphij@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r326391 - head/sbin/fsck_msdosfs
Message-ID:  <201711300828.vAU8SHRb085065@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Thu Nov 30 08:28:17 2017
New Revision: 326391
URL: https://svnweb.freebsd.org/changeset/base/326391

Log:
  Prevent OOB access on corrupted msdos directories.
  
  Submitted by:	Veo Zhang <veo live com>
  MFC after:	2 weeks

Modified:
  head/sbin/fsck_msdosfs/dir.c

Modified: head/sbin/fsck_msdosfs/dir.c
==============================================================================
--- head/sbin/fsck_msdosfs/dir.c	Thu Nov 30 08:28:04 2017	(r326390)
+++ head/sbin/fsck_msdosfs/dir.c	Thu Nov 30 08:28:17 2017	(r326391)
@@ -621,7 +621,7 @@ readDosDirSection(int f, struct bootblock *boot, struc
 			dirent.name[8] = '\0';
 			for (k = 7; k >= 0 && dirent.name[k] == ' '; k--)
 				dirent.name[k] = '\0';
-			if (dirent.name[k] != '\0')
+			if (k < 0 || dirent.name[k] != '\0')
 				k++;
 			if (dirent.name[0] == SLOT_E5)
 				dirent.name[0] = 0xe5;



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