fix(items): guard oversized manifest NPE in FurnidataReader + document JSON5 trailing-comma limit

This commit is contained in:
simoleo89
2026-06-04 20:54:13 +02:00
parent 86498b6b4c
commit b162b3f4d8
2 changed files with 21 additions and 2 deletions
@@ -55,6 +55,17 @@ class FurnidataReaderTest {
});
}
@Test
void oversizedManifestIsSkippedNeverThrows(@TempDir Path dir) throws Exception {
Path base = dir.resolve("furnidata");
Path core = base.resolve("core");
Files.createDirectories(core);
// A root manifest larger than the cap we pass in.
Files.writeString(base.resolve("manifest.json"), "{ \"tiers\": [ \"core\" ] } // padding ".repeat(50));
List<FurnidataEntry> entries = new FurnidataReader(base, 8 /* bytes */).read();
assertTrue(entries.isEmpty());
}
@Test
void splitDirRejectsTraversalFiles(@TempDir Path dir) throws Exception {
Path secret = dir.resolve("secret.json");