From c10c20ac280cb802fbe3673cd51b61aecd8bc500 Mon Sep 17 00:00:00 2001 From: scw Date: Thu, 19 Dec 2002 13:45:03 +0000 Subject: [PATCH] Add a range check for the DCR address in db_ppc4xx_dcr(). --- sys/arch/powerpc/powerpc/db_interface.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/arch/powerpc/powerpc/db_interface.c b/sys/arch/powerpc/powerpc/db_interface.c index 7910624da7f9..573e0781367a 100644 --- a/sys/arch/powerpc/powerpc/db_interface.c +++ b/sys/arch/powerpc/powerpc/db_interface.c @@ -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_ppc4xx_dcr(db_expr_t address, int have_addr, db_expr_t count, char *modif) 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)) {