From ea6d4ee461be4b246a9dbda6f3f05c5bfb36bb1f Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 6 Mar 2016 13:15:36 +0100 Subject: [PATCH] src/gui/user_menue.cpp fix AddressSanitizer: heap-use-after-free Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/4947a71782a24cffdd7a1f5da3289aa3b0392805 Author: Jacek Jendrzej Date: 2016-03-06 (Sun, 06 Mar 2016) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/user_menue.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index 925d95011..0e59617a6 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -533,7 +533,7 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu if (mode == NeutrinoMessages::mode_webtv && !CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()) { if(loc == NONEXISTANT_LOCALE && !text) { CWebTVResolution webtvres; - text = webtvres.getResolutionValue(); + std::string tmp = webtvres.getResolutionValue(); if (!(videoDecoder->getBlank())) { int xres = 0, yres = 0, framerate; @@ -541,12 +541,14 @@ const char *CUserMenu::getUserMenuButtonName(int button, bool &active, bool retu if (xres && yres) { std::string res = to_string(xres) + "x" + to_string(yres); - if (res.compare(text)) + if (res.compare(tmp)) { - std::string tmp = (string)text + " (" + res + ")"; + tmp = " (" + res + ")"; text = tmp.c_str(); } } + }else{ + text = tmp.c_str(); } } else return_title = true;