diff options
author | 1999-11-14 02:39:06 +0000 | |
---|---|---|
committer | 1999-11-14 02:39:06 +0000 | |
commit | 0f30dd78d4eceb5372d4431772979c18a0177465 (patch) | |
tree | daa590adb77f8ea2e8c693fd710f39858ff122db | |
parent | fix pmap_create() so it works for user mappings. (diff) | |
download | wireguard-openbsd-0f30dd78d4eceb5372d4431772979c18a0177465.tar.xz wireguard-openbsd-0f30dd78d4eceb5372d4431772979c18a0177465.zip |
protect against copuin faults
-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)]; |