Source-Changes-HG archive

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

[src/trunk]: src/sys/fs/msdosfs don't treat adjacent members as a larger array



details:   https://anonhg.NetBSD.org/src/rev/12b90e334f2b
branches:  trunk
changeset: 325430:12b90e334f2b
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Tue Dec 24 16:51:24 2013 +0000

description:
don't treat adjacent members as a larger array
Coverity CID 977367

diffstat:

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

diffs (31 lines):

diff -r c1bdb48b0d92 -r 12b90e334f2b sys/fs/msdosfs/msdosfs_lookup.c
--- a/sys/fs/msdosfs/msdosfs_lookup.c   Tue Dec 24 16:01:07 2013 +0000
+++ b/sys/fs/msdosfs/msdosfs_lookup.c   Tue Dec 24 16:51:24 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msdosfs_lookup.c,v 1.29 2013/01/26 16:51:51 christos Exp $     */
+/*     $NetBSD: msdosfs_lookup.c,v 1.30 2013/12/24 16:51:24 mlelstv Exp $      */
 
 /*-
  * Copyright (C) 1994, 1995, 1997 Wolfgang Solfrank.
@@ -52,7 +52,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: msdosfs_lookup.c,v 1.29 2013/01/26 16:51:51 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: msdosfs_lookup.c,v 1.30 2013/12/24 16:51:24 mlelstv Exp $");
 
 #include <sys/param.h>
 
@@ -300,8 +300,10 @@
                                 * Check for a checksum or name match
                                 */
                                chksum_ok = (chksum == winChksum(dep->deName));
-                               if (!chksum_ok
-                                   && (!olddos || memcmp(dosfilename, dep->deName, 11))) {
+                               if (!chksum_ok && (
+                                       !olddos ||
+                                       memcmp(&dosfilename[0],dep->deName,8) ||
+                                       memcmp(&dosfilename[8],dep->deExtension,3))) {
                                        chksum = -1;
                                        continue;
                                }



Home | Main Index | Thread Index | Old Index