mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-31 17:31:11 +02:00
flashtool: make CFlashVersionInfo robust against invalid input
Origin commit data
------------------
Commit: 4134af3d1d
Author: Stefan Seyfried <seife@tuxbox-git.slipkontur.de>
Date: 2017-02-04 (Sat, 04 Feb 2017)
This commit is contained in:
committed by
Michael Liebmann
parent
506b6c54d2
commit
076e49e1a1
@@ -441,10 +441,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