summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-05-22 15:21:36 +0200
committerOswald Buddenhagen <oswald.buddenhagen@digia.com>2014-06-02 13:43:34 +0200
commite017a1dc8b2030e509d6198315e9f6a9869667e7 (patch)
treef7251ae6ee3914946f2f95925366efa5aacbeff8
parentcf6e4b8dcbc42adc3c3717728edcaf7952f1784b (diff)
downloadqt-creator-e017a1dc8b2030e509d6198315e9f6a9869667e7.tar.gz
avoid that a bad qmakespec path crashes the evaluator
assigning a relative path to QMAKESPEC or QMAKESPEC_ORIGINAL (in the qt4 windows legacy code) would lead to an assert further down the line. just ignore such attempts silently. Task-number: QTCREATORBUG-8477 Change-Id: Ie53d0ef004c743284b85de4e89f112e0161ff4b7 Reviewed-by: Daniel Teske <daniel.teske@digia.com>
-rw-r--r--src/shared/proparser/qmakeevaluator.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/shared/proparser/qmakeevaluator.cpp b/src/shared/proparser/qmakeevaluator.cpp
index 0cefb493e2..262985f174 100644
--- a/src/shared/proparser/qmakeevaluator.cpp
+++ b/src/shared/proparser/qmakeevaluator.cpp
@@ -914,8 +914,11 @@ void QMakeEvaluator::visitProVariable(
m_featureRoots = 0;
else if (varName == statics.strQMAKESPEC) {
if (!values(varName).isEmpty()) {
- m_qmakespec = values(varName).first().toQString();
- m_featureRoots = 0;
+ QString spec = values(varName).first().toQString();
+ if (IoUtils::isAbsolutePath(spec)) {
+ m_qmakespec = spec;
+ m_featureRoots = 0;
+ }
}
}
#ifdef PROEVALUATOR_FULL
@@ -1129,8 +1132,11 @@ bool QMakeEvaluator::loadSpecInternal()
// the source of the qmake.conf at the end of the default/qmake.conf in
// the QMAKESPEC_ORIGINAL variable.
const ProString &orig_spec = first(ProKey("QMAKESPEC_ORIGINAL"));
- if (!orig_spec.isEmpty())
- m_qmakespec = orig_spec.toQString();
+ if (!orig_spec.isEmpty()) {
+ QString spec = orig_spec.toQString();
+ if (IoUtils::isAbsolutePath(spec))
+ m_qmakespec = spec;
+ }
# endif
#endif
valuesRef(ProKey("QMAKESPEC")) = ProString(m_qmakespec);