From b19b7e0b86f7c05b599171d1d9c0009c92886f94 Mon Sep 17 00:00:00 2001 From: Joey Schulze Date: Wed, 25 Jun 1997 13:23:45 +0000 Subject: [PATCH] Minor fixes. --- klogd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/klogd.c b/klogd.c index 81f25e4..f7763f0 100644 --- a/klogd.c +++ b/klogd.c @@ -154,7 +154,7 @@ * Added the -i and -I command line switches to signal the currently * executing daemon. * - * Tue Nov 19 10:15:36 PST 1996: Lee Olds + * Tue Nov 19 10:15:36 PST 1996: Leland Olds * Corrected vulnerability to buffer overruns by rewriting LogLine * routine. Obscenely long kernel messages will now be broken up * into lines no longer than LOG_LINE_LENGTH. @@ -614,10 +614,12 @@ static void LogLine(char *ptr, int len) ptr += delta; space -= delta; len -= delta; + if( space == 0 || len == 0 ) { break; /* full line_buff or end of input buffer */ } + if( *ptr == '\n' ) /* newline */ { *line++ = *ptr++; /* copy it in */