From 608d8a3c09abc5db398cdadc09e18fd2dfbaf570 Mon Sep 17 00:00:00 2001 From: Leon Styhre Date: Sun, 12 Mar 2023 12:13:49 +0100 Subject: [PATCH] Fixed several container overflows in GuiTextEditKeyboardPopup that could lead to rare crashes when running on an ARM processor --- es-core/src/guis/GuiTextEditKeyboardPopup.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/es-core/src/guis/GuiTextEditKeyboardPopup.cpp b/es-core/src/guis/GuiTextEditKeyboardPopup.cpp index 3c2570123..6f5d7ee74 100644 --- a/es-core/src/guis/GuiTextEditKeyboardPopup.cpp +++ b/es-core/src/guis/GuiTextEditKeyboardPopup.cpp @@ -41,7 +41,7 @@ #include "utils/StringUtil.h" // clang-format off -std::vector> kbBaseUS { +std::vector> kbBaseUS { {"1", "2", "3", "4", "5", "6", "7", "8", "9", "0", "-", "=", "DEL"}, {"!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "DEL"}, {"¡", "²", "³", "¤", "€", "¼", "½", "¾", "‘", "’", "¥", "×", "DEL"}, @@ -62,13 +62,13 @@ std::vector> kbBaseUS { {"", "æ", "", "©", "", "", "ñ", "µ", "ç", "", "¿", "ALT", "-colspan-"}, {"", "Æ", "", "¢", "", "", "Ñ", "Μ", "Ç", "", "", "ALT", "-colspan-"}}; -std::vector> kbLastRowNormal { +std::vector> kbLastRowNormal { {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}}; -std::vector> kbLastRowLoad { +std::vector> kbLastRowLoad { {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, {"SHIFT", "-colspan-", "SPACE", "-colspan-", "-colspan-", "-colspan-", "-colspan-", "LOAD", "-colspan-", "CLEAR", "-colspan-", "CANCEL", "-colspan-"}, @@ -117,7 +117,7 @@ GuiTextEditKeyboardPopup::GuiTextEditKeyboardPopup( mTitle = std::make_shared(Utils::String::toUpper(title), Font::get(FONT_SIZE_LARGE), 0x555555FF, ALIGN_CENTER); - std::vector> kbLayout; + std::vector> kbLayout; // At the moment there is only the US keyboard layout available. kbLayout.insert(kbLayout.cend(), kbBaseUS.cbegin(), kbBaseUS.cend());