[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug-inetutils] [PATCH] syslogd: Fix possible memory corruption whil
From: |
Alfred M. Szmidt |
Subject: |
Re: [bug-inetutils] [PATCH] syslogd: Fix possible memory corruption while reading configuration file. |
Date: |
Wed, 01 Apr 2015 17:37:54 -0400 |
diff --git a/src/syslogd.c b/src/syslogd.c
index c1280e9..dd99dda 100644
--- a/src/syslogd.c
+++ b/src/syslogd.c
@@ -1989,7 +1989,7 @@ load_conffile (const char *filename, struct filed
**nextp)
if (*p == '\0' || *p == '#')
continue;
- strcpy (cline, p);
+ bcopy (p, cline, strlen (p) + 1);
Thanks! I'll read the bug report tomorrow -- I think there is more
than catches the eye. Leading whitespace before the selector is not
valid syntax for syslog.conf AFAIR.
Also, bcopy was marked deprecated in POSIX 2001, and removed in 2008;
memcpy is always prefered. And in this case, strncpy would be more
apt.