PR/53206: David Binderman: fix array bounds comparison in KASSERT.
This commit is contained in:
parent
b83c46adf8
commit
2370736b4d
@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
|
|
||||||
__RCSID("$NetBSD: db_machdep.c,v 1.1 2015/03/28 16:13:56 matt Exp $");
|
__RCSID("$NetBSD: db_machdep.c,v 1.2 2018/04/23 15:40:33 christos Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ int
|
|||||||
db_rw_ddbreg(const struct db_variable *vp, db_expr_t *valp, int rw)
|
db_rw_ddbreg(const struct db_variable *vp, db_expr_t *valp, int rw)
|
||||||
{
|
{
|
||||||
struct trapframe * const tf = curcpu()->ci_ddb_regs;
|
struct trapframe * const tf = curcpu()->ci_ddb_regs;
|
||||||
KASSERT(db_regs <= vp && vp < db_regs);
|
KASSERT(db_regs <= vp && vp < db_regs + __arraycount(db_regs));
|
||||||
const uintptr_t addr = (uintptr_t)tf + (uintptr_t)vp->valuep;
|
const uintptr_t addr = (uintptr_t)tf + (uintptr_t)vp->valuep;
|
||||||
if (vp->modif != NULL && vp->modif[0] == 'i') {
|
if (vp->modif != NULL && vp->modif[0] == 'i') {
|
||||||
if (rw == DB_VAR_GET) {
|
if (rw == DB_VAR_GET) {
|
||||||
|
Loading…
Reference in New Issue
Block a user