aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-08 10:39:46 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-08-08 10:39:46 -0700
commit4a125384ac9e331130b20301a8f43687431189a1 (patch)
tree995ebe14bf4e4877dbd24514c2e205cfdfb00ddd
parent6fdbf2069df4f238d7966fef67a31cee5c5eddbb (diff)
downloadsubsurface-4a125384ac9e331130b20301a8f43687431189a1.tar.gz
Fix possible crash attempting network connection
If we didn't get back a JSON encoded string (i.e., if the response contained no '"') we would access a QList past its boundary. I'm somewhat hopeful that this is a last second fix for an annoying bug I've been trying to figure out for a while. See #514 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/updatemanager.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/qt-ui/updatemanager.cpp b/qt-ui/updatemanager.cpp
index 47554fcc5..4729998c7 100644
--- a/qt-ui/updatemanager.cpp
+++ b/qt-ui/updatemanager.cpp
@@ -47,7 +47,11 @@ void UpdateManager::requestReceived()
} else {
//No network error
QString response(reply->readAll());
- QString responseBody = response.split("\"").at(1);
+ QString responseBody;
+ if (response.contains('"'))
+ responseBody = response.split("\"").at(1);
+ else
+ responseBody = response;
msgbox.setIcon(QMessageBox::Information);