From c5a0bb67e1a0bfaa5dc26aae0e4ea91663055d61 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Thu, 10 Mar 2016 23:39:32 +0100 Subject: [PATCH] src/gui/user_menue_setup.cpp fix possible AddressSanitizer: global-buffer-overflow --- src/gui/user_menue_setup.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/user_menue_setup.cpp b/src/gui/user_menue_setup.cpp index 1e3527344..d59be22ab 100644 --- a/src/gui/user_menue_setup.cpp +++ b/src/gui/user_menue_setup.cpp @@ -190,6 +190,10 @@ int CUserMenuSetup::exec(CMenuTarget* parent, const std::string &actionKey) static neutrino_locale_t locals[SNeutrinoSettings::ITEM_MAX]; neutrino_locale_t CUserMenuSetup::getLocale(unsigned int key) { + if(key >= SNeutrinoSettings::ITEM_MAX){ + key = SNeutrinoSettings::ITEM_MAX-1; + } + static bool initialized = false; if (!initialized) { initialized = true;