summaryrefslogtreecommitdiff
path: root/usr.bin/kdump
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-09-10 21:06:22 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-09-10 21:06:22 +0000
commit4e7887f21722d2cd7fb9a0aa14ec37da747c1ec3 (patch)
treede2f7701c507b8278b0a76530ae91f855be75e3e /usr.bin/kdump
parent72f68a25aaf951be91c54a1e39169b88a4b9eac2 (diff)
for sysctl records, do not expect more than CTL_MAXNAME additional
"faked" arguments; ok uwe espie
Diffstat (limited to 'usr.bin/kdump')
-rw-r--r--usr.bin/kdump/kdump.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c
index 87a9f48fb14..b430b023656 100644
--- a/usr.bin/kdump/kdump.c
+++ b/usr.bin/kdump/kdump.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kdump.c,v 1.27 2005/06/02 17:32:02 mickey Exp $ */
+/* $OpenBSD: kdump.c,v 1.28 2005/09/10 21:06:21 deraadt Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -39,7 +39,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95";
#endif
-static char *rcsid = "$OpenBSD: kdump.c,v 1.27 2005/06/02 17:32:02 mickey Exp $";
+static char *rcsid = "$OpenBSD: kdump.c,v 1.28 2005/09/10 21:06:21 deraadt Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -48,6 +48,7 @@ static char *rcsid = "$OpenBSD: kdump.c,v 1.27 2005/06/02 17:32:02 mickey Exp $"
#include <sys/ktrace.h>
#include <sys/ioctl.h>
#include <sys/ptrace.h>
+#include <sys/sysctl.h>
#define _KERNEL
#include <sys/errno.h>
#undef _KERNEL
@@ -383,6 +384,8 @@ ktrsyscall(struct ktr_syscall *ktr)
int *np, n;
n = ap[1];
+ if (n > CTL_MAXNAME)
+ n = CTL_MAXNAME;
np = (int *)(ap + 6);
for (; n--; np++) {
if (c)