Skip to content

Commit 7e94e1c

Browse files
author
Mike Pall
committed
Merge branch 'master' into v2.1
2 parents ff1e72a + 90e6551 commit 7e94e1c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/lib_package.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,12 @@ static const char *mksymname(lua_State *L, const char *modname,
237237

238238
static int ll_loadfunc(lua_State *L, const char *path, const char *name, int r)
239239
{
240-
void **reg = ll_register(L, path);
240+
void **reg;
241+
if (strlen(path) >= 4096) {
242+
lua_pushliteral(L, "path too long");
243+
return PACKAGE_ERR_LIB;
244+
}
245+
reg = ll_register(L, path);
241246
if (*reg == NULL) *reg = ll_load(L, path, (*name == '*'));
242247
if (*reg == NULL) {
243248
return PACKAGE_ERR_LIB; /* Unable to load library. */

0 commit comments

Comments
 (0)