From a09b9865cc2228bda05a642f0cc6e8ecd53fce75 Mon Sep 17 00:00:00 2001 From: Joey Schulze Date: Tue, 4 May 2004 14:52:56 +0000 Subject: [PATCH] Adjust the size of a variable to prevent a buffer overflow should _PATH_DEV ever contain something different than "/dev/". --- syslogd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/syslogd.c b/syslogd.c index 715df9d..16fd8d9 100644 --- a/syslogd.c +++ b/syslogd.c @@ -458,6 +458,10 @@ static char sccsid[] = "@(#)syslogd.c 5.27 (Berkeley) 10/10/88"; * Ensure that "len" is not placed in a register, and that the * endtty() signal handler is not installed too early which could * cause a segmentation fault or worse. + * + * Tue May 4 16:52:01 CEST 2004: Solar Designer + * Adjust the size of a variable to prevent a buffer overflow + * should _PATH_DEV ever contain something different than "/dev/". */ @@ -1902,7 +1906,7 @@ void wallmsg(f, iov) register struct filed *f; struct iovec *iov; { - char p[6 + UNAMESZ]; + char p[sizeof (_PATH_DEV) + UNAMESZ]; register int i; int ttyf, len; static int reenter = 0;