r21986 by craig - Coverity 1350059: Unchecked return value on file open
scribus-commit
scribus-commit at lists.scribus.net
Sun Apr 23 09:47:12 UTC 2017
Author: craig
Date: Sun Apr 23 09:47:12 2017
New Revision: 21986
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21986
Log:
Coverity 1350059: Unchecked return value on file open
Modified:
trunk/Scribus/scribus/ui/latexeditor.cpp
Modified: trunk/Scribus/scribus/ui/latexeditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21986&path=/trunk/Scribus/scribus/ui/latexeditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/latexeditor.cpp (original)
+++ trunk/Scribus/scribus/ui/latexeditor.cpp Sun Apr 23 09:47:12 2017
@@ -826,10 +826,12 @@
if (loadedFiles.contains(filename)) return;
loadedFiles << filename;
file = new QFile(filename);
- file->open(QIODevice::ReadOnly);
+ if (!file->open(QIODevice::ReadOnly))
+ return;
basePos = 0;
- while (!file->atEnd()) {
- QString name = readHeader();
+ while (!file->atEnd())
+ {
+ QString name(readHeader());
if (name.isEmpty()) break;
if (!len) continue;
icons.insert(filename + ":" + name, readData());
More information about the scribus-commit
mailing list