Commit 95642a10 by Michael Santos Committed by Daniel Lezcano

conf: increase buffer size to include spaces

parent 6d10f1fc
...@@ -205,14 +205,18 @@ static int run_script(const char *name, const char *section, ...@@ -205,14 +205,18 @@ static int run_script(const char *name, const char *section,
va_start(ap, script); va_start(ap, script);
while ((p = va_arg(ap, char *))) while ((p = va_arg(ap, char *)))
size += strlen(p); size += strlen(p) + 1;
va_end(ap); va_end(ap);
size += strlen(script); size += strlen(script);
size += strlen(name); size += strlen(name);
size += strlen(section); size += strlen(section);
size += 3;
buffer = alloca(size + 1); if (size > INT_MAX)
return -1;
buffer = alloca(size);
if (!buffer) { if (!buffer) {
ERROR("failed to allocate memory"); ERROR("failed to allocate memory");
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment