diff options
author | Keith Packard <keithp@keithp.com> | 2010-09-01 19:53:24 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2010-09-01 19:53:24 -0700 |
commit | 1177e0a684328422be5adc68093d0091a218a824 (patch) | |
tree | 83bbb65c7b47b72ebc712442ed28a7b68e8980e5 /src/ao_gps_test.c | |
parent | 775acb89660cdee2f3c54c38297baefe39f2414c (diff) |
altos: Bounds check Skytraq GPS tracking data array
Missing GPS serial data could cause the tracking array reset to
get skipped, causing the array to be overrun, smashing critical data
beyond the array.
This was detected using the 'altosui' flash command to program a
device from TM. Hitting the USB that hard caused TM to crash with a
mutex error (3 beeps) after the ao_gps_task structure was overwritten
with zeros.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'src/ao_gps_test.c')
-rw-r--r-- | src/ao_gps_test.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/ao_gps_test.c b/src/ao_gps_test.c index cdcc6f4c..edb51304 100644 --- a/src/ao_gps_test.c +++ b/src/ao_gps_test.c @@ -62,9 +62,11 @@ struct ao_gps_sat_data { uint8_t c_n_1; }; +#define AO_MAX_GPS_TRACKING 12 + struct ao_gps_tracking_data { uint8_t channels; - struct ao_gps_sat_data sats[12]; + struct ao_gps_sat_data sats[AO_MAX_GPS_TRACKING]; }; void |