From: Matthew Dillon Date: Sat, 27 Sep 2008 20:29:52 +0000 (+0000) Subject: Do not loop forever if narg becomes negative. This can happen when asked X-Git-Tag: v2.1.1~317 X-Git-Url: https://gitweb.dragonflybsd.org/dragonfly.git/commitdiff_plain/48cbc3825fc39bde67fbed932d96203c562cf18e?ds=sidebyside Do not loop forever if narg becomes negative. This can happen when asked to kdump trace output created by emulated system calls. --- diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index 902c570af3..c6ad967a0e 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -33,7 +33,7 @@ * @(#) Copyright (c) 1988, 1993 The Regents of the University of California. All rights reserved. * @(#)kdump.c 8.1 (Berkeley) 6/6/93 * $FreeBSD: src/usr.bin/kdump/kdump.c,v 1.29 2006/05/20 14:27:22 netchild Exp $ - * $DragonFly: src/usr.bin/kdump/kdump.c,v 1.10 2008/01/07 01:35:43 corecode Exp $ + * $DragonFly: src/usr.bin/kdump/kdump.c,v 1.11 2008/09/27 20:29:52 dillon Exp $ */ #define _KERNEL_STRUCTURES @@ -648,7 +648,7 @@ ktrsyscall(register struct ktr_syscall *ktr) narg--; } } - while (narg) { + while (narg > 0) { print_number(ip,narg,c); } (void)putchar(')');