New Defects reported by Coverity Scan for digiKam
scan-admin at coverity.com
scan-admin at coverity.com
Fri Jan 20 07:41:02 GMT 2017
Hi,
Please find the latest report on new defect(s) introduced to digiKam found with Coverity Scan.
10 new defect(s) introduced to digiKam found with Coverity Scan.
2 defect(s), reported by Coverity Scan earlier, were marked fixed in the recent build analyzed by Coverity Scan.
New defect(s) Reported-by: Coverity Scan
Showing 10 of 10 defect(s)
** CID 1398969: Null pointer dereferences (FORWARD_NULL)
/home/gilles/Devel/5.x/core/libs/tags/tagmodificationhelper.cpp: 683 in Digikam::TagModificationHelper::getFaceTags(QList<Digikam::TAlbum *>)()
________________________________________________________________________________________________________
*** CID 1398969: Null pointer dereferences (FORWARD_NULL)
/home/gilles/Devel/5.x/core/libs/tags/tagmodificationhelper.cpp: 683 in Digikam::TagModificationHelper::getFaceTags(QList<Digikam::TAlbum *>)()
677 AlbumPointer<TAlbum> tag(tAlbum);
678 AlbumIterator iter(tag);
679
680 // Get all shild tags which have the person property.
681 while (iter.current())
682 {
>>> CID 1398969: Null pointer dereferences (FORWARD_NULL)
>>> Assigning: "tAlbum" = "dynamic_cast <Digikam::TAlbum *>(iter.current())".
683 TAlbum * tAlbum = dynamic_cast<TAlbum*>(iter.current());
684 if (FaceTags::isPerson(tAlbum->id()))
685 {
686 faceTags.insert(tAlbum);
687 }
688 ++iter;
** CID 1362661: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/mediawiki/wmtalker.cpp: 145 in KIPIWikiMediaPlugin::WMTalker::uploadHandle(KJob *)()
________________________________________________________________________________________________________
*** CID 1362661: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/mediawiki/wmtalker.cpp: 145 in KIPIWikiMediaPlugin::WMTalker::uploadHandle(KJob *)()
139 QMap<QString,QString> info = d->imageDesc.take(keys.first());
140 Upload* const e1 = new Upload(*d->mediawiki, this);
141
142 qCDebug(KIPIPLUGINS_LOG) << "Path:" << keys.first();
143
144 QFile* const file = new QFile(keys.first(),this);
>>> CID 1362661: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 86 out of 102 times).
145 file->open(QIODevice::ReadOnly);
146 //emit fileUploadProgress(done = 0, total file.size());
147
148 e1->setFile(file);
149 d->currentFile = file->fileName();
150 qCDebug(KIPIPLUGINS_LOG) << "Name:" << file->fileName();
** CID 1362470: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/mediawiki/wmwindow.cpp: 281 in KIPIWikiMediaPlugin::WMWindow::prepareImageForUpload(const QString &)()
________________________________________________________________________________________________________
*** CID 1362470: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/mediawiki/wmwindow.cpp: 281 in KIPIWikiMediaPlugin::WMWindow::prepareImageForUpload(const QString &)()
275 qCDebug(KIPIPLUGINS_LOG) << "Saving to temp file: " << d->tmpPath;
276 image.save(d->tmpPath, "JPEG", d->widget->quality());
277 }
278 else
279 {
280 // file is copied with its embedded metadata
>>> CID 1362470: Error handling issues (CHECKED_RETURN)
>>> Calling "copy" without checking return value (as is done elsewhere 9 out of 10 times).
281 QFile::copy(imgPath, d->tmpPath);
282 }
283
284 if (iface())
285 {
286 // NOTE : In case of metadata are saved to tmp file, we will override MetadataProcessor settings from KIPI host
** CID 1324461: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/sendimages/sendimages.cpp: 294 in KIPISendimagesPlugin::SendImages::buildPropertiesFile()()
________________________________________________________________________________________________________
*** CID 1324461: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/sendimages/sendimages.cpp: 294 in KIPISendimagesPlugin::SendImages::buildPropertiesFile()()
288 }
289
290 QFile propertiesFile( d->settings.tempPath + i18n("properties.txt") );
291 QTextStream stream( &propertiesFile );
292 stream.setCodec(QTextCodec::codecForName("UTF-8"));
293 stream.setAutoDetectUnicode(true);
>>> CID 1324461: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 86 out of 102 times).
294 propertiesFile.open(QIODevice::WriteOnly);
295 stream << propertiesText << QLatin1String("\n");
296 propertiesFile.close();
297 d->attachementFiles << QUrl(propertiesFile.fileName());
298
299 d->progressDlg->progressWidget()->addedAction(i18n("Image properties file done"), SuccessMessage);
** CID 1324459: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/kmlexport/kmlexport.cpp: 525 in KIPIKMLExportPlugin::KmlExport::generate()()
________________________________________________________________________________________________________
*** CID 1324459: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/kmlexport/kmlexport.cpp: 525 in KIPIKMLExportPlugin::KmlExport::generate()()
519 "No position data for %1 pictures", defectImage));
520 }
521
522 /** @todo change to kml or kmz if compressed */
523 QFile file(m_tempDestDir.filePath(m_KMLFileName + QLatin1String(".kml")));
524 /** @todo handle file opening problems */
>>> CID 1324459: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 86 out of 102 times).
525 file.open( QIODevice::WriteOnly );
526 QTextStream stream( &file ); // we will serialize the data into the file
527 stream << m_kmlDocument->toString();
528 file.close();
529
530 delete m_kmlDocument;
** CID 1324458: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/kmlexport/kmlexport.cpp: 201 in KIPIKMLExportPlugin::KmlExport::generateImagesthumb(const QUrl &, QDomElement &)()
________________________________________________________________________________________________________
*** CID 1324458: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/kmlexport/kmlexport.cpp: 201 in KIPIKMLExportPlugin::KmlExport::generateImagesthumb(const QUrl &, QDomElement &)()
195 {
196 logWarning(i18n("Format of image '%1' is unknown",path));
197 return;
198 }
199
200 imageFile.close();
>>> CID 1324458: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 86 out of 102 times).
201 imageFile.open(QIODevice::ReadOnly);
202
203 QByteArray imageData = imageFile.readAll();
204 QImage image;
205
206 if (!image.loadFromData(imageData) )
** CID 1324457: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 391 in KIPIFlashExportPlugin::SimpleViewer::exportImages()()
________________________________________________________________________________________________________
*** CID 1324457: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 391 in KIPIFlashExportPlugin::SimpleViewer::exportImages()()
385 if (d->canceled)
386 return false;
387
388 d->progressWdg->addedAction(i18n("Creating images and thumbnails..."), StartingMessage);
389
390 QFile file(d->tempDir->path() + QLatin1String("/gallery.xml"));
>>> CID 1324457: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 86 out of 102 times).
391 file.open(QIODevice::WriteOnly);
392
393 // header of gallery.xml
394 QDomElement galleryElem;
395 QDomElement photosElem;
396 QDomDocument xmlDoc;
** CID 1324454: (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 825 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 837 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 856 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 868 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 887 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 925 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 943 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 953 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
________________________________________________________________________________________________________
*** CID 1324454: (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 825 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
819 //TODO: errormsg
820 qCDebug(KIPIPLUGINS_LOG) << "No indexTemplateName" ;
821 return false;
822 }
823
824 QFile infile(indexTemplateName);
>>> CID 1324454: (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 86 out of 102 times).
825 infile.open(QIODevice::ReadOnly);
826 QTextStream in(&infile);
827 QString indexTemplate = in.readAll();
828 infile.close();
829
830 indexTemplate.replace(QLatin1String("{TITLE}"), d->settings->title);
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 837 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
831 indexTemplate.replace(QLatin1String("{COLOR}"), d->settings->textColor.name());
832 indexTemplate.replace(QLatin1String("{BGCOLOR}"), d->settings->backgroundColor.name());
833 indexTemplate.replace(QLatin1String("{HOSTURL}"), d->hostUrl);
834 indexTemplate.replace(QLatin1String("{HOSTNAME}"), d->hostName);
835
836 QFile outfile(d->tempDir->path() + QLatin1String("/index.html"));
>>> CID 1324454: (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 86 out of 102 times).
837 outfile.open(QIODevice::WriteOnly);
838 QTextStream out(&outfile);
839 out << indexTemplate;
840 outfile.close();
841 break;
842 }
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 856 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
850 //TODO: errormsg
851 qCDebug(KIPIPLUGINS_LOG) << "No indexTemplateName" ;
852 return false;
853 }
854
855 QFile infile(indexTemplateName);
>>> CID 1324454: (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 86 out of 102 times).
856 infile.open(QIODevice::ReadOnly);
857 QTextStream in(&infile);
858 QString indexTemplate = in.readAll();
859 infile.close();
860
861 indexTemplate.replace(QLatin1String("{TITLE}"), d->settings->title);
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 868 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
862 indexTemplate.replace(QLatin1String("{COLOR}"), d->settings->textColor.name());
863 indexTemplate.replace(QLatin1String("{BGCOLOR}"), d->settings->backgroundColor.name());
864 //indexTemplate.replace("{HOSTNAME}", d->hostName);
865 //indexTemplate.replace("{HOSTURL}", d->hostUrl);
866
867 QFile outfile(d->tempDir->path() + QLatin1String("/index.html"));
>>> CID 1324454: (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 86 out of 102 times).
868 outfile.open(QIODevice::WriteOnly);
869 QTextStream out(&outfile);
870 out << indexTemplate;
871 outfile.close();
872 break;
873 }
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 887 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
881 //TODO: errormsg
882 qCDebug(KIPIPLUGINS_LOG) << "No indexTemplateName" ;
883 return false;
884 }
885
886 QFile infile(indexTemplateName);
>>> CID 1324454: (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 86 out of 102 times).
887 infile.open(QIODevice::ReadOnly);
888 QTextStream in(&infile);
889 QString indexTemplate = in.readAll();
890 infile.close();
891
892 indexTemplate.replace(QLatin1String("{TITLE}"), d->settings->title);
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 925 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
919 QLatin1Char('#'), QLatin1String("0x")));
920 indexTemplate.replace(QLatin1String("{BACKOUTCOLOR}"),
921 d->settings->bkgndOuterColor.name().replace(
922 QLatin1Char('#'), QLatin1String("0x")));
923
924 QFile outfile(d->tempDir->path() + QLatin1String("/index.html"));
>>> CID 1324454: (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 86 out of 102 times).
925 outfile.open(QIODevice::WriteOnly);
926 QTextStream out(&outfile);
927 out << indexTemplate;
928 outfile.close();
929 break;
930 }
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 943 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
937 //TODO: errormsg
938 qCDebug(KIPIPLUGINS_LOG) << "No indexTemplateName" ;
939 return false;
940 }
941
942 QFile infile(indexTemplateName);
>>> CID 1324454: (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 86 out of 102 times).
943 infile.open(QIODevice::ReadOnly);
944 QTextStream in(&infile);
945 QString indexTemplate = in.readAll();
946 infile.close();
947
948 indexTemplate.replace(QLatin1String("{TITLE}"), d->settings->title);
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 953 in KIPIFlashExportPlugin::SimpleViewer::createIndex() const()
947
948 indexTemplate.replace(QLatin1String("{TITLE}"), d->settings->title);
949 indexTemplate.replace(QLatin1String("{COLOR}"), d->settings->textColor.name());
950 indexTemplate.replace(QLatin1String("{BGCOLOR}"), d->settings->backgroundColor.name());
951
952 QFile outfile(d->tempDir->path() + QLatin1String("/index.html"));
>>> CID 1324454: (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 86 out of 102 times).
953 outfile.open(QIODevice::WriteOnly);
954 QTextStream out(&outfile);
955 out << indexTemplate;
956 outfile.close();
957 break;
958 }
** CID 1324453: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/piwigo/piwigotalker.cpp: 110 in KIPIPiwigoExportPlugin::PiwigoTalker::computeMD5Sum(const QString &)()
________________________________________________________________________________________________________
*** CID 1324453: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/piwigo/piwigotalker.cpp: 110 in KIPIPiwigoExportPlugin::PiwigoTalker::computeMD5Sum(const QString &)()
104 }
105
106 QByteArray PiwigoTalker::computeMD5Sum(const QString& filepath)
107 {
108 QFile file(filepath);
109
>>> CID 1324453: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 86 out of 102 times).
110 file.open(QIODevice::ReadOnly);
111 QByteArray md5sum = QCryptographicHash::hash(file.readAll(), QCryptographicHash::Md5);
112 file.close();
113
114 return md5sum;
115 }
** CID 1324452: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/piwigo/piwigotalker.cpp: 793 in KIPIPiwigoExportPlugin::PiwigoTalker::addNextChunk()()
________________________________________________________________________________________________________
*** CID 1324452: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/piwigo/piwigotalker.cpp: 793 in KIPIPiwigoExportPlugin::PiwigoTalker::addNextChunk()()
787 }
788
789 void PiwigoTalker::addNextChunk()
790 {
791 QFile imagefile(m_path);
792
>>> CID 1324452: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 86 out of 102 times).
793 imagefile.open(QIODevice::ReadOnly);
794
795 m_chunkId++; // We start with chunk 1
796
797 imagefile.seek((m_chunkId - 1) * CHUNK_MAX_SIZE);
798
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRZIlZa20oQ0xtvekoaSXYBwgZYh7yqZ4T857KvBwnvzEg-3D-3D_Vulo-2FzB1zz6bqp-2F-2Bl-2FpBD-2BzKk1Nu56XtBupWJitvnTAeJyeqbuSBTgEN1rA8xB2BwaQpPCgWgAcdvimuVV8BSwZfz6HlhHdnZjMT97adWAqA-2FEZhAezVGR4wNUd0IP1UKlnoNUVXp343-2FniFIHt1-2Fer93Du7BZOnfLzZZI6hB3VirE6gVm3Jvlnzhm9Ch-2BgW9QrNkzpykKiB9iUDuVCz0ypK2MKCFHvbm2vddiJk31s-3D
To manage Coverity Scan email notifications for "digikam-devel at kde.org", click https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRbVDbis712qZDP-2FA8y06Nq4g-2BkTwi3e7HlDkvMAkUMj2-2FFhZ2O-2BELTTy-2Fl1ea1gxKqmntchu8-2BeAOkExRtki0102MqL9th0o1rOws5-2F-2FQDFdjkpeJaB-2FdUMxPk-2B7ZQUGV0-3D_Vulo-2FzB1zz6bqp-2F-2Bl-2FpBD-2BzKk1Nu56XtBupWJitvnTAeJyeqbuSBTgEN1rA8xB2Bfm2EdTaGmRdX-2Fm1F89blot3K38WEhQppXVmqBLht5hNE1VgCPTAv46JlRDG-2FYQmekOWToUzstDV5unFYj-2BBKDOzK31HXFqo7QgtQebLgjJnV3udC6lpSxE2-2BVz6tX-2B6aNSV8oHiB8Hx0g4ODIZtFkLuaQFj5vypQIlXXiJTjCyM-3D
More information about the Digikam-devel
mailing list