Module Name: src Committed By: pooka Date: Thu Dec 3 12:54:30 UTC 2009
Modified Files: src/sys/rump/librump/rumpvfs: rumpfs.c Log Message: Make sure node lengths match in addition to strncmp(). (I thought i fixed this already once?) To generate a diff of this commit: cvs rdiff -u -r1.35 -r1.36 src/sys/rump/librump/rumpvfs/rumpfs.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/rump/librump/rumpvfs/rumpfs.c diff -u src/sys/rump/librump/rumpvfs/rumpfs.c:1.35 src/sys/rump/librump/rumpvfs/rumpfs.c:1.36 --- src/sys/rump/librump/rumpvfs/rumpfs.c:1.35 Thu Dec 3 12:35:35 2009 +++ src/sys/rump/librump/rumpvfs/rumpfs.c Thu Dec 3 12:54:30 2009 @@ -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; } }