<div dir="ltr"><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername"></b> <span dir="ltr"><<a href="mailto:scan-admin@coverity.com">scan-admin@coverity.com</a>></span><br>

Date: 2013/5/21<br>Subject: New Defects reported by Coverity Scan for digiKam<br>To: <a href="mailto:caulier.gilles@gmail.com">caulier.gilles@gmail.com</a><br><br><br><br>
Hi,<br>
<br>
Please find the latest report on new defect(s) introduced to digiKam found with Coverity Scan<br>
<br>
Defect(s) Reported-by: Coverity Scan<br>
Showing 7 of 29 defects<br>
<br>
** CID 1025425: Uninitialized pointer field (UNINIT_CTOR)<br>
/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databaseoperationgroup.cpp: 48<br>
<br>
** CID 1025424: Uninitialized pointer field (UNINIT_CTOR)<br>
/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databasecorebackend.cpp: 90<br>
<br>
** CID 1025423: Uncaught exception (UNCAUGHT_EXCEPT)<br>
/mnt/devel/GIT/3.x/extra/libkface/test/recognize.cpp: 91<br>
<br>
** CID 1025422: Unintended sign extension (SIGN_EXTENSION)<br>
/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1145<br>
<br>
** CID 1025421: Unintended sign extension (SIGN_EXTENSION)<br>
/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1068<br>
<br>
** CID 1025420: Unintended sign extension (SIGN_EXTENSION)<br>
/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1068<br>
<br>
** CID 1025419: Unintended sign extension (SIGN_EXTENSION)<br>
/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1145<br>
<br>
<br>
________________________________________________________________________<br>
CID 1025425: Uninitialized pointer field (UNINIT_CTOR)<br>
<br>
/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databaseoperationgroup.cpp: 53 ( member_decl)<br>
   50    public:<br>
   51<br>
   52        DatabaseAccess*     access;<br>
>>> Class member declaration for "db".<br>
   53        DatabaseAccessData* db;<br>
   54        bool            acquired;<br>
   55        QTime           timeAcquired;<br>
   56        int             maxTime;<br>
   57<br>
<br>
<br>
/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databaseoperationgroup.cpp: 48 ( uninit_member)<br>
   45            access   = 0;<br>
   46            acquired = false;<br>
   47            maxTime  = 0;<br>
>>> CID 1025425: Uninitialized pointer field (UNINIT_CTOR)<br>
>>> Non-static class member "db" is not initialized in this constructor nor in any functions that it calls.<br>
   48        }<br>
   49<br>
   50    public:<br>
   51<br>
   52        DatabaseAccess*     access;<br>
<br>
________________________________________________________________________<br>
CID 1025424: Uninitialized pointer field (UNINIT_CTOR)<br>
<br>
/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databasecorebackend_p.h: 104 ( member_decl)<br>
   101<br>
   102        DatabaseCoreBackend::Status               status;<br>
   103<br>
>>> Class member declaration for "lock".<br>
   104        DatabaseLocking*                          lock;<br>
   105<br>
   106        DatabaseCoreBackend::QueryOperationStatus operationStatus;<br>
   107<br>
   108        QMutex                                    errorLockMutex;<br>
<br>
<br>
/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databasecorebackend.cpp: 90 ( uninit_member)<br>
   87        isInTransaction = false;<br>
   88        operationStatus = DatabaseCoreBackend::ExecuteNormal;<br>
   89        errorHandler    = 0;<br>
>>> Non-static class member "lock" is not initialized in this constructor nor in any functions that it calls.<br>
   90    }<br>
   91<br>
   92    void DatabaseCoreBackendPrivate::init(const QString& name, DatabaseLocking* l)<br>
   93    {<br>
   94        QObject::connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()),<br>
<br>
<br>
/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databasecorebackend_p.h: 110 ( member_decl)<br>
   107<br>
   108        QMutex                                    errorLockMutex;<br>
   109        QWaitCondition                            errorLockCondVar;<br>
>>> Class member declaration for "errorLockOperationStatus".<br>
   110        DatabaseCoreBackend::QueryOperationStatus errorLockOperationStatus;<br>
   111<br>
   112        QMutex                                    busyWaitMutex;<br>
   113        QWaitCondition                            busyWaitCondVar;<br>
   114<br>
<br>
<br>
/mnt/devel/GIT/3.x/extra/libkface/libkface/database/databasecorebackend.cpp: 90 ( uninit_member)<br>
   87        isInTransaction = false;<br>
   88        operationStatus = DatabaseCoreBackend::ExecuteNormal;<br>
   89        errorHandler    = 0;<br>
