Source-Changes-HG archive

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

[src/trunk]: src/sys/rump/librump/rumpvfs Make sure node lengths match in add...



details:   https://anonhg.NetBSD.org/src/rev/7fbc4ada74cc
branches:  trunk
changeset: 749585:7fbc4ada74cc
user:      pooka <pooka%NetBSD.org@localhost>
date:      Thu Dec 03 12:54:30 2009 +0000

description:
Make sure node lengths match in addition to strncmp().
(I thought i fixed this already once?)

diffstat:

 sys/rump/librump/rumpvfs/rumpfs.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (30 lines):

diff -r e219948539f0 -r 7fbc4ada74cc sys/rump/librump/rumpvfs/rumpfs.c
--- a/sys/rump/librump/rumpvfs/rumpfs.c Thu Dec 03 12:52:42 2009 +0000
+++ b/sys/rump/librump/rumpvfs/rumpfs.c Thu Dec 03 12:54:30 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpfs.c,v 1.35 2009/12/03 12:35:35 pooka Exp $        */
+/*     $NetBSD: rumpfs.c,v 1.36 2009/12/03 12:54:30 pooka Exp $        */
 
 /*
  * Copyright (c) 2009  Antti Kantee.  All Rights Reserved.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.35 2009/12/03 12:35:35 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rumpfs.c,v 1.36 2009/12/03 12:54:30 pooka Exp $");
 
 #include <sys/param.h>
 #include <sys/atomic.h>
@@ -458,8 +458,9 @@
 
        if (!rd) {
                LIST_FOREACH(rd, &rnd->rn_dir, rd_entries) {
-                       if (strncmp(rd->rd_name, cnp->cn_nameptr,
-                           cnp->cn_namelen) == 0)
+                       if (strlen(rd->rd_name) == cnp->cn_namelen &&
+                           strncmp(rd->rd_name, cnp->cn_nameptr,
+                             cnp->cn_namelen) == 0)
                                break;
                }
        }



Home | Main Index | Thread Index | Old Index