From 4bdead6ad604e21a1b62be353460fce4ae0c3878 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 22 Jun 2015 22:23:04 -0700 Subject: 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 --- qt-ui/subsurfacewebservices.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'qt-ui/subsurfacewebservices.cpp') 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); -- cgit v1.2.3-70-g09d2