New Defects reported by Coverity Scan for digiKam

scan-admin at coverity.com scan-admin at coverity.com
Wed May 17 18:02:13 BST 2017


Hi,

Please find the latest report on new defect(s) introduced to digiKam found with Coverity Scan.

11 new defect(s) introduced to digiKam found with Coverity Scan.
8 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 11 of 11 defect(s)


** CID 1409691:    (TAINTED_SCALAR)


________________________________________________________________________________________________________
*** CID 1409691:    (TAINTED_SCALAR)
/home/gilles/Devel/5.x/core/libs/facesengine/alignment-congealing/funnelreal.cpp: 172 in Digikam::FunnelReal::FunnelReal()()
166         if (!QFileInfo(trainingFile).exists())
167         {
168             qCritical(DIGIKAM_FACESENGINE_LOG) << "Training data for Congealing/Funnel not found. Should be at" << trainingFile;
169             return;
170         }
171     
>>>     CID 1409691:    (TAINTED_SCALAR)
>>>     Passing tainted variable "this->d->edgeDescDim" to a tainted sink.
172         d->loadTrainingData(trainingFile);
173     }
174     
175     FunnelReal::~FunnelReal()
176     {
177         delete d;
/home/gilles/Devel/5.x/core/libs/facesengine/alignment-congealing/funnelreal.cpp: 172 in Digikam::FunnelReal::FunnelReal()()
166         if (!QFileInfo(trainingFile).exists())
167         {
168             qCritical(DIGIKAM_FACESENGINE_LOG) << "Training data for Congealing/Funnel not found. Should be at" << trainingFile;
169             return;
170         }
171     
>>>     CID 1409691:    (TAINTED_SCALAR)
>>>     Passing tainted variable "this->d->numFeatureClusters" to a tainted sink.
172         d->loadTrainingData(trainingFile);
173     }
174     
175     FunnelReal::~FunnelReal()
176     {
177         delete d;
/home/gilles/Devel/5.x/core/libs/facesengine/alignment-congealing/funnelreal.cpp: 172 in Digikam::FunnelReal::FunnelReal()()
166         if (!QFileInfo(trainingFile).exists())
167         {
168             qCritical(DIGIKAM_FACESENGINE_LOG) << "Training data for Congealing/Funnel not found. Should be at" << trainingFile;
169             return;
170         }
171     
>>>     CID 1409691:    (TAINTED_SCALAR)
>>>     Passing tainted variable "this->d->numRandPxls" to a tainted sink.
172         d->loadTrainingData(trainingFile);
173     }
174     
175     FunnelReal::~FunnelReal()
176     {
177         delete d;

** CID 1409690:    (TAINTED_SCALAR)
/home/gilles/Devel/5.x/core/libs/facesengine/alignment-congealing/funnelreal.cpp: 231 in Digikam::FunnelReal::Private::loadTrainingData(const QString &)()
/home/gilles/Devel/5.x/core/libs/facesengine/alignment-congealing/funnelreal.cpp: 229 in Digikam::FunnelReal::Private::loadTrainingData(const QString &)()
/home/gilles/Devel/5.x/core/libs/facesengine/alignment-congealing/funnelreal.cpp: 242 in Digikam::FunnelReal::Private::loadTrainingData(const QString &)()


________________________________________________________________________________________________________
*** CID 1409690:    (TAINTED_SCALAR)
/home/gilles/Devel/5.x/core/libs/facesengine/alignment-congealing/funnelreal.cpp: 231 in Digikam::FunnelReal::Private::loadTrainingData(const QString &)()
225             std::vector<float> cRow(edgeDescDim, 0);
226             centroids = std::vector<std::vector<float> >(numFeatureClusters, cRow);
227             sigmaSq   = std::vector<float>(numFeatureClusters);
228     
229             for(int i = 0; i < numFeatureClusters; i++)
230             {
>>>     CID 1409690:    (TAINTED_SCALAR)
>>>     Using tainted variable "this->edgeDescDim" as a loop boundary.
231                 for(int j = 0; j < edgeDescDim; j++)
232                 {
233                     trainingInfo >> centroids[i][j];
234                 }
235     
236                 trainingInfo >> sigmaSq[i];
/home/gilles/Devel/5.x/core/libs/facesengine/alignment-congealing/funnelreal.cpp: 229 in Digikam::FunnelReal::Private::loadTrainingData(const QString &)()
223             trainingInfo >> numFeatureClusters >> edgeDescDim;
224     
225             std::vector<float> cRow(edgeDescDim, 0);
226             centroids = std::vector<std::vector<float> >(numFeatureClusters, cRow);
227             sigmaSq   = std::vector<float>(numFeatureClusters);
228     
>>>     CID 1409690:    (TAINTED_SCALAR)
>>>     Using tainted variable "this->numFeatureClusters" as a loop boundary.
229             for(int i = 0; i < numFeatureClusters; i++)
230             {
231                 for(int j = 0; j < edgeDescDim; j++)
232                 {
233                     trainingInfo >> centroids[i][j];
234                 }
/home/gilles/Devel/5.x/core/libs/facesengine/alignment-congealing/funnelreal.cpp: 242 in Digikam::FunnelReal::Private::loadTrainingData(const QString &)()
236                 trainingInfo >> sigmaSq[i];
237             }
238     
239             trainingInfo >> numRandPxls;
240             randPxls = std::vector<std::pair<int, int> >(numRandPxls);
241     
>>>     CID 1409690:    (TAINTED_SCALAR)
>>>     Using tainted variable "this->numRandPxls" as a loop boundary.
242             for(int j = 0; j < numRandPxls; j++)
243                 trainingInfo >> randPxls[j].first >> randPxls[j].second;
244     
245             std::vector<float>                dfCol(numFeatureClusters, 0);
246             std::vector<std::vector<float> >  logDistField(numRandPxls, dfCol);
247     

** CID 1409689:  Integer handling issues  (SIGN_EXTENSION)
/home/gilles/Devel/5.x/core/libs/rawengine/drawdecoder.cpp: 437 in Digikam::DRawDecoder::extractRAWData(const QString &, QByteArray &, Digikam::RawInfo &, unsigned int)()


________________________________________________________________________________________________________
*** CID 1409689:  Integer handling issues  (SIGN_EXTENSION)
/home/gilles/Devel/5.x/core/libs/rawengine/drawdecoder.cpp: 437 in Digikam::DRawDecoder::extractRAWData(const QString &, QByteArray &, Digikam::RawInfo &, unsigned int)()
431                     }
432                 }
433             }
434         }
435         else
436         {
>>>     CID 1409689:  Integer handling issues  (SIGN_EXTENSION)
>>>     Suspicious implicit sign extension: "raw.imgdata.sizes.iheight" with type "ushort" (16 bits, unsigned) is promoted in "raw.imgdata.sizes.iwidth * raw.imgdata.sizes.iheight" to type "int" (32 bits, signed), then sign-extended to type "unsigned long" (64 bits, unsigned).  If "raw.imgdata.sizes.iwidth * raw.imgdata.sizes.iheight" is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
437             rawData.resize((int)(raw.imgdata.sizes.iwidth * raw.imgdata.sizes.iheight * sizeof(unsigned short)));
438     
439             unsigned short* output = reinterpret_cast<unsigned short*>(rawData.data());
440     
441             for (uint row = 0; row < raw.imgdata.sizes.iheight; row++)
442             {

** CID 1409688:  Integer handling issues  (SIGN_EXTENSION)
/home/gilles/Devel/5.x/core/libs/rawengine/drawdecoder.cpp: 437 in Digikam::DRawDecoder::extractRAWData(const QString &, QByteArray &, Digikam::RawInfo &, unsigned int)()


________________________________________________________________________________________________________
*** CID 1409688:  Integer handling issues  (SIGN_EXTENSION)
/home/gilles/Devel/5.x/core/libs/rawengine/drawdecoder.cpp: 437 in Digikam::DRawDecoder::extractRAWData(const QString &, QByteArray &, Digikam::RawInfo &, unsigned int)()
431                     }
432                 }
433             }
434         }
435         else
436         {
>>>     CID 1409688:  Integer handling issues  (SIGN_EXTENSION)
>>>     Suspicious implicit sign extension: "raw.imgdata.sizes.iwidth" with type "ushort" (16 bits, unsigned) is promoted in "raw.imgdata.sizes.iwidth * raw.imgdata.sizes.iheight" to type "int" (32 bits, signed), then sign-extended to type "unsigned long" (64 bits, unsigned).  If "raw.imgdata.sizes.iwidth * raw.imgdata.sizes.iheight" is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
437             rawData.resize((int)(raw.imgdata.sizes.iwidth * raw.imgdata.sizes.iheight * sizeof(unsigned short)));
438     
439             unsigned short* output = reinterpret_cast<unsigned short*>(rawData.data());
440     
441             for (uint row = 0; row < raw.imgdata.sizes.iheight; row++)
442             {

** CID 1409687:  Incorrect expression  (IDENTICAL_BRANCHES)
/core/libs/facesengine/digikamfacesenginedatabase_src_automoc.dir/moc_facedbbackend_A6FXOTEETTES3P.cpp: 85 in Digikam::FaceDbBackend::qt_metacall(QMetaObject::Call, int, void **)()


________________________________________________________________________________________________________
*** CID 1409687:  Incorrect expression  (IDENTICAL_BRANCHES)
/core/libs/facesengine/digikamfacesenginedatabase_src_automoc.dir/moc_facedbbackend_A6FXOTEETTES3P.cpp: 85 in Digikam::FaceDbBackend::qt_metacall(QMetaObject::Call, int, void **)()
79         return BdEngineBackend::qt_metacast(_clname);
80     }
81     
82     int Digikam::FaceDbBackend::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
83     {
84         _id = BdEngineBackend::qt_metacall(_c, _id, _a);
>>>     CID 1409687:  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 1409686:  Incorrect expression  (IDENTICAL_BRANCHES)
/core/libs/rawengine/rawengine_srcs_automoc.dir/moc_drawdecoder_L6FX25ZVJCYR2G.cpp: 85 in Digikam::DRawDecoder::qt_metacall(QMetaObject::Call, int, void **)()


________________________________________________________________________________________________________
*** CID 1409686:  Incorrect expression  (IDENTICAL_BRANCHES)
/core/libs/rawengine/rawengine_srcs_automoc.dir/moc_drawdecoder_L6FX25ZVJCYR2G.cpp: 85 in Digikam::DRawDecoder::qt_metacall(QMetaObject::Call, int, void **)()
79         return QObject::qt_metacast(_clname);
80     }
81     
82     int Digikam::DRawDecoder::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
83     {
84         _id = QObject::qt_metacall(_c, _id, _a);
>>>     CID 1409686:  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 1409685:  Incorrect expression  (IDENTICAL_BRANCHES)
/core/utilities/geolocation/editor/geolocationedit_src_automoc.dir/moc_bookmarksmngr_Y65FYR2AL5YIJA.cpp: 188 in Digikam::AddBookmarkProxyModel::qt_metacall(QMetaObject::Call, int, void **)()


________________________________________________________________________________________________________
*** CID 1409685:  Incorrect expression  (IDENTICAL_BRANCHES)
/core/utilities/geolocation/editor/geolocationedit_src_automoc.dir/moc_bookmarksmngr_Y65FYR2AL5YIJA.cpp: 188 in Digikam::AddBookmarkProxyModel::qt_metacall(QMetaObject::Call, int, void **)()
182         return QSortFilterProxyModel::qt_metacast(_clname);
183     }
184     
185     int Digikam::AddBookmarkProxyModel::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
186     {
187         _id = QSortFilterProxyModel::qt_metacall(_c, _id, _a);
>>>     CID 1409685:  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?
188         if (_id < 0)
189             return _id;
190         return _id;
191     }
192     struct qt_meta_stringdata_Digikam__TreeProxyModel_t {
193         QByteArrayData data[3];

** CID 1409684:  Incorrect expression  (IDENTICAL_BRANCHES)
/core/utilities/geolocation/editor/geolocationedit_src_automoc.dir/moc_simpletreemode_CD25V4QO7KOL62.cpp: 85 in Digikam::SimpleTreeModel::qt_metacall(QMetaObject::Call, int, void **)()


________________________________________________________________________________________________________
*** CID 1409684:  Incorrect expression  (IDENTICAL_BRANCHES)
/core/utilities/geolocation/editor/geolocationedit_src_automoc.dir/moc_simpletreemode_CD25V4QO7KOL62.cpp: 85 in Digikam::SimpleTreeModel::qt_metacall(QMetaObject::Call, int, void **)()
79         return QAbstractItemModel::qt_metacast(_clname);
80     }
81     
82     int Digikam::SimpleTreeModel::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
83     {
84         _id = QAbstractItemModel::qt_metacall(_c, _id, _a);
>>>     CID 1409684:  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 1409683:  Error handling issues  (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/utilities/geolocation/editor/bookmark/bookmarknode.cpp: 157 in Digikam::XbelReader::read(const QString &)()


________________________________________________________________________________________________________
*** CID 1409683:  Error handling issues  (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/utilities/geolocation/editor/bookmark/bookmarknode.cpp: 157 in Digikam::XbelReader::read(const QString &)()
151     
152         if (!file.exists())
153         {
154             return new BookmarkNode(BookmarkNode::Root);
155         }
156     
>>>     CID 1409683:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "open" without checking return value (as is done elsewhere 111 out of 113 times).
157         file.open(QFile::ReadOnly);
158     
159         return read(&file);
160     }
161     
162     BookmarkNode* XbelReader::read(QIODevice* device)

** CID 1409682:  Error handling issues  (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/utilities/geolocation/editor/bookmark/bookmarksmngr.cpp: 669 in Digikam::BookmarksManager::load()()


________________________________________________________________________________________________________
*** CID 1409682:  Error handling issues  (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/utilities/geolocation/editor/bookmark/bookmarksmngr.cpp: 669 in Digikam::BookmarksManager::load()()
663     
664         XbelReader reader;
665         d->bookmarkRootNode = reader.read(d->bookmarksFile);
666     
667         if (reader.error() != QXmlStreamReader::NoError)
668         {
>>>     CID 1409682:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "warning" without checking return value (as is done elsewhere 41 out of 49 times).
669             QMessageBox::warning(0, i18n("Loading Bookmark"),
670                                  i18n("Error when loading bookmarks on line %1, column %2:\n%3")
671                                  .arg(reader.lineNumber())
672                                  .arg(reader.columnNumber())
673                                  .arg(reader.errorString()));
674         }

** CID 1409681:  Error handling issues  (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/utilities/geolocation/editor/bookmark/bookmarksmngr.cpp: 772 in Digikam::BookmarksManager::importBookmarks()()


________________________________________________________________________________________________________
*** CID 1409681:  Error handling issues  (CHECKED_RETURN)
/home/gilles/Devel/5.x/core/utilities/geolocation/editor/bookmark/bookmarksmngr.cpp: 772 in Digikam::BookmarksManager::importBookmarks()()
766     
767         XbelReader reader;
768         BookmarkNode* const importRootNode = reader.read(fileName);
769     
770         if (reader.error() != QXmlStreamReader::NoError)
771         {
>>>     CID 1409681:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "warning" without checking return value (as is done elsewhere 41 out of 49 times).
772             QMessageBox::warning(0, i18n("Loading Bookmark"),
773                                  i18n("Error when loading bookmarks on line %1, column %2:\n%3")
774                                  .arg(reader.lineNumber())
775                                  .arg(reader.columnNumber())
776                                  .arg(reader.errorString()));
777         }


________________________________________________________________________________________________________
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-2BzKk1Nu56XtBupWJitvnTDtR1Rf2yDRCltuNMxTmcC8ZNhYFJFZyUAgJc-2BwJIS6suZajpv6kr4Pg9kG9kDUWUPia5bj4aip2BcrUha06puYEv8sehV0z93LspR11XRJoYrAcbOTk4JJTV-2FOepqxOZnZR4o-2BOJ0AWY-2FNCRuZHjNNG32Nz4i-2BPA-2Bfc3eDToZFKKGGJ2C6-2FYPnCdItzjOQ8U4-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-2BzKk1Nu56XtBupWJitvnTDtR1Rf2yDRCltuNMxTmcC8WkyS5yA6b9fV9s26-2BxVPmMd2Q85w1-2FWsnP1UwFckOS9tezFs8WYNPne-2FLXQZNwFedZ-2FD0AIvpNClE-2F1Vw9Bb-2BzfZZhQtIf7YHuk5Fy22wcIJ-2FrmNStlLj2UwBCRKcOMNiVqAK0o-2Fbb708teg9bKN8p-2FyTcXF-2Fsf-2FerCKeZe0nmY-3D




More information about the Digikam-devel mailing list