/apps/twnlua: catch self-include stack busting
This commit is contained in:
parent
80a4ae3d0e
commit
70fab28158
@ -25,6 +25,12 @@ void bindgen_upload_context(lua_State *L);
|
||||
static int physfs_loader(lua_State *L) {
|
||||
const char *name = luaL_checkstring(L, 1);
|
||||
|
||||
static const char *name_breaker = NULL;
|
||||
if (name_breaker && SDL_strcmp(name, name_breaker) == 0) {
|
||||
log_critical("Recursive load on itself from lua module (%s)", name_breaker);
|
||||
return 0;
|
||||
} name_breaker = name;
|
||||
|
||||
/* replace dots with path slashes */
|
||||
char *path_copy = SDL_strdup(name);
|
||||
char *ch = NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user