From 29e61e3e6e179197e74f475d1ca52e73f07680ad Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Fri, 13 Jan 2012 15:46:46 +0400 Subject: [PATCH] libconfigfile: check iterator for end before using it Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2c131c8117d6165ab1d8e03ff67a7ed6e7dd47d4 Author: [CST] Focus Date: 2012-01-13 (Fri, 13 Jan 2012) --- lib/libconfigfile/configfile.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libconfigfile/configfile.cpp b/lib/libconfigfile/configfile.cpp index 8d7677456..d567fee76 100644 --- a/lib/libconfigfile/configfile.cpp +++ b/lib/libconfigfile/configfile.cpp @@ -391,6 +391,8 @@ void CConfigFile::setInt32Vector(const std::string & key, const std::vector::const_iterator it = vec.begin(); ; ) { + if (it == vec.end()) + break; s << (*it); it++; if (it == vec.end()) @@ -406,6 +408,8 @@ void CConfigFile::setStringVector(const std::string & key, const std::vector::const_iterator it = vec.begin(); ; ) { + if (it == vec.end()) + break; configData[key] += *it; it++; if (it == vec.end())