Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/evbppc/mpc85xx Fix some array bounds errors found b...
details: https://anonhg.NetBSD.org/src/rev/e718d85b09b6
branches: trunk
changeset: 766750:e718d85b09b6
user: matt <matt%NetBSD.org@localhost>
date: Fri Jul 01 07:44:33 2011 +0000
description:
Fix some array bounds errors found by gcc 4.5
diffstat:
sys/arch/evbppc/mpc85xx/machdep.c | 8 +++++---
1 files changed, 5 insertions(+), 3 deletions(-)
diffs (28 lines):
diff -r fb618d7a6a9e -r e718d85b09b6 sys/arch/evbppc/mpc85xx/machdep.c
--- a/sys/arch/evbppc/mpc85xx/machdep.c Fri Jul 01 06:00:20 2011 +0000
+++ b/sys/arch/evbppc/mpc85xx/machdep.c Fri Jul 01 07:44:33 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: machdep.c,v 1.15 2011/06/30 00:52:56 matt Exp $ */
+/* $NetBSD: machdep.c,v 1.16 2011/07/01 07:44:33 matt Exp $ */
/*-
* Copyright (c) 2010, 2011 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -480,14 +480,16 @@
}
}
mr = physmemr;
- for (u_int i = 0; i < cnt; i++, mr++) {
+ for (u_int i = 0; i + 1 < cnt; i++, mr++) {
if (mr->start + mr->size == mr[1].start) {
mr->size += mr[1].size;
- for (u_int j = 1; j < cnt - i; j++)
+ for (u_int j = 1; i + j + 1 < cnt; j++)
mr[j] = mr[j+1];
cnt--;
}
}
+ } else {
+ panic("%s: no memory found", __func__);
}
/*
Home |
Main Index |
Thread Index |
Old Index