mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 05:18:47 +00:00
lib: Cap script_name length
Signed-off-by: Donald Lee <dlqs@gmx.com>
This commit is contained in:
parent
67b64027b2
commit
1763ed2655
@ -262,10 +262,15 @@ int frrscript_load(struct frrscript *fs, const char *function_name,
|
|||||||
|
|
||||||
frrlua_export_logging(L);
|
frrlua_export_logging(L);
|
||||||
|
|
||||||
char script_name[MAXPATHLEN * 2];
|
char script_name[MAXPATHLEN];
|
||||||
|
|
||||||
snprintf(script_name, sizeof(script_name), "%s/%s.lua", scriptdir,
|
if (snprintf(script_name, sizeof(script_name), "%s/%s.lua", scriptdir,
|
||||||
fs->name);
|
fs->name)
|
||||||
|
< 0) {
|
||||||
|
zlog_err("frrscript: path to script %s/%s.lua is too long",
|
||||||
|
scriptdir, fs->name);
|
||||||
|
goto fail;
|
||||||
|
}
|
||||||
int ret = luaL_dofile(L, script_name);
|
int ret = luaL_dofile(L, script_name);
|
||||||
|
|
||||||
switch (ret) {
|
switch (ret) {
|
||||||
|
Loading…
Reference in New Issue
Block a user