[Digikam-devel] Fwd: New Defects reported by Coverity Scan for digiKam

Gilles Caulier caulier.gilles at gmail.com
Tue May 21 17:15:35 BST 2013


---------- Forwarded message ----------
From: <scan-admin at coverity.com>
Date: 2013/5/21
Subject: New Defects reported by Coverity Scan for digiKam
To: caulier.gilles at gmail.com



Hi,

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

Defect(s) Reported-by: Coverity Scan
Showing 7 of 29 defects

** CID 1025425: Uninitialized pointer field (UNINIT_CTOR)
/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databaseoperationgroup.cpp:
48

** CID 1025424: Uninitialized pointer field (UNINIT_CTOR)
/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databasecorebackend.cpp:
90

** CID 1025423: Uncaught exception (UNCAUGHT_EXCEPT)
/mnt/devel/GIT/3.x/extra/libkface/test/recognize.cpp: 91

** CID 1025422: Unintended sign extension (SIGN_EXTENSION)
/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1145

** CID 1025421: Unintended sign extension (SIGN_EXTENSION)
/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1068

** CID 1025420: Unintended sign extension (SIGN_EXTENSION)
/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1068

** CID 1025419: Unintended sign extension (SIGN_EXTENSION)
/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1145


________________________________________________________________________
CID 1025425: Uninitialized pointer field (UNINIT_CTOR)

/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databaseoperationgroup.cpp:
53 ( member_decl)
   50    public:
   51
   52        DatabaseAccess*     access;
>>> Class member declaration for "db".
   53        DatabaseAccessData* db;
   54        bool            acquired;
   55        QTime           timeAcquired;
   56        int             maxTime;
   57


/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databaseoperationgroup.cpp:
48 ( uninit_member)
   45            access   = 0;
   46            acquired = false;
   47            maxTime  = 0;
>>> CID 1025425: Uninitialized pointer field (UNINIT_CTOR)
>>> Non-static class member "db" is not initialized in this constructor nor
in any functions that it calls.
   48        }
   49
   50    public:
   51
   52        DatabaseAccess*     access;

________________________________________________________________________
CID 1025424: Uninitialized pointer field (UNINIT_CTOR)

/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databasecorebackend_p.h:
104 ( member_decl)
   101
   102        DatabaseCoreBackend::Status               status;
   103
>>> Class member declaration for "lock".
   104        DatabaseLocking*                          lock;
   105
   106        DatabaseCoreBackend::QueryOperationStatus operationStatus;
   107
   108        QMutex                                    errorLockMutex;


/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databasecorebackend.cpp:
90 ( uninit_member)
   87        isInTransaction = false;
   88        operationStatus = DatabaseCoreBackend::ExecuteNormal;
   89        errorHandler    = 0;
