From 7a721a2672a95d047c30e3cf4045de680e682524 Mon Sep 17 00:00:00 2001 From: tron Date: Wed, 26 Apr 2000 16:05:37 +0000 Subject: [PATCH] Prevent "kdump" from causing a segmentation fault if the io buffer that it's printing to stdout ends on a page boundary. Patch supplied by Andrew Brown in PR bin/9983. --- usr.bin/kdump/kdump.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/usr.bin/kdump/kdump.c b/usr.bin/kdump/kdump.c index cba64bd1a382..50f940eb7097 100644 --- a/usr.bin/kdump/kdump.c +++ b/usr.bin/kdump/kdump.c @@ -1,4 +1,4 @@ -/* $NetBSD: kdump.c,v 1.28 2000/04/10 09:13:45 jdolecek Exp $ */ +/* $NetBSD: kdump.c,v 1.29 2000/04/26 16:05:37 tron Exp $ */ /*- * Copyright (c) 1988, 1993 @@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1993\n\ #if 0 static char sccsid[] = "@(#)kdump.c 8.4 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: kdump.c,v 1.28 2000/04/10 09:13:45 jdolecek Exp $"); +__RCSID("$NetBSD: kdump.c,v 1.29 2000/04/26 16:05:37 tron Exp $"); #endif #endif /* not lint */ @@ -470,7 +470,7 @@ ktrgenio(ktr, len) (void)printf(" \""); col = 8; for (; datalen > 0; datalen--, dp++) { - (void) vis(visbuf, *dp, VIS_CSTYLE, *(dp+1)); + (void) vis(visbuf, *dp, VIS_CSTYLE, datalen>1?*(dp+1):0); cp = visbuf; /* * Keep track of printables and