From f2bd808b86148a714ffe0630a0d48caea8ddde90 Mon Sep 17 00:00:00 2001 From: Philippe Pepiot Date: Sat, 25 Dec 2010 16:25:42 +0100 Subject: [PATCH] Fix segfault in parser if options == PARSE_MAX_LIST-1 Reported by Armael Increase PARSE_MAX_LIST from 10 to 32 --- src/parse.c | 2 +- src/parse.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parse.c b/src/parse.c index be1641f..f649dac 100644 --- a/src/parse.c +++ b/src/parse.c @@ -436,7 +436,7 @@ get_option(struct keyword **head) while (kw && kw->type != LIST_END) { switch (kw->type) { case WORD: - if (j > (PARSE_MAX_LIST - 1)) { + if (j >= (PARSE_MAX_LIST - 1)) { syntax(kw, "too much values in list"); return free_opt(o); } diff --git a/src/parse.h b/src/parse.h index f38185c..dfdedd7 100644 --- a/src/parse.h +++ b/src/parse.h @@ -21,7 +21,7 @@ #include #define INCLUDE_CMD "@include" -#define PARSE_MAX_LIST 10 +#define PARSE_MAX_LIST 32 #if defined(Bool) #define bool_t Bool