summaryrefslogtreecommitdiffstats
path: root/qmake/library/qmakebuiltins.cpp
diff options
context:
space:
mode:
authorOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-07-05 18:07:14 +0200
committerOswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>2016-07-13 14:27:01 +0000
commit3c8134958c66f40bb86588aa91b83bf58b5de0c9 (patch)
tree81a48b470cee2fcbc98cfdceb626f284a6cbd549 /qmake/library/qmakebuiltins.cpp
parentd459a6b0e0d4f128caceaafe981ecf374bb3e420 (diff)
fix raw data leak in $$absolute_path()
when the file name is empty, the path will be returned verbatim. this must be considered when constructing the return value. Task-number: QTBUG-54550 Change-Id: Ie108ed52275e66a154ef63bd6f7193f55b3e0454 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'qmake/library/qmakebuiltins.cpp')
-rw-r--r--qmake/library/qmakebuiltins.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/qmake/library/qmakebuiltins.cpp b/qmake/library/qmakebuiltins.cpp
index 272b0cc30d..c1d23295e7 100644
--- a/qmake/library/qmakebuiltins.cpp
+++ b/qmake/library/qmakebuiltins.cpp
@@ -1027,7 +1027,11 @@ ProStringList QMakeEvaluator::evaluateBuiltinExpand(
QString rstr = QDir::cleanPath(
QDir(args.count() > 1 ? args.at(1).toQString(m_tmp2) : currentDirectory())
.absoluteFilePath(args.at(0).toQString(m_tmp1)));
- ret << (rstr.isSharedWith(m_tmp1) ? args.at(0) : ProString(rstr).setSource(args.at(0)));
+ ret << (rstr.isSharedWith(m_tmp1)
+ ? args.at(0)
+ : args.count() > 1 && rstr.isSharedWith(m_tmp2)
+ ? args.at(1)
+ : ProString(rstr).setSource(args.at(0)));
}
break;
case E_RELATIVE_PATH: