summaryrefslogtreecommitdiffstats
path: root/qt-ui/subsurfacewebservices.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-22 22:23:04 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-06-22 22:23:04 -0700
commit4bdead6ad604e21a1b62be353460fce4ae0c3878 (patch)
tree5e4e077bdb1eccb79c420aedd58ace6da4d588bb /qt-ui/subsurfacewebservices.cpp
parent4094e6b233f967e2bd61f00cef8d53ce23811405 (diff)
downloadsubsurface-4bdead6ad604e21a1b62be353460fce4ae0c3878.tar.gz
Avoid possible use of uninitialized variable
Errorcode doesn't get set if duppedfd is negative. So let's just issue an error and bail. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/subsurfacewebservices.cpp')
-rw-r--r--qt-ui/subsurfacewebservices.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/qt-ui/subsurfacewebservices.cpp b/qt-ui/subsurfacewebservices.cpp
index 6856654de..6c75513b7 100644
--- a/qt-ui/subsurfacewebservices.cpp
+++ b/qt-ui/subsurfacewebservices.cpp
@@ -813,6 +813,10 @@ void DivelogsDeWebServices::downloadFinished()
zip = zip_fdopen(duppedfd, 0, &errorcode);
if (!zip)
::close(duppedfd);
+ } else {
+ QMessageBox::critical(this, tr("Problem with download"),
+ tr("The archive could not be opened:\n"));
+ return;
}
#else
struct zip *zip = zip_open(QFile::encodeName(zipFile.fileName()), 0, &errorcode);