summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--servconf.c8
2 files changed, 9 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 9104217ad..2dafce311 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,9 @@
9 by shipping a config that overrides the current UsePrivilegeSeparation=yes 9 by shipping a config that overrides the current UsePrivilegeSeparation=yes
10 default. Make it easier to flip the default in the future by adding too. 10 default. Make it easier to flip the default in the future by adding too.
11 prodded markus@ feedback dtucker@ "get it in" deraadt@ 11 prodded markus@ feedback dtucker@ "get it in" deraadt@
12 - dtucker@cvs.openbsd.org 2012/07/13 01:35:21
13 [servconf.c]
14 handle long comments in config files better. bz#2025, ok markus
12 15
1320120720 1620120720
14 - (dtucker) Import regened moduli file. 17 - (dtucker) Import regened moduli file.
diff --git a/servconf.c b/servconf.c
index 427bdeef1..ee2e531a0 100644
--- a/servconf.c
+++ b/servconf.c
@@ -1,5 +1,5 @@
1 1
2/* $OpenBSD: servconf.c,v 1.228 2012/07/10 02:19:15 djm Exp $ */ 2/* $OpenBSD: servconf.c,v 1.229 2012/07/13 01:35:21 dtucker Exp $ */
3/* 3/*
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
5 * All rights reserved 5 * All rights reserved
@@ -1526,8 +1526,9 @@ process_server_config_line(ServerOptions *options, char *line,
1526void 1526void
1527load_server_config(const char *filename, Buffer *conf) 1527load_server_config(const char *filename, Buffer *conf)
1528{ 1528{
1529 char line[1024], *cp; 1529 char line[4096], *cp;
1530 FILE *f; 1530 FILE *f;
1531 int lineno = 0;
1531 1532
1532 debug2("%s: filename %s", __func__, filename); 1533 debug2("%s: filename %s", __func__, filename);
1533 if ((f = fopen(filename, "r")) == NULL) { 1534 if ((f = fopen(filename, "r")) == NULL) {
@@ -1536,6 +1537,9 @@ load_server_config(const char *filename, Buffer *conf)
1536 } 1537 }
1537 buffer_clear(conf); 1538 buffer_clear(conf);
1538 while (fgets(line, sizeof(line), f)) { 1539 while (fgets(line, sizeof(line), f)) {
1540 lineno++;
1541 if (strlen(line) == sizeof(line) - 1)
1542 fatal("%s line %d too long", filename, lineno);
1539 /* 1543 /*
1540 * Trim out comments and strip whitespace 1544 * Trim out comments and strip whitespace
1541 * NB - preserve newlines, they are needed to reproduce 1545 * NB - preserve newlines, they are needed to reproduce