-/* $OpenBSD: trap.c,v 1.109 2023/12/12 15:30:55 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.110 2023/12/13 15:57:22 miod Exp $ */
/* $NetBSD: trap.c,v 1.52 2000/05/24 16:48:33 thorpej Exp $ */
/*-
opc = framep->tf_regs[FRAME_PC] - 4;
// XXX out of range stays on syscall0, which we assume is enosys
- if (code >= 0 || code <= SYS_MAXSYSCALL)
+ if (code > 0 && code < SYS_MAXSYSCALL)
callp += code;
nargs = callp->sy_narg;
-/* $OpenBSD: syscall.c,v 1.27 2023/12/12 15:30:55 deraadt Exp $ */
+/* $OpenBSD: syscall.c,v 1.28 2023/12/13 15:57:22 miod Exp $ */
/* $NetBSD: syscall.c,v 1.24 2003/11/14 19:03:17 scw Exp $ */
/*-
code = frame->tf_r12;
// XXX out of range stays on syscall0, which we assume is enosys
- if (code >= 0 || code <= SYS_MAXSYSCALL)
+ if (code > 0 && code < SYS_MAXSYSCALL)
callp += code;
nargs = callp->sy_argsize / sizeof(register_t);
-/* $OpenBSD: syscall.c,v 1.16 2023/12/12 23:43:35 deraadt Exp $ */
+/* $OpenBSD: syscall.c,v 1.17 2023/12/13 15:57:22 miod Exp $ */
/*
* Copyright (c) 2015 Dale Rahn <drahn@dalerahn.com>
*
ap = &frame->tf_x[0];
- if (code < 0 || code >= SYS_MAXSYSCALL)
+ if (code <= 0 || code >= SYS_MAXSYSCALL)
goto bad;
callp = sysent + code;
-/* $OpenBSD: trap.c,v 1.163 2023/12/13 11:20:18 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.164 2023/12/13 15:57:22 miod Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
args[3] = frame->tf_arg3;
// XXX out of range stays on syscall0, which we assume is enosys
- if (code >= 0 || code <= SYS_MAXSYSCALL)
+ if (code > 0 && code < SYS_MAXSYSCALL)
callp += code;
if ((argsize = callp->sy_argsize)) {
-/* $OpenBSD: trap.c,v 1.163 2023/12/12 15:30:55 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.164 2023/12/13 15:57:22 miod Exp $ */
/* $NetBSD: trap.c,v 1.95 1996/05/05 06:50:02 mycroft Exp $ */
/*-
code = frame->tf_eax;
// XXX out of range stays on syscall0, which we assume is enosys
- if (code >= 0 || code <= SYS_MAXSYSCALL)
+ if (code > 0 && code < SYS_MAXSYSCALL)
callp += code;
argsize = callp->sy_argsize;
-/* $OpenBSD: trap.c,v 1.129 2023/12/12 15:30:56 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.130 2023/12/13 15:57:22 miod Exp $ */
/*
* Copyright (c) 2004, Miodrag Vallat.
* Copyright (c) 1998 Steve Murphree, Jr.
nap = 8; /* r2-r9 */
// XXX out of range stays on syscall0, which we assume is enosys
- if (code >= 0 || code <= SYS_MAXSYSCALL)
+ if (code > 0 && code < SYS_MAXSYSCALL)
callp += code;
i = callp->sy_argsize / sizeof(register_t);
nap = 8; /* r2-r9 */
// XXX out of range stays on syscall0, which we assume is enosys
- if (code >= 0 || code <= SYS_MAXSYSCALL)
+ if (code > 0 && code < SYS_MAXSYSCALL)
callp += code;
i = callp->sy_argsize / sizeof(register_t);
-/* $OpenBSD: trap.c,v 1.169 2023/12/13 02:31:15 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.170 2023/12/13 15:57:22 miod Exp $ */
/*
* Copyright (c) 1988 University of Utah.
code = locr0->v0;
// XXX out of range stays on syscall0, which we assume is enosys
- if (code >= 0 || code <= SYS_MAXSYSCALL)
+ if (code > 0 && code < SYS_MAXSYSCALL)
callp += code;
numarg = callp->sy_narg;
-/* $OpenBSD: trap.c,v 1.132 2023/12/12 15:30:56 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.133 2023/12/13 15:57:22 miod Exp $ */
/* $NetBSD: trap.c,v 1.3 1996/10/13 03:31:37 christos Exp $ */
/*
code = frame->fixreg[0];
// XXX out of range stays on syscall0, which we assume is enosys
- if (code >= 0 || code <= SYS_MAXSYSCALL)
+ if (code > 0 && code < SYS_MAXSYSCALL)
callp += code;
argsize = callp->sy_argsize;
-/* $OpenBSD: syscall.c,v 1.12 2023/12/12 15:30:56 deraadt Exp $ */
+/* $OpenBSD: syscall.c,v 1.13 2023/12/13 15:57:22 miod Exp $ */
/*
* Copyright (c) 2015 Dale Rahn <drahn@dalerahn.com>
code = frame->fixreg[0];
// XXX out of range stays on syscall0, which we assume is enosys
- if (code >= 0 || code <= SYS_MAXSYSCALL)
+ if (code > 0 && code < SYS_MAXSYSCALL)
callp += code;
nargs = callp->sy_argsize / sizeof(register_t);
-/* $OpenBSD: syscall.c,v 1.17 2023/12/12 15:30:56 deraadt Exp $ */
+/* $OpenBSD: syscall.c,v 1.18 2023/12/13 15:57:22 miod Exp $ */
/*
* Copyright (c) 2020 Brian Bamsch <bbamsch@google.com>
code = frame->tf_t[0];
// XXX out of range stays on syscall0, which we assume is enosys
- if (code >= 0 || code <= SYS_MAXSYSCALL)
+ if (code > 0 && code < SYS_MAXSYSCALL)
callp += code;
nargs = callp->sy_argsize / sizeof(register_t);
-/* $OpenBSD: trap.c,v 1.56 2023/12/13 12:41:31 miod Exp $ */
+/* $OpenBSD: trap.c,v 1.57 2023/12/13 15:57:22 miod Exp $ */
/* $NetBSD: exception.c,v 1.32 2006/09/04 23:57:52 uwe Exp $ */
/* $NetBSD: syscall.c,v 1.6 2006/03/07 07:21:50 thorpej Exp $ */
code = tf->tf_r0;
// XXX out of range stays on syscall0, which we assume is enosys
- if (code >= 0 || code <= SYS_MAXSYSCALL)
+ if (code > 0 && code < SYS_MAXSYSCALL)
callp += code;
argsize = callp->sy_argsize;
-/* $OpenBSD: trap.c,v 1.117 2023/12/12 23:43:35 deraadt Exp $ */
+/* $OpenBSD: trap.c,v 1.118 2023/12/13 15:57:22 miod Exp $ */
/* $NetBSD: trap.c,v 1.73 2001/08/09 01:03:01 eeh Exp $ */
/*
ap = &tf->tf_out[0];
nap = 6;
- if (code < 0 || code >= SYS_MAXSYSCALL)
+ if (code <= 0 || code >= SYS_MAXSYSCALL)
goto bad;
callp = sysent + code;
i = callp->sy_narg; /* Why divide? */