From d29ffa72dceb8c40c257fe6b37fe60122150b7ea Mon Sep 17 00:00:00 2001 From: Gergely Nagy Date: Tue, 24 May 2022 16:42:56 +0200 Subject: [PATCH] DynamicMacros: Make sure we keep within bounds during play Caught by @gedankenexperimenter, thanks! Signed-off-by: Gergely Nagy --- .../src/kaleidoscope/plugin/DynamicMacros.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/Kaleidoscope-DynamicMacros/src/kaleidoscope/plugin/DynamicMacros.cpp b/plugins/Kaleidoscope-DynamicMacros/src/kaleidoscope/plugin/DynamicMacros.cpp index 0cf6438b..52f5b6d9 100644 --- a/plugins/Kaleidoscope-DynamicMacros/src/kaleidoscope/plugin/DynamicMacros.cpp +++ b/plugins/Kaleidoscope-DynamicMacros/src/kaleidoscope/plugin/DynamicMacros.cpp @@ -141,7 +141,7 @@ void DynamicMacros::play(uint8_t macro_id) { pos = storage_base_ + map_[macro_id]; - while (true) { + while (pos < storage_base_ + storage_size_) { switch (macro = Runtime.storage().read(pos++)) { case MACRO_ACTION_STEP_EXPLICIT_REPORT: case MACRO_ACTION_STEP_IMPLICIT_REPORT: