Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/powerpc/powerpc Add a range check for the DCR addre...



details:   https://anonhg.NetBSD.org/src/rev/5a068789f69c
branches:  trunk
changeset: 540591:5a068789f69c
user:      scw <scw%NetBSD.org@localhost>
date:      Thu Dec 19 13:45:03 2002 +0000

description:
Add a range check for the DCR address in db_ppc4xx_dcr().

diffstat:

 sys/arch/powerpc/powerpc/db_interface.c |  5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diffs (19 lines):

diff -r fd7dae3debc7 -r 5a068789f69c sys/arch/powerpc/powerpc/db_interface.c
--- a/sys/arch/powerpc/powerpc/db_interface.c   Thu Dec 19 13:29:53 2002 +0000
+++ b/sys/arch/powerpc/powerpc/db_interface.c   Thu Dec 19 13:45:03 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: db_interface.c,v 1.22 2002/12/19 13:29:53 scw Exp $ */
+/*     $NetBSD: db_interface.c,v 1.23 2002/12/19 13:45:03 scw Exp $ */
 /*     $OpenBSD: db_interface.c,v 1.2 1996/12/28 06:21:50 rahnds Exp $ */
 
 #define USERACC
@@ -339,6 +339,9 @@
        db_expr_t new_value;
        db_expr_t addr;
 
+       if (address < 0 || address > 0x3ff)
+               db_error("Invalid DCR address (Valid range is 0x0 - 0x3ff)\n");
+
        addr = address;
 
        while (db_expression(&new_value)) {



Home | Main Index | Thread Index | Old Index