Skip to content

Commit 89bc6b1

Browse files
authored
Fix uninitialized memory issue where get_alias is never initialized to nullptr, therefore causing a configuration error (#312)
1 parent ebce7f8 commit 89bc6b1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

runtime/src/require.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static int load(lua_State* L, void* ctx, const char* path, const char* chunkname
213213
luaL_sandboxthread(ML);
214214

215215
RequireCtx* reqCtx = static_cast<RequireCtx*>(ctx);
216-
std::optional<std::string> contents = getFileContents(reqCtx->currentVFSType, std::string(loadname), "");;
216+
std::optional<std::string> contents = getFileContents(reqCtx->currentVFSType, std::string(loadname), "");
217217
if (!contents)
218218
luaL_error(L, "could not read file '%s'", loadname);
219219

@@ -279,4 +279,5 @@ void requireConfigInit(luarequire_Configuration* config)
279279
config->get_cache_key = get_cache_key;
280280
config->get_config = get_config;
281281
config->load = load;
282+
config->get_alias = nullptr;
282283
}

0 commit comments

Comments
 (0)