summaryrefslogtreecommitdiffstats
path: root/sys/sparc64
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2003-04-30 17:59:27 +0000
committerjhb <jhb@FreeBSD.org>2003-04-30 17:59:27 +0000
commit09adcd8b3eb9c21fbc4881b6dcc76de2ac5e2e86 (patch)
tree794ed311be7ea465256f3579da3310fcd612e9f1 /sys/sparc64
parent5cf2683aab33151f21c4c06f9c3c1ac882d034a3 (diff)
downloadFreeBSD-src-09adcd8b3eb9c21fbc4881b6dcc76de2ac5e2e86.zip
FreeBSD-src-09adcd8b3eb9c21fbc4881b6dcc76de2ac5e2e86.tar.gz
Range check the syscall number before looking it up in the syscallnames[]
array. Submitted by: pho
Diffstat (limited to 'sys/sparc64')
-rw-r--r--sys/sparc64/sparc64/trap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/sparc64/sparc64/trap.c b/sys/sparc64/sparc64/trap.c
index c64eb65..357c7ac 100644
--- a/sys/sparc64/sparc64/trap.c
+++ b/sys/sparc64/sparc64/trap.c
@@ -624,7 +624,7 @@ syscall(struct trapframe *tf)
cred_free_thread(td);
#endif
WITNESS_WARN(WARN_PANIC, NULL, "System call %s returning",
- syscallnames[code]);
+ (code >= 0 && code < SYS_MAXSYSCALL) ? syscallnames[code] : "???");
mtx_assert(&sched_lock, MA_NOTOWNED);
mtx_assert(&Giant, MA_NOTOWNED);
}
OpenPOWER on IntegriCloud