src/gui/user_menue_setup.cpp fix possible AddressSanitizer: global-buffer-overflow

This commit is contained in:
Jacek Jendrzej
2016-03-10 23:39:32 +01:00
parent de490421e3
commit c5a0bb67e1

View File

@@ -190,6 +190,10 @@ int CUserMenuSetup::exec(CMenuTarget* parent, const std::string &actionKey)
static neutrino_locale_t locals[SNeutrinoSettings::ITEM_MAX]; static neutrino_locale_t locals[SNeutrinoSettings::ITEM_MAX];
neutrino_locale_t CUserMenuSetup::getLocale(unsigned int key) neutrino_locale_t CUserMenuSetup::getLocale(unsigned int key)
{ {
if(key >= SNeutrinoSettings::ITEM_MAX){
key = SNeutrinoSettings::ITEM_MAX-1;
}
static bool initialized = false; static bool initialized = false;
if (!initialized) { if (!initialized) {
initialized = true; initialized = true;