[Digikam-devel] New Defects reported by Coverity Scan for digiKam
scan-admin at coverity.com
scan-admin at coverity.com
Tue Sep 15 12:13:31 BST 2015
Hi,
Please find the latest report on new defect(s) introduced to digiKam found with Coverity Scan.
24 new defect(s) introduced to digiKam found with Coverity Scan.
89 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 20 of 24 defect(s)
** CID 1324475: Uninitialized members (UNINIT_CTOR)
/home/gilles/Devel/5.x/extra/kipi-plugins/imageshack/imageshackwidget.cpp: 102 in KIPIImageshackPlugin::ImageshackWidget::ImageshackWidget(QWidget *, KIPIImageshackPlugin::Imageshack *, KIPI::Interface *, const QString &)()
________________________________________________________________________________________________________
*** CID 1324475: Uninitialized members (UNINIT_CTOR)
/home/gilles/Devel/5.x/extra/kipi-plugins/imageshack/imageshackwidget.cpp: 102 in KIPIImageshackPlugin::ImageshackWidget::ImageshackWidget(QWidget *, KIPIImageshackPlugin::Imageshack *, KIPI::Interface *, const QString &)()
96 addWidgetToSettingsBox(tagsBox);
97
98 getUploadBox()->hide();
99 getSizeBox()->hide();
100
101 updateLabels();
>>> CID 1324475: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "m_galleriesWidget" is not initialized in this constructor nor in any functions that it calls.
102 }
103
104 ImageshackWidget::~ImageshackWidget()
105 {
106 }
107
** CID 1324474: Uninitialized members (UNINIT_CTOR)
/home/gilles/Devel/5.x/extra/kipi-plugins/yandexfotki/yfwindow.cpp: 198 in KIPIYandexFotkiPlugin::YandexFotkiWindow::YandexFotkiWindow(bool, QWidget *)()
________________________________________________________________________________________________________
*** CID 1324474: Uninitialized members (UNINIT_CTOR)
/home/gilles/Devel/5.x/extra/kipi-plugins/yandexfotki/yfwindow.cpp: 198 in KIPIYandexFotkiPlugin::YandexFotkiWindow::YandexFotkiWindow(bool, QWidget *)()
192
193 connect(&m_talker, SIGNAL(signalUpdateAlbumDone()),
194 this, SLOT(slotUpdateAlbumDone()));
195
196 // read settings from file
197 readSettings();
>>> CID 1324474: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "m_uploadWidget" is not initialized in this constructor nor in any functions that it calls.
198 }
199
200 YandexFotkiWindow::~YandexFotkiWindow()
201 {
202 reset();
203 }
** CID 1324473: Uninitialized members (UNINIT_CTOR)
/home/gilles/Devel/5.x/core/utilities/metadataedit/dialog/metadataedit.cpp: 66 in Digikam::MetadataEditDialog::Private::Private()()
________________________________________________________________________________________________________
*** CID 1324473: Uninitialized members (UNINIT_CTOR)
/home/gilles/Devel/5.x/core/utilities/metadataedit/dialog/metadataedit.cpp: 66 in Digikam::MetadataEditDialog::Private::Private()()
60 {
61 isReadOnly = false;
62 tabWidget = 0;
63 tabExif = 0;
64 tabIptc = 0;
65 tabXmp = 0;
>>> CID 1324473: Uninitialized members (UNINIT_CTOR)
>>> Non-static class member "buttons" is not initialized in this constructor nor in any functions that it calls.
66 }
67
68 bool isReadOnly;
69
70 QList<QUrl> urls;
71 QList<QUrl>::iterator currItem;
** CID 1324472: Uninitialized variables (UNINIT)
/home/gilles/Devel/5.x/extra/kipi-plugins/googleservices/gswindow.cpp: 912 in KIPIGoogleServicesPlugin::GSWindow::uploadNextPhoto()()
________________________________________________________________________________________________________
*** CID 1324472: Uninitialized variables (UNINIT)
/home/gilles/Devel/5.x/extra/kipi-plugins/googleservices/gswindow.cpp: 912 in KIPIGoogleServicesPlugin::GSWindow::uploadNextPhoto()()
906 }
907
908 case PluginName::PicasaImport :
909 break;
910 }
911
>>> CID 1324472: Uninitialized variables (UNINIT)
>>> Using uninitialized value "res".
912 if (!res)
913 {
914 slotAddPhotoDone(0, QStringLiteral(""), QStringLiteral("-1"));
915 return;
916 }
917 }
** CID 1324471: Parse warnings (PARSE_ERROR)
/home/gilles/Devel/5.x/extra/kipi-plugins/common/libkipiplugins/tools/kpmetadata.cpp: 1 in ()
________________________________________________________________________________________________________
*** CID 1324471: Parse warnings (PARSE_ERROR)
/home/gilles/Devel/5.x/extra/kipi-plugins/common/libkipiplugins/tools/kpmetadata.cpp: 1 in ()
>>> CID 1324471: Parse warnings (PARSE_ERROR)
>>> The Coverity compiler fails to compile this file. Please see the build output log for more information.
1 /* ============================================================
2 *
3 * This file is a part of digiKam project
4 * http://www.digikam.org
5 *
6 * Date : 2012-02-20
** CID 1324470: Control flow issues (MISSING_BREAK)
/home/gilles/Devel/5.x/extra/kipi-plugins/googleservices/gswindow.cpp: 723 in KIPIGoogleServicesPlugin::GSWindow::slotStartTransfer()()
________________________________________________________________________________________________________
*** CID 1324470: Control flow issues (MISSING_BREAK)
/home/gilles/Devel/5.x/extra/kipi-plugins/googleservices/gswindow.cpp: 723 in KIPIGoogleServicesPlugin::GSWindow::slotStartTransfer()()
717 qCDebug(KIPIPLUGINS_LOG) << "in start transfer info " <<info.title() << info.description();
718
719 switch (name)
720 {
721 case PluginName::GDrive :
722 temp.title = info.title();
>>> CID 1324470: Control flow issues (MISSING_BREAK)
>>> The above case falls through to this one.
723 default :
724 temp.title = info.name();
725 }
726
727 temp.description = info.description().section(QStringLiteral("\n"), 0, 0);
728 temp.gpsLat.setNum(info.latitude());
** CID 1324469: Control flow issues (MISSING_BREAK)
/home/gilles/Devel/5.x/extra/kipi-plugins/googleservices/gswindow.cpp: 623 in KIPIGoogleServicesPlugin::GSWindow::picasaTransferHandler()()
________________________________________________________________________________________________________
*** CID 1324469: Control flow issues (MISSING_BREAK)
/home/gilles/Devel/5.x/extra/kipi-plugins/googleservices/gswindow.cpp: 623 in KIPIGoogleServicesPlugin::GSWindow::picasaTransferHandler()()
617 connect(m_picsasa_talker, SIGNAL(signalListPhotosDone(int,QString,QList<GSPhoto>)),
618 this, SLOT(slotListPhotosDoneForDownload(int,QString,QList<GSPhoto>)));
619
620 m_picsasa_talker->listPhotos(m_widget->getAlbumsCoB()->itemData(m_widget->getAlbumsCoB()->currentIndex()).toString(),
621 m_widget->getDimensionCoB()->itemData(m_widget->getDimensionCoB()->currentIndex()).toString());
622
>>> CID 1324469: Control flow issues (MISSING_BREAK)
>>> The above case falls through to this one.
623 default :
624 // list photos of the album, then start upload with add/update items
625 connect(m_picsasa_talker, SIGNAL(signalListPhotosDone(int,QString,QList<GSPhoto>)),
626 this, SLOT(slotListPhotosDoneForUpload(int,QString,QList<GSPhoto>)));
627
628 m_picsasa_talker->listPhotos(m_widget->getAlbumsCoB()->itemData(m_widget->getAlbumsCoB()->currentIndex()).toString());
** CID 1324468: Incorrect expression (IDENTICAL_BRANCHES)
/core/utilities/metadataedit/moc_iptcsubjects.cpp: 85 in Digikam::IPTCSubjects::qt_metacall(QMetaObject::Call, int, void **)()
________________________________________________________________________________________________________
*** CID 1324468: Incorrect expression (IDENTICAL_BRANCHES)
/core/utilities/metadataedit/moc_iptcsubjects.cpp: 85 in Digikam::IPTCSubjects::qt_metacall(QMetaObject::Call, int, void **)()
79 return SubjectWidget::qt_metacast(_clname);
80 }
81
82 int Digikam::IPTCSubjects::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
83 {
84 _id = SubjectWidget::qt_metacall(_c, _id, _a);
>>> CID 1324468: Incorrect expression (IDENTICAL_BRANCHES)
>>> The same code is executed when the condition "_id < 0" is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed?
85 if (_id < 0)
86 return _id;
87 return _id;
88 }
** CID 1324467: Incorrect expression (IDENTICAL_BRANCHES)
/core/utilities/metadataedit/moc_xmpsubjects.cpp: 85 in Digikam::XMPSubjects::qt_metacall(QMetaObject::Call, int, void **)()
________________________________________________________________________________________________________
*** CID 1324467: Incorrect expression (IDENTICAL_BRANCHES)
/core/utilities/metadataedit/moc_xmpsubjects.cpp: 85 in Digikam::XMPSubjects::qt_metacall(QMetaObject::Call, int, void **)()
79 return SubjectWidget::qt_metacast(_clname);
80 }
81
82 int Digikam::XMPSubjects::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
83 {
84 _id = SubjectWidget::qt_metacall(_c, _id, _a);
>>> CID 1324467: Incorrect expression (IDENTICAL_BRANCHES)
>>> The same code is executed when the condition "_id < 0" is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed?
85 if (_id < 0)
86 return _id;
87 return _id;
88 }
** CID 1324466: Incorrect expression (IDENTICAL_BRANCHES)
/core/utilities/metadataedit/moc_timezonecombobox.cpp: 85 in Digikam::TimeZoneComboBox::qt_metacall(QMetaObject::Call, int, void **)()
________________________________________________________________________________________________________
*** CID 1324466: Incorrect expression (IDENTICAL_BRANCHES)
/core/utilities/metadataedit/moc_timezonecombobox.cpp: 85 in Digikam::TimeZoneComboBox::qt_metacall(QMetaObject::Call, int, void **)()
79 return QComboBox::qt_metacast(_clname);
80 }
81
82 int Digikam::TimeZoneComboBox::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
83 {
84 _id = QComboBox::qt_metacall(_c, _id, _a);
>>> CID 1324466: Incorrect expression (IDENTICAL_BRANCHES)
>>> The same code is executed when the condition "_id < 0" is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed?
85 if (_id < 0)
86 return _id;
87 return _id;
88 }
** CID 1324465: Incorrect expression (IDENTICAL_BRANCHES)
/extra/kipi-plugins/imageshack/moc_newalbumdlg.cpp: 85 in KIPIImageshackPlugin::NewAlbumDlg::qt_metacall(QMetaObject::Call, int, void **)()
________________________________________________________________________________________________________
*** CID 1324465: Incorrect expression (IDENTICAL_BRANCHES)
/extra/kipi-plugins/imageshack/moc_newalbumdlg.cpp: 85 in KIPIImageshackPlugin::NewAlbumDlg::qt_metacall(QMetaObject::Call, int, void **)()
79 return KPNewAlbumDialog::qt_metacast(_clname);
80 }
81
82 int KIPIImageshackPlugin::NewAlbumDlg::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
83 {
84 _id = KPNewAlbumDialog::qt_metacall(_c, _id, _a);
>>> CID 1324465: Incorrect expression (IDENTICAL_BRANCHES)
>>> The same code is executed when the condition "_id < 0" is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed?
85 if (_id < 0)
86 return _id;
87 return _id;
88 }
** CID 1324464: Incorrect expression (IDENTICAL_BRANCHES)
/extra/kipi-plugins/yandexfotki/moc_yfwidget.cpp: 85 in KIPIYandexFotkiPlugin::YandexFotkiWidget::qt_metacall(QMetaObject::Call, int, void **)()
________________________________________________________________________________________________________
*** CID 1324464: Incorrect expression (IDENTICAL_BRANCHES)
/extra/kipi-plugins/yandexfotki/moc_yfwidget.cpp: 85 in KIPIYandexFotkiPlugin::YandexFotkiWidget::qt_metacall(QMetaObject::Call, int, void **)()
79 return KPSettingsWidget::qt_metacast(_clname);
80 }
81
82 int KIPIYandexFotkiPlugin::YandexFotkiWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
83 {
84 _id = KPSettingsWidget::qt_metacall(_c, _id, _a);
>>> CID 1324464: Incorrect expression (IDENTICAL_BRANCHES)
>>> The same code is executed when the condition "_id < 0" is true or false, because the code in the if-then branch and after the if statement is identical. Should the if statement be removed?
85 if (_id < 0)
86 return _id;
87 return _id;
88 }
** CID 1324463: Resource leaks (CTOR_DTOR_LEAK)
/home/gilles/Devel/5.x/core/libs/dmetadata/dmetadatasettingscontainer.cpp: 62 in Digikam::DMetadataSettingsContainer::DMetadataSettingsContainer()()
________________________________________________________________________________________________________
*** CID 1324463: Resource leaks (CTOR_DTOR_LEAK)
/home/gilles/Devel/5.x/core/libs/dmetadata/dmetadatasettingscontainer.cpp: 62 in Digikam::DMetadataSettingsContainer::DMetadataSettingsContainer()()
56 QMap<QLatin1String, QList<NamespaceEntry> > readMappings;
57 QMap<QLatin1String, QList<NamespaceEntry> > writeMappings;
58 bool unifyReadWrite;
59 };
60
61 DMetadataSettingsContainer::DMetadataSettingsContainer()
>>> CID 1324463: Resource leaks (CTOR_DTOR_LEAK)
>>> The constructor allocates field "d" of "Digikam::DMetadataSettingsContainer" but the destructor and whatever functions it calls do not free it.
62 : d(new Private)
63 {
64 unifyReadWrite = false;
65 addMapping(QLatin1String(DM_TAG_CONTAINER));
66 addMapping(QLatin1String(DM_RATING_CONTAINER));
67 addMapping(QLatin1String(DM_COMMENT_CONTAINER));
** CID 1324462: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/utilities/kdesupport/ksane/ksaneaction.cpp: 81 in Digikam::KSaneAction::activate(const QString &, const QString &)()
________________________________________________________________________________________________________
*** CID 1324462: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/utilities/kdesupport/ksane/ksaneaction.cpp: 81 in Digikam::KSaneAction::activate(const QString &, const QString &)()
75 return;
76 }
77
78 if (!m_saneWidget->openDevice(dev))
79 {
80 // could not open a scanner
>>> CID 1324462: Error handling issues (CHECKED_RETURN)
>>> Calling "warning" without checking return value (as is done elsewhere 36 out of 40 times).
81 QMessageBox::warning(0, qApp->applicationName(), i18n("Cannot open scanner device."));
82 return;
83 }
84
85 ScanDialog* const dlg = new ScanDialog(m_saneWidget);
86 dlg->setTargetDir(targetDir);
** CID 1324461: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/sendimages/sendimages.cpp: 303 in KIPISendimagesPlugin::SendImages::buildPropertiesFile()()
________________________________________________________________________________________________________
*** CID 1324461: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/sendimages/sendimages.cpp: 303 in KIPISendimagesPlugin::SendImages::buildPropertiesFile()()
297 }
298
299 QFile propertiesFile( d->settings.tempPath + i18n("properties.txt") );
300 QTextStream stream( &propertiesFile );
301 stream.setCodec(QTextCodec::codecForName("UTF-8"));
302 stream.setAutoDetectUnicode(true);
>>> CID 1324461: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 88 out of 106 times).
303 propertiesFile.open(QIODevice::WriteOnly);
304 stream << propertiesText << QLatin1String("\n");
305 propertiesFile.close();
306 d->attachementFiles << QUrl(propertiesFile.fileName());
307
308 d->progressDlg->progressWidget()->addedAction(i18n("Image properties file done"), SuccessMessage);
** CID 1324460: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/mediawiki/wikimediajob.cpp: 145 in KIPIWikiMediaPlugin::WikiMediaJob::uploadHandle(KJob *)()
________________________________________________________________________________________________________
*** CID 1324460: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/mediawiki/wikimediajob.cpp: 145 in KIPIWikiMediaPlugin::WikiMediaJob::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 1324460: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 88 out of 106 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 1324459: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/kmlexport/kmlexport.cpp: 516 in KIPIKMLExportPlugin::KmlExport::generate()()
________________________________________________________________________________________________________
*** CID 1324459: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/kmlexport/kmlexport.cpp: 516 in KIPIKMLExportPlugin::KmlExport::generate()()
510 "No position data for %1 pictures", defectImage));
511 }
512
513 /** @todo change to kml or kmz if compressed */
514 QFile file(m_tempDestDir.filePath(m_KMLFileName + QLatin1String(".kml")));
515 /** @todo handle file opening problems */
>>> CID 1324459: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 88 out of 106 times).
516 file.open( QIODevice::WriteOnly );
517 QTextStream stream( &file ); // we will serialize the data into the file
518 stream << m_kmlDocument->toString();
519 file.close();
520
521 delete m_kmlDocument;
** CID 1324458: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/kmlexport/kmlexport.cpp: 191 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: 191 in KIPIKMLExportPlugin::KmlExport::generateImagesthumb(const QUrl &, QDomElement &)()
185 {
186 logWarning(i18n("Format of image '%1' is unknown",path));
187 return;
188 }
189
190 imageFile.close();
>>> CID 1324458: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 88 out of 106 times).
191 imageFile.open(QIODevice::ReadOnly);
192
193 QByteArray imageData = imageFile.readAll();
194 QImage image;
195
196 if (!image.loadFromData(imageData) )
** CID 1324457: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 387 in KIPIFlashExportPlugin::SimpleViewer::exportImages()()
________________________________________________________________________________________________________
*** CID 1324457: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/flashexport/simpleviewer.cpp: 387 in KIPIFlashExportPlugin::SimpleViewer::exportImages()()
381
382 d->progressWdg->addedAction(i18n("Creating images and thumbnails..."), StartingMessage);
383
384 QUrl xmlFile(d->tempDir->path());
385
386 QFile file(xmlFile.path());
>>> CID 1324457: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 88 out of 106 times).
387 file.open(QIODevice::WriteOnly);
388
389 // header of gallery.xml
390 QDomElement galleryElem;
391 QDomElement photosElem;
392 QDomDocument xmlDoc;
** CID 1324456: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/common/libkipiplugins/widgets/kpimageslist.cpp: 1061 in KIPIPlugins::KPImagesList::slotSaveItems()()
________________________________________________________________________________________________________
*** CID 1324456: Error handling issues (CHECKED_RETURN)
/home/gilles/Devel/5.x/extra/kipi-plugins/common/libkipiplugins/widgets/kpimageslist.cpp: 1061 in KIPIPlugins::KPImagesList::slotSaveItems()()
1055 {
1056 qCDebug(KIPIPLUGINS_LOG) << "empty url ";
1057 return;
1058 }
1059
1060 QFile file(saveLevelsFile.path() /*.prettyUrl().toAscii()*/);
>>> CID 1324456: Error handling issues (CHECKED_RETURN)
>>> Calling "open" without checking return value (as is done elsewhere 88 out of 106 times).
1061 file.open(QIODevice::WriteOnly);
1062 // file.open(stdout, QIODevice::WriteOnly);
1063
1064 QXmlStreamWriter xmlWriter;
1065 xmlWriter.setDevice(&file);
1066
________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://scan.coverity.com/projects/digikam?tab=overview
To manage Coverity Scan email notifications for "digikam-devel at kde.org", click https://scan.coverity.com/subscriptions/edit?email=digikam-devel%40kde.org&token=621bfe7450f4a870432a2a9c106aa3a8
More information about the Digikam-devel
mailing list