Merge pull request #239 from ewestbrook/namebuf57

Fix buffer size error in src/options.c detected by GCC 7
This commit is contained in:
Diego Nehab
2017-12-23 01:24:33 -02:00
committed by GitHub

View File

@@ -37,7 +37,7 @@ int opt_meth_setoption(lua_State *L, p_opt opt, p_socket ps)
while (opt->name && strcmp(name, opt->name)) while (opt->name && strcmp(name, opt->name))
opt++; opt++;
if (!opt->func) { if (!opt->func) {
char msg[45]; char msg[57];
sprintf(msg, "unsupported option `%.35s'", name); sprintf(msg, "unsupported option `%.35s'", name);
luaL_argerror(L, 2, msg); luaL_argerror(L, 2, msg);
} }
@@ -50,7 +50,7 @@ int opt_meth_getoption(lua_State *L, p_opt opt, p_socket ps)
while (opt->name && strcmp(name, opt->name)) while (opt->name && strcmp(name, opt->name))
opt++; opt++;
if (!opt->func) { if (!opt->func) {
char msg[45]; char msg[57];
sprintf(msg, "unsupported option `%.35s'", name); sprintf(msg, "unsupported option `%.35s'", name);
luaL_argerror(L, 2, msg); luaL_argerror(L, 2, msg);
} }