diff --git a/java_tools/ConfigDefinition.jar b/java_tools/ConfigDefinition.jar index 9717ffe621..0834a690e5 100644 Binary files a/java_tools/ConfigDefinition.jar and b/java_tools/ConfigDefinition.jar differ diff --git a/java_tools/configuration_definition/src/com/rusefi/ConfigDefinition.java b/java_tools/configuration_definition/src/com/rusefi/ConfigDefinition.java index 58a45d160d..63d7a6071c 100644 --- a/java_tools/configuration_definition/src/com/rusefi/ConfigDefinition.java +++ b/java_tools/configuration_definition/src/com/rusefi/ConfigDefinition.java @@ -593,18 +593,17 @@ public class ConfigDefinition { private static long getCrc32(String fileName) throws IOException { File file = new File(fileName); - byte[] f1 = Files.readAllBytes(file.toPath()); + byte[] fileContent = Files.readAllBytes(file.toPath()); + for (int i = 0; i < fileContent.length; i++) { + byte aByte = fileContent[i]; + if (aByte == '\r') + throw new IllegalStateException("CR \\r 0x0D byte not allowed in cacheable content " + fileName + " at index=" + i); + } CRC32 c = new CRC32(); - c.update(f1, 0, f1.length); + c.update(fileContent, 0, fileContent.length); return c.getValue(); } - private static void deleteFile(String fileName) throws IOException { - File file = new File(fileName); - // todo: validate? - file.delete(); - } - private static byte[] unzipFileContents(String zipFileName, String fileName) throws IOException { ZipInputStream zis = new ZipInputStream(new FileInputStream(zipFileName)); ZipEntry zipEntry;