mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-30 08:51:04 +02:00
imageinfo_ni: Fix memory error
Reported from AddressSanitizer (heap-use-after-free)
Origin commit data
------------------
Branch: ni/coolstream
Commit: 517e5e7cee
Author: Michael Liebmann <tuxcode.bbg@gmail.com>
Date: 2016-09-24 (Sat, 24 Sep 2016)
Origin message was:
------------------
imageinfo_ni: Fix memory error
Reported from AddressSanitizer (heap-use-after-free)
------------------
This commit was generated by Migit
This commit is contained in:
committed by
vanhofen
parent
6d0b12b813
commit
d35f8b74df
@@ -206,7 +206,7 @@ void CImageInfoNI::paint_pig(int px, int py, int w, int h)
|
||||
g_PicViewer->DisplayImage(ICONSDIR "/start.jpg", px, py, w, h, frameBuffer->TM_NONE);
|
||||
}
|
||||
|
||||
void CImageInfoNI::paintLine(int xpos, int font, const char* text)
|
||||
void CImageInfoNI::paintLine(int xpos, int font, std::string text)
|
||||
{
|
||||
g_Font[font]->RenderString(xpos, ypos, max_text_width, text, COL_INFOBAR_TEXT);
|
||||
}
|
||||
@@ -241,15 +241,15 @@ void CImageInfoNI::paint()
|
||||
CConfigFile config('\t');
|
||||
config.loadConfig("/.version");
|
||||
|
||||
const char * imagename = config.getString("imagename", "NI-Neutrino-HD").c_str();
|
||||
const char * homepage = config.getString("homepage", "www.neutrino-images.de").c_str();
|
||||
const char * creator = config.getString("creator", "NI-Team").c_str();
|
||||
const char * version = config.getString("version", "no version").c_str();
|
||||
const char * origin_commit = config.getString("origin-commit", "no commit").c_str();
|
||||
const char * builddate = config.getString("builddate", "no builddate").c_str();
|
||||
std::string imagename = config.getString("imagename", "NI-Neutrino-HD");
|
||||
std::string homepage = config.getString("homepage", "www.neutrino-images.de");
|
||||
std::string creator = config.getString("creator", "NI-Team");
|
||||
std::string version = config.getString("version", "no version");
|
||||
std::string origin_commit = config.getString("origin-commit", "no commit");
|
||||
std::string builddate = config.getString("builddate", "no builddate");
|
||||
|
||||
static CFlashVersionInfo versionInfo(version);
|
||||
const char * releaseCycle = versionInfo.getReleaseCycle();
|
||||
std::string releaseCycle = versionInfo.getReleaseCycle();
|
||||
|
||||
struct utsname uts_info;
|
||||
|
||||
@@ -262,11 +262,11 @@ void CImageInfoNI::paint()
|
||||
|
||||
ypos += iheight;
|
||||
paintLine(xpos , font_info, g_Locale->getText(LOCALE_IMAGEINFO_VERSION));
|
||||
paintLine(xpos+offset, font_info, imageversion.str().c_str());
|
||||
paintLine(xpos+offset, font_info, imageversion.str());
|
||||
|
||||
ypos += iheight;
|
||||
paintLine(xpos , font_info, "Commit:");
|
||||
paintLine(xpos+offset, font_info, commits.str().c_str());
|
||||
paintLine(xpos+offset, font_info, commits.str());
|
||||
|
||||
ypos += iheight;
|
||||
paintLine(xpos , font_info, "Kernel:");
|
||||
@@ -566,7 +566,7 @@ void CImageInfoNI::paint_DF_Info(int posx)
|
||||
get_DF_Info();
|
||||
|
||||
buf << "Imagesize (" << image_size.percent << " Percent):";
|
||||
paintLine(posx, font_small, buf.str().c_str());
|
||||
paintLine(posx, font_small, buf.str());
|
||||
|
||||
CProgressBar pb(boxX, boxY, boxW, boxH);
|
||||
pb.setFrameThickness(0);
|
||||
@@ -595,7 +595,7 @@ void CImageInfoNI::paint_DF_Info(int posx)
|
||||
}
|
||||
|
||||
ypos+= sheight;
|
||||
paintLine(posx, font_small, buf.str().c_str());
|
||||
paintLine(posx, font_small, buf.str());
|
||||
|
||||
buf.str("");
|
||||
if (image_size.available > 1024)
|
||||
@@ -604,7 +604,7 @@ void CImageInfoNI::paint_DF_Info(int posx)
|
||||
buf << "Free: " << image_size.available << " KB";
|
||||
|
||||
ypos += sheight;
|
||||
paintLine(posx, font_small, buf.str().c_str());
|
||||
paintLine(posx, font_small, buf.str());
|
||||
}
|
||||
|
||||
int CImageInfoNI::get_MEM_Info()
|
||||
|
Reference in New Issue
Block a user