svn commit: r326842 - stable/11/sbin/fsck_msdosfs
Xin LI
delphij at FreeBSD.org
Thu Dec 14 07:52:39 UTC 2017
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;
More information about the svn-src-stable
mailing list