diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2004-07-01 02:04:11 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2004-07-01 02:04:11 +0000 |
commit | 5dcb030c453a6d5de627386ae801d7ed0938fa68 (patch) | |
tree | 83a1b177a181770bdaf08e809d891ae281e2273c /lib/libkvm/kvm_i386.c | |
parent | 30467686092d2f6864a54f35ce9b0523d59b4458 (diff) |
if sym has null value -- report as not found; check that kd->vmst is set before use; millert@ ok
Diffstat (limited to 'lib/libkvm/kvm_i386.c')
-rw-r--r-- | lib/libkvm/kvm_i386.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/libkvm/kvm_i386.c b/lib/libkvm/kvm_i386.c index 758f1265f29..5e5be968c7a 100644 --- a/lib/libkvm/kvm_i386.c +++ b/lib/libkvm/kvm_i386.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kvm_i386.c,v 1.12 2004/06/15 03:52:59 deraadt Exp $ */ +/* $OpenBSD: kvm_i386.c,v 1.13 2004/07/01 02:04:10 mickey Exp $ */ /* $NetBSD: kvm_i386.c,v 1.9 1996/03/18 22:33:38 thorpej Exp $ */ /*- @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)kvm_hp300.c 8.1 (Berkeley) 6/4/93"; #else -static char *rcsid = "$OpenBSD: kvm_i386.c,v 1.12 2004/06/15 03:52:59 deraadt Exp $"; +static char *rcsid = "$OpenBSD: kvm_i386.c,v 1.13 2004/07/01 02:04:10 mickey Exp $"; #endif #endif /* LIBC_SCCS and not lint */ @@ -133,6 +133,11 @@ _kvm_kvatop(kvm_t *kd, u_long va, u_long *pa) struct vmstate *vm; pt_entry_t pte; + if (!kd->vmst) { + _kvm_err(kd, 0, "vatop called before initvtop"); + return (0); + } + if (ISALIVE(kd)) { _kvm_err(kd, 0, "vatop called in live kernel!"); return (0); |