mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 15:32:59 +02:00
flashtool: make CFlashVersionInfo robust against invalid input
This commit is contained in:
committed by
M. Liebmann
parent
c695ae8ea8
commit
4134af3d1d
@@ -441,10 +441,14 @@ void CFlashTool::reboot()
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------------------------------------------
|
||||
CFlashVersionInfo::CFlashVersionInfo(const std::string & versionString)
|
||||
CFlashVersionInfo::CFlashVersionInfo(const std::string & _versionString)
|
||||
{
|
||||
//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
|
||||
snapshot = versionString[0];
|
||||
|
||||
|
Reference in New Issue
Block a user