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 <patpr at davenulle dot org>,
		Jonathan Pascal <jkpyvxmzsa at mailinator dot com>
Submitted by:	jh
PR:		bin/120055, kern/119564
MFC:		1 week
This commit is contained in:
Attilio Rao 2009-11-07 21:46:34 +00:00
parent 152f5570db
commit 48f6dd8a8c

View file

@ -799,7 +799,7 @@ ktrsyscall(struct ktr_syscall *ktr)
narg--;
}
}
while (narg) {
while (narg > 0) {
print_number(ip,narg,c);
}
(void)putchar(')');