diff options
author | Justin Berger <j.david.berger@gmail.com> | 2018-02-23 23:22:28 -0700 |
---|---|---|
committer | Justin Berger <j.david.berger@gmail.com> | 2018-02-23 23:30:16 -0700 |
commit | dabb0764a080ad219e1bb477e8cf7386a1a4dc7c (patch) | |
tree | 5b534da08662382c89d3a8d25a87cf46e133bafc /src | |
parent | 9a9a539396c622246a527ed0c12df36edf5ff807 (diff) | |
download | libsurvive-dabb0764a080ad219e1bb477e8cf7386a1a4dc7c.tar.gz libsurvive-dabb0764a080ad219e1bb477e8cf7386a1a4dc7c.tar.bz2 |
Fixed OOB memory access
Diffstat (limited to 'src')
-rwxr-xr-x | src/survive_cal.c | 1 | ||||
-rw-r--r-- | src/survive_cal.h | 6 |
2 files changed, 4 insertions, 3 deletions
diff --git a/src/survive_cal.c b/src/survive_cal.c index 87d8c0b..f3a682a 100755 --- a/src/survive_cal.c +++ b/src/survive_cal.c @@ -15,6 +15,7 @@ #include <sys/stat.h> #include <sys/types.h> #include <linmath.h> +#include <assert.h> #include "survive_config.h" diff --git a/src/survive_cal.h b/src/survive_cal.h index ae644d1..f5ef6dc 100644 --- a/src/survive_cal.h +++ b/src/survive_cal.h @@ -51,14 +51,14 @@ struct SurviveCalData ootx_decoder_context ootx_decoders[NUM_LIGHTHOUSES]; //For statistics-gathering phase. (Stage 2/3) - FLT all_lengths[MAX_SENSORS_TO_CAL][NUM_LIGHTHOUSES][2][DRPTS]; - FLT all_angles[MAX_SENSORS_TO_CAL][NUM_LIGHTHOUSES][2][DRPTS]; + FLT all_lengths[MAX_SENSORS_TO_CAL][NUM_LIGHTHOUSES][2][DRPTS + 1]; + FLT all_angles[MAX_SENSORS_TO_CAL][NUM_LIGHTHOUSES][2][DRPTS + 1]; int16_t all_counts[MAX_SENSORS_TO_CAL][NUM_LIGHTHOUSES][2]; int16_t peak_counts; int8_t found_common; int8_t times_found_common; - FLT all_sync_times[MAX_SENSORS_TO_CAL][NUM_LIGHTHOUSES][DRPTS]; + FLT all_sync_times[MAX_SENSORS_TO_CAL][NUM_LIGHTHOUSES][DRPTS + 1]; int16_t all_sync_counts[MAX_SENSORS_TO_CAL][NUM_LIGHTHOUSES]; //For camfind (4+) |