From af527b58a895cb761709b3ac4b48bca751729167 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Tue, 20 Nov 2018 09:51:31 +0100 Subject: [PATCH] [apps] MathToolbox: fix scope of buffer used in handleEventWithText --- apps/math_toolbox.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/apps/math_toolbox.cpp b/apps/math_toolbox.cpp index 3c6512eae..a87b8ef53 100644 --- a/apps/math_toolbox.cpp +++ b/apps/math_toolbox.cpp @@ -117,15 +117,14 @@ bool MathToolbox::selectLeaf(int selectedRow) { // Translate the message const char * text = I18n::translate(messageTree->insertedText()); + char textToInsert[k_maxMessageSize]; // Has to be in the same scope as handleEventWithText if (messageTree->label() == messageTree->insertedText()) { // Remove the arguments if we kept one message for both inserted and displayed message int maxTextToInsertLength = strlen(text) + 1; assert(maxTextToInsertLength <= k_maxMessageSize); - char textToInsert[k_maxMessageSize]; Shared::ToolboxHelpers::TextToInsertForCommandText(text, textToInsert, maxTextToInsertLength, true); text = textToInsert; } - sender()->handleEventWithText(text); app()->dismissModalViewController(); return true;