ltratt / multitime

Time command execution over multiple executions
http://tratt.net/laurie/src/multitime/
MIT License
115 stars 13 forks source link

Segmentation Fault - When running without a specified confidence interval #14

Closed Mhowell494 closed 6 years ago

Mhowell494 commented 9 years ago

When a confidence interval is not provided on the command like e.g. -c 99 a segmentation fault occurs if the number of runs is less than 30.

The offending code can be found in the format.c file on line 210:

if (conf->num_runs < 30) {
    z_t = tvals[conf->conf_level - 1][conf->num_runs - 1];
}

This is due to the fact that the array location being accessed is out of bounds

The code should be modified to set a default value of 0 for the confidence level and condition the code that calculates / prints the confidence interval based on this default value.