SPIGOT-7906: Increase YAML nesting limit to 100

By: blablubbabc <lukas@wirsindwir.de>
This commit is contained in:
Bukkit/Spigot 2024-09-24 07:47:30 +10:00
parent afaa0a1d88
commit f73b5cbdb3

View file

@ -61,6 +61,7 @@ public class YamlConfiguration extends FileConfiguration {
yamlLoaderOptions = new LoaderOptions(); yamlLoaderOptions = new LoaderOptions();
yamlLoaderOptions.setMaxAliasesForCollections(Integer.MAX_VALUE); // SPIGOT-5881: Not ideal, but was default pre SnakeYAML 1.26 yamlLoaderOptions.setMaxAliasesForCollections(Integer.MAX_VALUE); // SPIGOT-5881: Not ideal, but was default pre SnakeYAML 1.26
yamlLoaderOptions.setCodePointLimit(Integer.MAX_VALUE); // SPIGOT-7161: Not ideal, but was default pre SnakeYAML 1.32 yamlLoaderOptions.setCodePointLimit(Integer.MAX_VALUE); // SPIGOT-7161: Not ideal, but was default pre SnakeYAML 1.32
yamlLoaderOptions.setNestingDepthLimit(100); // SPIGOT-7906: The default limit (50) can be easily reached with nested bundles
constructor = new YamlConstructor(yamlLoaderOptions); constructor = new YamlConstructor(yamlLoaderOptions);
representer = new YamlRepresenter(yamlDumperOptions); representer = new YamlRepresenter(yamlDumperOptions);