diff options
Diffstat (limited to 'servconf.c')
-rw-r--r-- | servconf.c | 8 |
1 files changed, 6 insertions, 2 deletions
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, | |||
1526 | void | 1526 | void |
1527 | load_server_config(const char *filename, Buffer *conf) | 1527 | load_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 |