Date: Fri, 12 Dec 2014 11:29:55 +0000 (UTC) From: "Andrey V. Elsukov" <ae@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r275729 - head/usr.sbin/syslogd Message-ID: <201412121129.sBCBTtgv096361@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: ae Date: Fri Dec 12 11:29:54 2014 New Revision: 275729 URL: https://svnweb.freebsd.org/changeset/base/275729 Log: 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. Obtained from: Yandex LLC MFC after: 1 week Sponsored by: Yandex LLC Modified: head/usr.sbin/syslogd/syslogd.c Modified: head/usr.sbin/syslogd/syslogd.c ============================================================================== --- head/usr.sbin/syslogd/syslogd.c Fri Dec 12 11:19:10 2014 (r275728) +++ head/usr.sbin/syslogd/syslogd.c Fri Dec 12 11:29:54 2014 (r275729) @@ -1542,7 +1542,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]; @@ -1664,7 +1664,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];
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201412121129.sBCBTtgv096361>