summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <laurent.montel@kdab.com>2013-01-14 11:42:09 +0100
committerNicolas Arnaud-Cormos <nicolas@kdab.com>2013-01-21 07:49:31 +0100
commit3ca226dcaa5e8d6c18adb2b11f00120222ce2213 (patch)
tree98e333f35503ef33a24baf69015578dba7f38c55
parent97135e70f25aa53a6fbb354833289e5ed0a06f11 (diff)
downloadqt-creator-3ca226dcaa5e8d6c18adb2b11f00120222ce2213.tar.gz
Check if we can read file
Change-Id: Ibe4f72ceea5825866d58084668529fa03520968f Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
-rw-r--r--src/plugins/projectexplorer/abi.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/abi.cpp b/src/plugins/projectexplorer/abi.cpp
index 223f211034..2696b12fd6 100644
--- a/src/plugins/projectexplorer/abi.cpp
+++ b/src/plugins/projectexplorer/abi.cpp
@@ -676,7 +676,9 @@ QList<Abi> Abi::abisOfBinary(const Utils::FileName &path)
if (!f.exists())
return tmp;
- f.open(QFile::ReadOnly);
+ if (!f.open(QFile::ReadOnly))
+ return tmp;
+
QByteArray data = f.read(1024);
if (data.size() >= 67
&& getUint8(data, 0) == '!' && getUint8(data, 1) == '<' && getUint8(data, 2) == 'a'