>>> Non-static class member "lock" is not initialized in this constructor
nor in any functions that it calls.
   90    }
   91
   92    void DatabaseCoreBackendPrivate::init(const QString& name,
DatabaseLocking* l)
   93    {
   94        QObject::connect(QCoreApplication::instance(),
SIGNAL(aboutToQuit()),


/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databasecorebackend_p.h:
110 ( member_decl)
   107
   108        QMutex                                    errorLockMutex;
   109        QWaitCondition                            errorLockCondVar;
>>> Class member declaration for "errorLockOperationStatus".
   110        DatabaseCoreBackend::QueryOperationStatus
errorLockOperationStatus;
   111
   112        QMutex                                    busyWaitMutex;
   113        QWaitCondition                            busyWaitCondVar;
   114


/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databasecorebackend.cpp:
90 ( uninit_member)
   87        isInTransaction = false;
   88        operationStatus = DatabaseCoreBackend::ExecuteNormal;
   89        errorHandler    = 0;
>>> CID 1025424: Uninitialized pointer field (UNINIT_CTOR)
>>> Non-static class member "errorLockOperationStatus" is not initialized
in this constructor nor in any functions that it calls.
   90    }
   91
   92    void DatabaseCoreBackendPrivate::init(const QString& name,
DatabaseLocking* l)
   93    {
   94        QObject::connect(QCoreApplication::instance(),
SIGNAL(aboutToQuit()),

________________________________________________________________________
CID 1025423: Uncaught exception (UNCAUGHT_EXCEPT)

/mnt/devel/GIT/3.x/extra/libkface/test/recognize.cpp: 91 ( root_function)
   88    };
   89
   90
>>> CID 1025423: Uncaught exception (UNCAUGHT_EXCEPT)
>>> In function "main" an exception of type "int" is thrown and never
caught.
   91    int main(int argc, char** argv)
   92    {
   93        if (argc < 2 || (argv[1] == QLatin1String("train") && argc <
3))
   94        {
   95            kDebug() << "Bad Args!!!\nUsage: " << argv[0] << "
identify <image1> <image2> ... |train name <image1> <image2> ... "


/mnt/devel/GIT/3.x/extra/libkface/test/recognize.cpp: 111 (
fun_call_w_exception)
   108
   109            QTime time;
   110            time.start();
>>> Called function throws an exception of type "int".
   111            QList<Identity> identities = db.recognizeFaces(images);
   112            int elapsed = time.elapsed();
   113
   114            qDebug() << "Recognition took" << elapsed << "for" <<
images.size() << "," << ((float)elapsed/images.size()) << "per image";
   115            for (int i = 0; i<paths.size(); i++)

________________________________________________________________________
CID 1025422: Unintended sign extension (SIGN_EXTENSION)

/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1145 (
sign_extension)
   1142
 S.width*sizeof(*imgdata.image));
   1143
   1144                            else
>>> CID 1025422: Unintended sign extension (SIGN_EXTENSION)
>>> Suspicious implicit sign extension: "this->imgdata.sizes.width" with
type "unsigned short" (16 bits, unsigned) is promoted in
"this->imgdata.sizes.width * this->imgdata.sizes.height" to type "int" (32
bits, signed), then sign-extended to type "unsigned long" (64 bits,
unsigned).  If "this->imgdata.sizes.width * this->imgdata.sizes.height" is
greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
   1145
 memmove(imgdata.image,imgdata.rawdata.color_image,
   1146
 S.width*S.height*sizeof(*imgdata.image));
   1147                        }
   1148
   1149                    if(imgdata.rawdata.use_ph1_correct) // Phase one
unpacked!

________________________________________________________________________
CID 1025421: Unintended sign extension (SIGN_EXTENSION)

/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1068 (
sign_extension)
   1065
   1066                    if(imgdata.image)
   1067                        {
>>> CID 1025421: Unintended sign extension (SIGN_EXTENSION)
>>> Suspicious implicit sign extension: "this->imgdata.sizes.iwidth" with
type "unsigned short" (16 bits, unsigned) is promoted in
"this->imgdata.sizes.iheight * this->imgdata.sizes.iwidth" to type "int"
(32 bits, signed), then sign-extended to type "unsigned long" (64 bits,
unsigned).  If "this->imgdata.sizes.iheight * this->imgdata.sizes.iwidth"
is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
   1068                            imgdata.image = (ushort (*)[4]) realloc
(imgdata.image,S.iheight*S.iwidth
   1069
*sizeof (*imgdata.image));
   1070
 memset(imgdata.image,0,S.iheight*S.iwidth *sizeof (*imgdata.image));
   1071                        }
   1072                    else

________________________________________________________________________
CID 1025420: Unintended sign extension (SIGN_EXTENSION)

/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1068 (
sign_extension)
   1065
   1066                    if(imgdata.image)
   1067                        {
>>> CID 1025420: Unintended sign extension (SIGN_EXTENSION)
>>> Suspicious implicit sign extension: "this->imgdata.sizes.iheight" with
type "unsigned short" (16 bits, unsigned) is promoted in
"this->imgdata.sizes.iheight * this->imgdata.sizes.iwidth" to type "int"
(32 bits, signed), then sign-extended to type "unsigned long" (64 bits,
unsigned).  If "this->imgdata.sizes.iheight * this->imgdata.sizes.iwidth"
is greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
   1068                            imgdata.image = (ushort (*)[4]) realloc
(imgdata.image,S.iheight*S.iwidth
   1069
*sizeof (*imgdata.image));
   1070
 memset(imgdata.image,0,S.iheight*S.iwidth *sizeof (*imgdata.image));
   1071                        }
   1072                    else

________________________________________________________________________
CID 1025419: Unintended sign extension (SIGN_EXTENSION)

/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1145 (
sign_extension)
   1142
 S.width*sizeof(*imgdata.image));
   1143
   1144                            else
>>> CID 1025419: Unintended sign extension (SIGN_EXTENSION)
>>> Suspicious implicit sign extension: "this->imgdata.sizes.height" with
type "unsigned short" (16 bits, unsigned) is promoted in
"this->imgdata.sizes.width * this->imgdata.sizes.height" to type "int" (32
bits, signed), then sign-extended to type "unsigned long" (64 bits,
unsigned).  If "this->imgdata.sizes.width * this->imgdata.sizes.height" is
greater than 0x7FFFFFFF, the upper bits of the result will all be 1.
   1145
 memmove(imgdata.image,imgdata.rawdata.color_image,
   1146
 S.width*S.height*sizeof(*imgdata.image));
   1147                        }
   1148
   1149                    if(imgdata.rawdata.use_ph1_correct) // Phase one
unpacked!

________________________________________________________________________
To view the defects in Coverity Scan visit, http://scan.coverity.com

To unsubscribe from the email notification for new defects,
http://scan5.coverity.com/cgi-bin/unsubscribe.py
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/digikam-devel/attachments/20130521/c351fe8e/attachment.html>


More information about the Digikam-devel mailing list