From 48f6dd8a8ca53595c936686cdeb613b37bc181ab Mon Sep 17 00:00:00 2001 From: Attilio Rao Date: Sat, 7 Nov 2009 21:46:34 +0000 Subject: [PATCH] Use a safety belt for cases where corrupted narg can be passed to the ktrsyscall(). print_number() does decrement the number of arguments, leading to infinite loops for negative values. Reported by: Patrick Lamaiziere , Jonathan Pascal Submitted by: jh PR: bin/120055, kern/119564 MFC: 1 week --- usr.bin/kdump/kdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 3d8b93a6101..60ce05f4f2d 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -799,7 +799,7 @@ ktrsyscall(struct ktr_syscall *ktr) narg--; } } - while (narg) { + while (narg > 0) { print_number(ip,narg,c); } (void)putchar(')');