mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-09-01 18:01:06 +02:00
flashtool: make CFlashVersionInfo robust against invalid input
Origin commit data
------------------
Branch: ni/coolstream
Commit: 2cf2a3ed52
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-02-04 (Sat, 04 Feb 2017)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -446,10 +446,14 @@ void CFlashTool::reboot()
|
|||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------------------------------------
|
||||||
CFlashVersionInfo::CFlashVersionInfo(const std::string & versionString)
|
CFlashVersionInfo::CFlashVersionInfo(const std::string & _versionString)
|
||||||
{
|
{
|
||||||
//SBBBYYYYMMTTHHMM -- formatsting
|
//SBBBYYYYMMTTHHMM -- formatsting
|
||||||
|
std::string versionString = _versionString;
|
||||||
|
/* just to make sure the string is long enough for the following code
|
||||||
|
* trailing chars don't matter -- will just be ignored */
|
||||||
|
if (versionString.size() < 16)
|
||||||
|
versionString.append(16, '0');
|
||||||
// recover type
|
// recover type
|
||||||
snapshot = versionString[0];
|
snapshot = versionString[0];
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user