fix(game): fix remote code execution from log4j.

This commit is contained in:
huanghongxun 2021-12-10 14:22:16 +08:00
parent c31269a358
commit 4b6b5c2f0e

View File

@ -440,6 +440,7 @@ public class DefaultLauncher extends Launcher {
private Map<String, String> getEnvVars() {
String versionName = Optional.ofNullable(options.getVersionName()).orElse(version.getId());
Map<String, String> env = new HashMap<>();
env.put("FORMAT_MESSAGES_PATTERN_DISABLE_LOOKUPS", "true");
env.put("INST_NAME", versionName);
env.put("INST_ID", versionName);
env.put("INST_DIR", repository.getVersionRoot(version.getId()).getAbsolutePath());