svn commit: r275939 - stable/9/usr.sbin/syslogd

Andrey V. Elsukov ae at FreeBSD.org
Fri Dec 19 13:24:53 UTC 2014


Author: ae
Date: Fri Dec 19 13:24:52 2014
New Revision: 275939
URL: https://svnweb.freebsd.org/changeset/base/275939

Log:
  MFC r275729:
    Increase the buffer size to keep the list of programm names when
    parsing programm specification. It is safe to not check out of bounds
    access, because !isprint(p[i]) check will stop reading, when '\0'
    character will be read from the input string.
  
  Sponsored by:	Yandex LLC

Modified:
  stable/9/usr.sbin/syslogd/syslogd.c
Directory Properties:
  stable/9/usr.sbin/syslogd/   (props changed)

Modified: stable/9/usr.sbin/syslogd/syslogd.c
==============================================================================
--- stable/9/usr.sbin/syslogd/syslogd.c	Fri Dec 19 13:22:02 2014	(r275938)
+++ stable/9/usr.sbin/syslogd/syslogd.c	Fri Dec 19 13:24:52 2014	(r275939)
@@ -1539,7 +1539,7 @@ init(int signo)
 	struct filed *f, *next, **nextp;
 	char *p;
 	char cline[LINE_MAX];
- 	char prog[NAME_MAX+1];
+ 	char prog[LINE_MAX];
 	char host[MAXHOSTNAMELEN];
 	char oldLocalHostName[MAXHOSTNAMELEN];
 	char hostMsg[2*MAXHOSTNAMELEN+40];
@@ -1661,7 +1661,7 @@ init(int signo)
 				(void)strlcpy(prog, "*", sizeof(prog));
 				continue;
 			}
-			for (i = 0; i < NAME_MAX; i++) {
+			for (i = 0; i < LINE_MAX - 1; i++) {
 				if (!isprint(p[i]) || isspace(p[i]))
 					break;
 				prog[i] = p[i];


More information about the svn-src-stable-9 mailing list