From 82cfb4bb75968e06d550603b4a7ebb89528c6117 Mon Sep 17 00:00:00 2001 From: rusefi Date: Sat, 27 May 2017 09:05:08 -0400 Subject: [PATCH] fixed #429 --- firmware/console/binary/tunerstudio.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index 36c19a9bf3..8f3e603417 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -590,12 +590,12 @@ void handleQueryCommand(ts_channel_s *tsChannel, ts_response_format_e mode) { */ void handleOutputChannelsCommand(ts_channel_s *tsChannel, ts_response_format_e mode, uint16_t offset, uint16_t count) { -// -// if (size < offset + count) { -// scheduleMsg(&tsLogger, "invalid offset/count %d/%d", offset, count); -// sendErrorCode(tsChannel); -// return; -// } + + if (sizeof(TunerStudioOutputChannels) < offset + count) { + scheduleMsg(&tsLogger, "invalid offset/count %d/%d", offset, count); + sendErrorCode(tsChannel); + return; + } tsState.outputChannelsCommandCounter++;