diff options
author | Keith Packard <keithp@keithp.com> | 2011-08-24 01:48:28 -0700 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2011-08-24 02:04:47 -0700 |
commit | 9849883a754a73b861dd7be530753ff5c2abb499 (patch) | |
tree | 9528b46ce28e46d7394ce1cdf2a9ded1fb86ae6e /altosui | |
parent | 4d94e8f9f807a0bbeab0cdead011e74eeca1d1b6 (diff) |
altosui: Don't trust companion telemetry record 'channels' count
It can be bogus, allowing the code to walk off the end of the
allocated data array.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'altosui')
-rw-r--r-- | altosui/AltosTelemetryRecordCompanion.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/altosui/AltosTelemetryRecordCompanion.java b/altosui/AltosTelemetryRecordCompanion.java index 11b349e1..52d7f4cf 100644 --- a/altosui/AltosTelemetryRecordCompanion.java +++ b/altosui/AltosTelemetryRecordCompanion.java @@ -36,7 +36,7 @@ public class AltosTelemetryRecordCompanion extends AltosTelemetryRecordRaw { companion.tick = tick; companion.board_id = uint8(5); companion.update_period = uint8(6+off); - for (int i = 0; i < channels; i++) + for (int i = 0; i < companion.companion_data.length; i++) companion.companion_data[i] = uint16(8 + off + i * 2); } |