"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
(cherry picked from commit
77a88943d6a0d7852c25a03541d60ccf44aa5c6d)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit
ad6e9c5e4f1d815dbac0861458c4f228ca2d4a01)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit
2a1dcc1b1c93075d477d13ec2cc271fa826fbc9e)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
{
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) {