diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 1999-11-14 02:39:07 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 1999-11-14 02:39:07 +0000 |
commit | 515ff93344f651fac15365bdf61bfbda7ebb6b21 (patch) | |
tree | 48f2714e298f6345f2fa03917a0fab0c6db68d63 /sys | |
parent | 1fae17a616fe919f830414345839a297baa0bb68 (diff) |
protect against copuin faults
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/hppa/hppa/db_disasm.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/arch/hppa/hppa/db_disasm.c b/sys/arch/hppa/hppa/db_disasm.c index e37073132c0..a2988b98c7e 100644 --- a/sys/arch/hppa/hppa/db_disasm.c +++ b/sys/arch/hppa/hppa/db_disasm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: db_disasm.c,v 1.5 1999/11/02 05:50:37 mickey Exp $ */ +/* $OpenBSD: db_disasm.c,v 1.6 1999/11/14 02:39:06 mickey Exp $ */ /* * Copyright (c) 1999 Michael Shalayeff @@ -2322,10 +2322,11 @@ db_disasm(loc, flag) iExInit(); - if (USERMODE(loc)) - copyin((caddr_t)(loc &~ HPPA_PC_PRIV_MASK), - &instruct, sizeof(instruct)); - else + if (USERMODE(loc)) { + if (copyin((caddr_t)(loc &~ HPPA_PC_PRIV_MASK), + &instruct, sizeof(instruct))) + instruct = 0; + } else instruct = *(int *)loc; m = &majopcs[Opcode(instruct)]; |