diff --git a/klogd.c b/klogd.c index 2c8e765..515a1ed 100644 --- a/klogd.c +++ b/klogd.c @@ -243,6 +243,9 @@ * people have submitted patches: Troels Walsted Hansen * , Wolfgang Oertl * and Thomas Roessler. + * Thu Apr 29 15:24:07 2004: Solar Designer + * Prevent potential buffer overflow in reading messages from the + * kernel log rinbuffer. */ @@ -938,7 +941,7 @@ static void LogKernelLine(void) * messages into this fresh buffer. */ memset(log_buffer, '\0', sizeof(log_buffer)); - if ( (rdcnt = ksyslog(2, log_buffer, sizeof(log_buffer))) < 0 ) + if ( (rdcnt = ksyslog(2, log_buffer, sizeof(log_buffer)-1)) < 0 ) { if ( errno == EINTR ) return;