summaryrefslogtreecommitdiff
path: root/kerberosV
diff options
context:
space:
mode:
authorRay Lai <ray@cvs.openbsd.org>2006-11-02 18:10:41 +0000
committerRay Lai <ray@cvs.openbsd.org>2006-11-02 18:10:41 +0000
commit3a3be0f62b8184560d9c50c0a2b0c5cd0d6f0c43 (patch)
tree7ebcbd8a3502e2a62f4c768ea7e25d4d13052f0b /kerberosV
parent138ead7438fe72153bca849c30d8f09c94e7e301 (diff)
Report to syslog strings that start with NUL; prevents negative
index array access. OK moritz@.
Diffstat (limited to 'kerberosV')
-rw-r--r--kerberosV/src/appl/login/limits_conf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/kerberosV/src/appl/login/limits_conf.c b/kerberosV/src/appl/login/limits_conf.c
index 6e51f8959be..70fc42ba278 100644
--- a/kerberosV/src/appl/login/limits_conf.c
+++ b/kerberosV/src/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 */