Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Dec 2017 07:52:38 +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: r326842 - stable/11/sbin/fsck_msdosfs
Message-ID:  <201712140752.vBE7qc0t044606@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: delphij
Date: Thu Dec 14 07:52:38 2017
New Revision: 326842
URL: https://svnweb.freebsd.org/changeset/base/326842

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

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

Modified: stable/11/sbin/fsck_msdosfs/dir.c
==============================================================================
--- stable/11/sbin/fsck_msdosfs/dir.c	Thu Dec 14 06:45:04 2017	(r326841)
+++ stable/11/sbin/fsck_msdosfs/dir.c	Thu Dec 14 07:52:38 2017	(r326842)
@@ -619,7 +619,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?201712140752.vBE7qc0t044606>