Module Name: src Committed By: enami Date: Tue May 31 02:34:32 UTC 2011
Modified Files: src/usr.bin/mkdep: mkdep.c Log Message: Don't touch before the mmap'ed region. To generate a diff of this commit: cvs rdiff -u -r1.37 -r1.38 src/usr.bin/mkdep/mkdep.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/mkdep/mkdep.c diff -u src/usr.bin/mkdep/mkdep.c:1.37 src/usr.bin/mkdep/mkdep.c:1.38 --- src/usr.bin/mkdep/mkdep.c:1.37 Mon May 30 22:52:12 2011 +++ src/usr.bin/mkdep/mkdep.c Tue May 31 02:34:32 2011 @@ -1,4 +1,4 @@ -/* $NetBSD: mkdep.c,v 1.37 2011/05/30 22:52:12 christos Exp $ */ +/* $NetBSD: mkdep.c,v 1.38 2011/05/31 02:34:32 enami Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -37,7 +37,7 @@ #if !defined(lint) __COPYRIGHT("@(#) Copyright (c) 1999 The NetBSD Foundation, Inc.\ All rights reserved."); -__RCSID("$NetBSD: mkdep.c,v 1.37 2011/05/30 22:52:12 christos Exp $"); +__RCSID("$NetBSD: mkdep.c,v 1.38 2011/05/31 02:34:32 enami Exp $"); #endif /* not lint */ #include <sys/mman.h> @@ -379,7 +379,7 @@ /* Then look for any valid suffix */ for (sl = suff_list; sl != NULL; sl = sl->next) { - if (sl->len && + if (sl->len && buf <= suf - sl->len && !memcmp(suf - sl->len, sl->suff, sl->len)) break;