Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/fs/msdosfs Fix false positives when comparing long file ...



details:   https://anonhg.NetBSD.org/src/rev/7544811cc4d9
branches:  trunk
changeset: 816324:7544811cc4d9
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Thu Jun 30 09:34:01 2016 +0000

description:
Fix false positives when comparing long file names that have the
same first 13 (or some multiple thereof) characters.

diffstat:

 sys/fs/msdosfs/msdosfs_conv.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r 531a08630814 -r 7544811cc4d9 sys/fs/msdosfs/msdosfs_conv.c
--- a/sys/fs/msdosfs/msdosfs_conv.c     Thu Jun 30 09:14:30 2016 +0000
+++ b/sys/fs/msdosfs/msdosfs_conv.c     Thu Jun 30 09:34:01 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_conv.c,v 1.16 2016/03/06 07:33:25 mlelstv Exp $        */
+/*     $NetBSD: msdosfs_conv.c,v 1.17 2016/06/30 09:34:01 nonaka Exp $ */
 
 /*-
  * Copyright (C) 1995, 1997 Wolfgang Solfrank.
@@ -58,7 +58,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_conv.c,v 1.16 2016/03/06 07:33:25 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_conv.c,v 1.17 2016/06/30 09:34:01 nonaka Exp $");
 
 /*
  * System include files.
@@ -621,6 +621,8 @@
 
        if (i >= len + 1)
                return -1;
+       if ((wep->weCnt & WIN_LAST) && (len - i > WIN_CHARS))
+               return -1;
 
        /*
         * Fetch name segment from directory entry



Home | Main Index | Thread Index | Old Index