>>> CID 1025424: Uninitialized pointer field (UNINIT_CTOR)<br>
>>> Non-static class member "errorLockOperationStatus" is not initialized in this constructor nor in any functions that it calls.<br>
   90    }<br>
   91<br>
   92    void DatabaseCoreBackendPrivate::init(const QString& name, DatabaseLocking* l)<br>
   93    {<br>
   94        QObject::connect(QCoreApplication::instance(), SIGNAL(aboutToQuit()),<br>
<br>
________________________________________________________________________<br>
CID 1025423: Uncaught exception (UNCAUGHT_EXCEPT)<br>
<br>
/mnt/devel/GIT/3.x/extra/libkface/test/recognize.cpp: 91 ( root_function)<br>
   88    };<br>
   89<br>
   90<br>
>>> CID 1025423: Uncaught exception (UNCAUGHT_EXCEPT)<br>
>>> In function "main" an exception of type "int" is thrown and never caught.<br>
   91    int main(int argc, char** argv)<br>
   92    {<br>
   93        if (argc < 2 || (argv[1] == QLatin1String("train") && argc < 3))<br>
   94        {<br>
   95            kDebug() << "Bad Args!!!\nUsage: " << argv[0] << " identify <image1> <image2> ... |train name <image1> <image2> ... "<br>
<br>
<br>
/mnt/devel/GIT/3.x/extra/libkface/test/recognize.cpp: 111 ( fun_call_w_exception)<br>
   108<br>
   109            QTime time;<br>
   110            time.start();<br>
>>> Called function throws an exception of type "int".<br>
   111            QList<Identity> identities = db.recognizeFaces(images);<br>
   112            int elapsed = time.elapsed();<br>
   113<br>
   114            qDebug() << "Recognition took" << elapsed << "for" << images.size() << "," << ((float)elapsed/images.size()) << "per image";<br>


   115            for (int i = 0; i<paths.size(); i++)<br>
<br>
________________________________________________________________________<br>
CID 1025422: Unintended sign extension (SIGN_EXTENSION)<br>
<br>
/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1145 ( sign_extension)<br>
   1142                                            S.width*sizeof(*imgdata.image));<br>
   1143<br>
   1144                            else<br>
>>> CID 1025422: Unintended sign extension (SIGN_EXTENSION)<br>
>>> 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.<br>


   1145                                memmove(imgdata.image,imgdata.rawdata.color_image,<br>
   1146                                        S.width*S.height*sizeof(*imgdata.image));<br>
   1147                        }<br>
   1148<br>
   1149                    if(imgdata.rawdata.use_ph1_correct) // Phase one unpacked!<br>
<br>
________________________________________________________________________<br>
CID 1025421: Unintended sign extension (SIGN_EXTENSION)<br>
<br>
/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1068 ( sign_extension)<br>
   1065<br>
   1066                    if(imgdata.image)<br>
   1067                        {<br>
>>> CID 1025421: Unintended sign extension (SIGN_EXTENSION)<br>
>>> 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.<br>


   1068                            imgdata.image = (ushort (*)[4]) realloc (imgdata.image,S.iheight*S.iwidth<br>
   1069                                                                     *sizeof (*imgdata.image));<br>
   1070                            memset(imgdata.image,0,S.iheight*S.iwidth *sizeof (*imgdata.image));<br>
   1071                        }<br>
   1072                    else<br>
<br>
________________________________________________________________________<br>
CID 1025420: Unintended sign extension (SIGN_EXTENSION)<br>
<br>
/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1068 ( sign_extension)<br>
   1065<br>
   1066                    if(imgdata.image)<br>
   1067                        {<br>
>>> CID 1025420: Unintended sign extension (SIGN_EXTENSION)<br>
>>> 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.<br>


   1068                            imgdata.image = (ushort (*)[4]) realloc (imgdata.image,S.iheight*S.iwidth<br>
   1069                                                                     *sizeof (*imgdata.image));<br>
   1070                            memset(imgdata.image,0,S.iheight*S.iwidth *sizeof (*imgdata.image));<br>
   1071                        }<br>
   1072                    else<br>
<br>
________________________________________________________________________<br>
CID 1025419: Unintended sign extension (SIGN_EXTENSION)<br>
<br>
/mnt/devel/GIT/3.x/extra/libkdcraw/libraw/src/libraw_cxx.cpp: 1145 ( sign_extension)<br>
   1142                                            S.width*sizeof(*imgdata.image));<br>
   1143<br>
   1144                            else<br>
>>> CID 1025419: Unintended sign extension (SIGN_EXTENSION)<br>
>>> 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.<br>


   1145                                memmove(imgdata.image,imgdata.rawdata.color_image,<br>
   1146                                        S.width*S.height*sizeof(*imgdata.image));<br>
   1147                        }<br>
   1148<br>
   1149                    if(imgdata.rawdata.use_ph1_correct) // Phase one unpacked!<br>
<br>
________________________________________________________________________<br>
To view the defects in Coverity Scan visit, <a href="http://scan.coverity.com" target="_blank">http://scan.coverity.com</a><br>
<br>
To unsubscribe from the email notification for new defects, <a href="http://scan5.coverity.com/cgi-bin/unsubscribe.py" target="_blank">http://scan5.coverity.com/cgi-bin/unsubscribe.py</a><br>
</div><br></div>