slachiewicz opened a new issue, #3620: URL: https://github.com/apache/maven-surefire/issues/3620
Affected version: master at d7c7e359e. `RunEntryStatisticsMap.fromStream` (surefire-api/src/main/java/org/apache/maven/surefire/api/runorder/RunEntryStatisticsMap.java:73-120) parses `.surefire-<checksum>` with a bare `Scanner`, `charAt(0)`, `indexOf`/`substring`, and `parseInt`. A blank line or a line missing its comma throws `StringIndexOutOfBoundsException`/`NumberFormatException` out of the plugin JVM instead of producing a clear diagnostic. The same class uses check-then-open on that file: `fromFile` does `exists()` then `new FileInputStream()` (lines 61-65), and `serialize` does `isFile()`, `delete()`, then `new FileOutputStream()` (lines 122-127). `StatisticsReporter.testSetCompleted` (maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/runorder/StatisticsReporter.java:49-55) calls `serialize` from the plugin JVM. Expected behavior: parse defensively and skip/quarantine malformed lines with a warning, and create/replace the statistics file with descriptor-relative, no-follow, atomic operations. The impact today is a failed build or reordered tests, not a privilege change, so this is a robustness/hardening request. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
