Add list length check
@@ -361,9 +361,10 @@ void DeRestPluginPrivate::internetDiscoveryExtractVersionInfo(QNetworkReply *rep
{
QStringList gwUpdateVersionList = gwUpdateVersion.split('.');
QStringList versionList = version.split('.');
- if (((gwUpdateVersionList[0].toInt() < versionList[0].toInt())) ||
+ if (gwUpdateVersionList.size() >= 3 && versionList.size() >= 3 &&
+ (((gwUpdateVersionList[0].toInt() < versionList[0].toInt())) ||
((gwUpdateVersionList[0].toInt() == versionList[0].toInt()) && (gwUpdateVersionList[1].toInt() < versionList[1].toInt())) ||
- ((gwUpdateVersionList[0].toInt() == versionList[0].toInt()) && (gwUpdateVersionList[1].toInt() == versionList[1].toInt()) && (gwUpdateVersionList[2].toInt() < versionList[2].toInt())))
+ ((gwUpdateVersionList[0].toInt() == versionList[0].toInt()) && (gwUpdateVersionList[1].toInt() == versionList[1].toInt()) && (gwUpdateVersionList[2].toInt() < versionList[2].toInt()))))
{
DBG_Printf(DBG_INFO, "discovery found version %s for update channel %s\n", qPrintable(version), qPrintable(gwUpdateChannel));
gwUpdateVersion = version;
