diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2020-02-21 14:48:59 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2020-03-04 15:48:17 +0000 |
commit | 8eebdd24745c57be3baf0d56d3ac6780a38921f1 (patch) | |
tree | b0bb398177532a79b2afc186266590dafd759430 /share | |
parent | 41d39eee1272a00d2bdbe525aff8d99ec2a4d7f8 (diff) |
GccBinaryProbe: Exit early if we didn't find anything
Otherwise, we potentially access undefined objects.
Fixes: QBS-1385
Change-Id: I98aa99b51c80e5f60ebb335917552529b340a8e8
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'share')
-rw-r--r-- | share/qbs/imports/qbs/Probes/GccBinaryProbe.qbs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/share/qbs/imports/qbs/Probes/GccBinaryProbe.qbs b/share/qbs/imports/qbs/Probes/GccBinaryProbe.qbs index 670749ddc..02caad501 100644 --- a/share/qbs/imports/qbs/Probes/GccBinaryProbe.qbs +++ b/share/qbs/imports/qbs/Probes/GccBinaryProbe.qbs @@ -53,6 +53,10 @@ BinaryProbe { pathSuffixes, platformSearchPaths, environmentPaths, platformEnvironmentPaths, pathListSeparator); + found = results.found; + if (!found) + return; + var resultsMapper = function(result) { (nameSuffixes || [""]).forEach(function(suffix) { var end = _compilerName + suffix; @@ -62,10 +66,7 @@ BinaryProbe { return result; }; results.files = results.files.map(resultsMapper); - - found = results.found; allResults = results.files; - var result = results.files[0]; candidatePaths = result.candidatePaths; path = result.path; |