From b204c4dba23a1b2e7be3d01fc740fe7d8c89e83e Mon Sep 17 00:00:00 2001 From: Nikita Baryshnikov Date: Mon, 30 Jun 2014 13:03:49 +0400 Subject: [PATCH] CMake fix deployment data Fix potential index out of range assertion in QStringList if contents of QtCreatorDeployment.txt would be unexpected(will not contain ':') Change-Id: Ia6ae282ef450e7c56a512b13da801854caec0dfb Reviewed-by: Daniel Teske --- src/plugins/cmakeprojectmanager/cmakeproject.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/plugins/cmakeprojectmanager/cmakeproject.cpp b/src/plugins/cmakeprojectmanager/cmakeproject.cpp index e1d76c79689..41c849734da 100644 --- a/src/plugins/cmakeprojectmanager/cmakeproject.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeproject.cpp @@ -739,7 +739,10 @@ void CMakeProject::updateApplicationAndDeploymentTargets() absoluteSourcePath.append(QLatin1Char('/')); if (deploymentStream.device()) { while (!deploymentStream.atEnd()) { - QStringList file = deploymentStream.readLine().split(QLatin1Char(':')); + QString line = deploymentStream.readLine(); + if (!line.contains(QLatin1Char(':'))) + continue; + QStringList file = line.split(QLatin1Char(':')); deploymentData.addFile(absoluteSourcePath + file.at(0), deploymentPrefix + file.at(1)); } }