Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/usr.bin/mkdep Don't touch before the mmap'ed region.
details: https://anonhg.NetBSD.org/src/rev/6af80edb6346
branches: trunk
changeset: 765578:6af80edb6346
user: enami <enami%NetBSD.org@localhost>
date: Tue May 31 02:34:32 2011 +0000
description:
Don't touch before the mmap'ed region.
diffstat:
usr.bin/mkdep/mkdep.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diffs (27 lines):
diff -r 6bb07da89318 -r 6af80edb6346 usr.bin/mkdep/mkdep.c
--- a/usr.bin/mkdep/mkdep.c Tue May 31 00:15:28 2011 +0000
+++ b/usr.bin/mkdep/mkdep.c Tue May 31 02:34:32 2011 +0000
@@ -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;
Home |
Main Index |
Thread Index |
Old Index