From 63579afa990308aeba31fb5797d9c43f1c7a5a0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 4 Dec 2006 23:27:08 +0000 Subject: [PATCH] =?UTF-8?q?Report=20to=20syslog=20strings=20that=20start?= =?UTF-8?q?=20with=20NUL;=20prevents=20negative=20index=20array=20access.?= =?UTF-8?q?=20Ray=20Lai=20of=20OpenBSD=20via=20Bj=C3=B6rn=20Sandell.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19212 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/login/limits_conf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/appl/login/limits_conf.c b/appl/login/limits_conf.c index 5bbcb5798..afa8539c4 100644 --- a/appl/login/limits_conf.c +++ b/appl/login/limits_conf.c @@ -120,6 +120,10 @@ read_limits_conf(const char *file, const struct passwd *pwd) lineno++; + if(buf[0] == '\0') { + syslog(LOG_ERR, "%s: line %d: NUL character", file, lineno); + continue; + } if(buf[strlen(buf) - 1] != '\n') { /* file did not end with a newline, figure out if we're at the EOF, or if our buffer was too small */