Skip to content

ctest_coverage: fix out-of-bounds index in Jacoco parser

Sylvain Joubert requested to merge sjoubert/cmake:jacoco_parser_crash into master

When the current source file is not found the FilePath variable was left with the previous path content. In case the previous file had less lines than the current one and there are 'line' entries for the current one with higher number we ended up in a buffer overflow while indexing the previous file entry with a line number higher. By clearing the FilePath, the empty() guard triggers correctly on an empty path and it avoid modifying the wrong data.

Edited by Brad King

Merge request reports