summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2004-03-31 18:48:16 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2004-03-31 18:48:16 +0000
commit467d5fce5c192326332ef5b64abb25f42cc89af1 (patch)
tree75f88750f36eedda0ba14050137ff60a68eedbef
parent55a37907c27b261971808311001d4b45317209d7 (diff)
Fix false positives when comparing long file names that have the
same first 13 (or some multiple thereof) characters. Fix was verified by reporter (Kong Long); from NetBSD
-rw-r--r--sys/msdosfs/msdosfs_conv.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/msdosfs/msdosfs_conv.c b/sys/msdosfs/msdosfs_conv.c
index 5883eeb58c5..dda90835f00 100644
--- a/sys/msdosfs/msdosfs_conv.c
+++ b/sys/msdosfs/msdosfs_conv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msdosfs_conv.c,v 1.10 2003/07/29 19:26:38 mickey Exp $ */
+/* $OpenBSD: msdosfs_conv.c,v 1.11 2004/03/31 18:48:15 millert Exp $ */
/* $NetBSD: msdosfs_conv.c,v 1.24 1997/10/17 11:23:54 ws Exp $ */
/*-
@@ -654,6 +654,9 @@ winChkName(un, unlen, wep, chksum)
if ((unlen -= i) <= 0)
return -1;
un += i;
+
+ if ((wep->weCnt&WIN_LAST) && unlen > WIN_CHARS)
+ return -1;
/*
* Compare the name parts