diff options
author | Oswald Buddenhagen <oswald.buddenhagen@digia.com> | 2014-05-22 15:21:36 +0200 |
---|---|---|
committer | Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> | 2015-10-27 17:54:19 +0000 |
commit | 193c6d2ebbac453f12c24def302f08f3b85e6d2a (patch) | |
tree | 8d97e18e82e4aad2027ce78f9ae0fb01784541b2 /qmake | |
parent | b4e6409feadc5c0f33338df2ea824b28345561a0 (diff) |
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>
(cherry picked from qtcreator/e017a1dc8b2030e509d6198315e9f6a9869667e7)
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
Diffstat (limited to 'qmake')
-rw-r--r-- | qmake/library/qmakeevaluator.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/qmake/library/qmakeevaluator.cpp b/qmake/library/qmakeevaluator.cpp index 73ea10daf8..efda9df7d4 100644 --- a/qmake/library/qmakeevaluator.cpp +++ b/qmake/library/qmakeevaluator.cpp @@ -912,8 +912,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 @@ -1159,8 +1162,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); |