mirror of
https://github.com/haproxy/haproxy.git
synced 2026-06-09 00:32:33 -04:00
BUG/MINOR: lua: lua-load doesn't check its parameters
"lua-load" doesn't check if the expected parameter is present. It tries to open() directly the argument at second position. So if the filename is omitted, it tries to load an empty filename. This patch could be backported until 1.8
This commit is contained in:
parent
de6145f747
commit
77a88943d6
1 changed files with 5 additions and 0 deletions
|
|
@ -7986,6 +7986,11 @@ static int hlua_load(char **args, int section_type, struct proxy *curpx,
|
|||
{
|
||||
int error;
|
||||
|
||||
if (*(args[1]) == 0) {
|
||||
memprintf(err, "'%s' expects a file name as parameter.\n", args[0]);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Just load and compile the file. */
|
||||
error = luaL_loadfile(gL.T, args[1]);
|
||||
if (error) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue