summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorJenkins2 <jenkins2@gerrit.asterisk.org>2018-03-05 08:32:35 -0600
committerGerrit Code Review <gerrit2@gerrit.digium.api>2018-03-05 08:32:35 -0600
commit3afc2c52af6ea1f223fd5caf8eb4abd67273f91e (patch)
treeee68077d4c94c5e4b09f2ea0410eabdd99f90525 /main
parentdebe4fe7518756c1dedc58a96fe37e00649763b7 (diff)
parenta7927471adc67daa7b335811ee640774904d5d3a (diff)
Merge "core: Fix handling of maximum length lines in config files."
Diffstat (limited to 'main')
-rw-r--r--main/config.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/main/config.c b/main/config.c
index 118b9586e..8107fce04 100644
--- a/main/config.c
+++ b/main/config.c
@@ -2195,10 +2195,10 @@ static struct ast_config *config_text_file_load(const char *database, const char
lineno++;
if (fgets(buf, sizeof(buf), f)) {
/* Skip lines that are too long */
- if (strlen(buf) == sizeof(buf) - 1 && buf[sizeof(buf) - 1] != '\n') {
+ if (strlen(buf) == sizeof(buf) - 1 && buf[sizeof(buf) - 2] != '\n') {
ast_log(LOG_WARNING, "Line %d too long, skipping. It begins with: %.32s...\n", lineno, buf);
while (fgets(buf, sizeof(buf), f)) {
- if (strlen(buf) != sizeof(buf) - 1 || buf[sizeof(buf) - 1] == '\n') {
+ if (strlen(buf) != sizeof(buf) - 1 || buf[sizeof(buf) - 2] == '\n') {
break;
}
}