mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 06:50:17 +00:00
lib: Prevent possible memory overwrite
fname is MAXPATHLEN and scriptdir and fs->name are less then MAXPATHLEN but the combination of those two + the `.lua` are greater than the MAXPATHLEN. Just give us more room to prevent a coding boo boo. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
8f17f6eb2d
commit
833c1f9fd1
@ -208,7 +208,7 @@ struct frrscript *frrscript_load(const char *name,
|
||||
fs->L = luaL_newstate();
|
||||
frrlua_export_logging(fs->L);
|
||||
|
||||
char fname[MAXPATHLEN];
|
||||
char fname[MAXPATHLEN * 2];
|
||||
snprintf(fname, sizeof(fname), "%s/%s.lua", scriptdir, fs->name);
|
||||
|
||||
int ret = luaL_loadfile(fs->L, fname);
|
||||
|
Loading…
Reference in New Issue
Block a user