Uploaded image for project: 'HPCC'
  1. HPCC
  2. HPCC-18237

Coverity: Uninitialized members

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Not specified
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.4.2
    • Component/s: Plugins
    • Labels:
      None

      Description

      Coverity report from 4th Sept highlights the following:

       

      *** CID 1455292:  Null pointer dereferences  (REVERSE_INULL)
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/couchbase/couchbaseembed.cpp: 614 in couchbaseembed::ConnectionCacheObj::getConnection(bool, const char *, unsigned int, const char *, const char *, const char *, unsigned int)()
      608
      609                                 failx("Failed to connect to couchbase instance: %s Reason: '%s'", connectionString.str(), reason.c_str());
      610                             }
      611                         }
      612                     }
      613
      >>>     CID 1455292:  Null pointer dereferences  (REVERSE_INULL)
      >>>     Null-checking "connectionObjPtr" suggests that it may be null, but it has already been dereferenced on all paths leading to the check.
      614                     if (!connectionObjPtr)
      615                     {
      616                         failx("Couchbase: Unable to create connection: %s", connectionString.str());
      617                     }
      618
      619                     return connectionObjPtr;
       
      ** CID 1455293:  Security best practices violations  (DC.WEAK_CRYPTO)
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/couchbase/couchbaseembed.cpp: 549 in couchbaseembed::ConnectionCacheObj::getConnection(bool, const char *, unsigned int, const char *, const char *, const char *, unsigned int)()
       
       
      ________________________________________________________________________________________________________
      *** CID 1455293:  Security best practices violations  (DC.WEAK_CRYPTO)
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/couchbase/couchbaseembed.cpp: 549 in couchbaseembed::ConnectionCacheObj::getConnection(bool, const char *, unsigned int, const char *, const char *, const char *, unsigned int)()
      543                     {
      544                         // An idle connection for that particular combination of
      545                         // options does not exist so we need to create one;
      546                         // use a small loop to retry connections if necessary
      547                         unsigned int connectAttempt = 0;
      548                         unsigned int MAX_ATTEMPTS = 10;
      >>>     CID 1455293:  Security best practices violations  (DC.WEAK_CRYPTO)
      >>>     "rand" should not be used for security related applications, as linear congruential algorithms are too easy to break.
      549                         useconds_t SLEEP_TIME = 100 + (rand() % 200);
      550
      551                         while (true)
      552                         {
      553                             connectionObjPtr = new CouchbaseConnection(connectionString, password);
      554                             connectionObjPtr->connect();
       
      ** CID 1455294:  Uninitialized members  (UNINIT_CTOR)
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/couchbase/couchbaseembed.hpp: 200 in couchbaseembed::CouchbaseConnection::CouchbaseConnection(const StringBuffer &, const char *)()
       
       
      ________________________________________________________________________________________________________
      *** CID 1455294:  Uninitialized members  (UNINIT_CTOR)
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/plugins/couchbase/couchbaseembed.hpp: 200 in couchbaseembed::CouchbaseConnection::CouchbaseConnection(const StringBuffer &, const char *)()
      194                 m_pCouchbaseClient = new Couchbase::Client(connectionString.str(), password);
      195             }
      196
      197             CouchbaseConnection(const StringBuffer& connectionString, const char * password)
      198             {
      199                 m_pCouchbaseClient = new Couchbase::Client(connectionString.str(), password);
      >>>     CID 1455294:  Uninitialized members  (UNINIT_CTOR)
      >>>     Non-static class member "timeLastUsed" is not initialized in this constructor nor in any functions that it calls.
      200             }
      201
      202             virtual ~CouchbaseConnection()
      203             {
      204                 if (m_pCouchbaseClient)
      205                 {
       

        Attachments

          Activity

            People

            • Assignee:
              dcamper Dan S. Camper
              Reporter:
              ghalliday Gavin Halliday
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: