mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-08-27 07:23:09 +02:00
libconfigfile: check iterator for end before using it
This commit is contained in:
@@ -391,6 +391,8 @@ void CConfigFile::setInt32Vector(const std::string & key, const std::vector<int3
|
|||||||
|
|
||||||
for (std::vector<int32_t>::const_iterator it = vec.begin(); ; )
|
for (std::vector<int32_t>::const_iterator it = vec.begin(); ; )
|
||||||
{
|
{
|
||||||
|
if (it == vec.end())
|
||||||
|
break;
|
||||||
s << (*it);
|
s << (*it);
|
||||||
it++;
|
it++;
|
||||||
if (it == vec.end())
|
if (it == vec.end())
|
||||||
@@ -406,6 +408,8 @@ void CConfigFile::setStringVector(const std::string & key, const std::vector<std
|
|||||||
|
|
||||||
for (std::vector<std::string>::const_iterator it = vec.begin(); ; )
|
for (std::vector<std::string>::const_iterator it = vec.begin(); ; )
|
||||||
{
|
{
|
||||||
|
if (it == vec.end())
|
||||||
|
break;
|
||||||
configData[key] += *it;
|
configData[key] += *it;
|
||||||
it++;
|
it++;
|
||||||
if (it == vec.end())
|
if (it == vec.end())
|
||||||
|
Reference in New Issue
Block a user