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

New Defects reported by Coverity Scan for HPCC-Platform on 19th of March

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Accepted
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 7.0.0
    • Fix Version/s: None
    • Component/s: Core Libraries, eclcc, LDAP
    • Labels:
      None
    • Environment:
      OBT - Coverity Scan
    • Compatibility:
      Point

      Description

      4 new defect(s) introduced to HPCC-Platform found with Coverity Scan.

      *** CID 1465648:  Null pointer dereferences  (FORWARD_NULL)
      
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/common/thorhelper/thorcommon.cpp: 2022 in getTranslators(Owned<const IDynamicTransform> &, Owned<const IKeyTranslator>*, const char *, IOutputMetaData *, IOutputMetaData *, IOutputMetaData *, RecordTranslationMode, unsigned int, unsigned int)()
      
      2016                     throw MakeStringException(0, "Untranslatable record layout mismatch detected for file %s", tracing);
      
      2017                 if (translator->needsTranslate())
      
      2018                 \{
      
      2019                     if (RecordTranslationMode::None == mode)
      
      2020                         throw MakeStringException(0, "Translatable record layout mismatch detected for file %s, but translation disabled", tracing);
      
      2021                     if (keyedTranslator)
      
      >>>     CID 1465648:  Null pointer dereferences  (FORWARD_NULL)
      
      >>>     Passing null pointer "publishedFormat" to "queryRecordAccessor",
      
      >>> which dereferences it. (The dereference happens because this is a
      
      >>> virtual function call.)
      
      2022                         keyedTranslator->setown(createKeyTranslator(publishedFormat->queryRecordAccessor(true), expectedFormat->queryRecordAccessor(true)));
      
      2023                 }
      
      2024             }
      
      2025         }
      
      2026         return nullptr != translator.get();
      
      2027     }
      
       ___________________________________________________________________________________________________
      
      *** CID 1465647:  Uninitialized members  (UNINIT_CTOR)
      
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/ecl/hql/hqlexpr.cpp: 8027 in CFileContents::CFileContents(IFile *, IAtom *, bool, IHqlExpression *)()
      
      8021     CFileContents::CFileContents(IFile * _file, ISourcePath * _sourcePath, bool _isSigned, IHqlExpression * _gpgSignature)
      
      8022       : file(_file), sourcePath(_sourcePath), implicitlySigned(_isSigned), gpgSignature(_gpgSignature)
      
      8023     \{
      
      8024         delayedRead = false;
      
      8025         if (!preloadFromFile())
      
      8026             file.clear();
      
      >>>     CID 1465647:  Uninitialized members  (UNINIT_CTOR)
      
      >>>     Non-static class member "ts" is not initialized in this constructor nor in any functions that it calls.
      
      8027     }
      
      8028
      
      8029     CFileContents::CFileContents(const char *query, ISourcePath * _sourcePath, bool _isSigned, IHqlExpression * _gpgSignature, timestamp_type _ts)
      
      8030     : sourcePath(_sourcePath), implicitlySigned(_isSigned), gpgSignature(_gpgSignature), ts(_ts)
      
      8031     \{
      
      8032         if (query)
      
       ___________________________________________________________________________________________________
      
      *** CID 1465646:    (DEADCODE)
      
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/ecl/hqlcpp/hqlcpp.cpp: 10267 in HqlCppTranslator::doBuildExprTrim(BuildCtx &, IHqlExpression *, CHqlBoundExpr &)()
      
      10261             OwnedHqlExpr call = bindFunctionCall(func, args);
      
      10262             buildExpr(ctx, call, tgt);
      
      10263         }
      
      10264         else \{
      
      10265             if (btc == type_varstring)
      
      10266             \{
      
      >>>     CID 1465646:    (DEADCODE)
      
      >>>     Execution cannot reach this statement: "args.append(LINK(str));".
      
      10267                 args.append(*LINK(str));
      
      10268                 func = trimVStrLenId;
      
      10269             }
      
      10270             else if (btc == type_unicode)
      
      10271             \{
      
      10272                 args.append(*getBoundLength(bound));
      
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/ecl/hqlcpp/hqlcpp.cpp: 10278 in HqlCppTranslator::doBuildExprTrim(BuildCtx &, IHqlExpression *, CHqlBoundExpr &)()
      
      10272                 args.append(*getBoundLength(bound));
      
      10273                 args.append(*LINK(str));
      
      10274                 func = trimUnicodeStrLenId;
      
      10275             }
      
      10276             else if (btc == type_varunicode)
      
      10277             \{
      
      >>>     CID 1465646:    (DEADCODE)
      
      >>>     Execution cannot reach this statement: "args.append(LINK(str));".
      
      10278                 args.append(*LINK(str));
      
      10279                 func = trimVUnicodeStrLenId;
      
      10280             }
      
      10281             else if (btc == type_utf8)
      
      10282             \{
      
      10283                 args.append(*getBoundLength(bound));
      
       ________________________________________________________________________________________________________
      
      *** CID 1465645:    (CHECKED_RETURN)
      
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/system/security/LdapSecurity/ldapconnection.cpp: 2243 in CLdapClient::lookupAccount(MemoryBuffer &, StringBuffer &, ACT_TYPE &)()
      
      2237                 return false;
      
      2238             }
      
      2239
      
      2240             if(ldap_count_entries(ld, searchResult) < 1)
      
      2241             \{
      
      2242                 searchResult.ldapMsgFree();
      
      >>>     CID 1465645:    (CHECKED_RETURN)
      
      >>>     Calling "ldap_search_ext_s" without checking return value (as is done elsewhere 22 out of 24 times).
      
      2243                 ldap_search_ext_s(ld, (char*)m_ldapconfig->getGroupBasedn(), LDAP_SCOPE_SUBTREE, (char*)filter.str(), attrs, 0, NULL, NULL, &timeOut, LDAP_NO_LIMIT,   &searchResult.msg );
      
      2244                 if(ldap_count_entries(ld, searchResult) < 1)
      
      2245                 \{
      
      2246                     searchResult.ldapMsgFree();
      
      2247                     ldap_search_ext_s(ld, (char*)m_ldapconfig->getSysUserBasedn(), LDAP_SCOPE_SUBTREE, (char*)filter.str(), attrs, 0, NULL, NULL, &timeOut, LDAP_NO_LIMIT, &searchResult.msg );
      
      2248                     if(ldap_count_entries(ld, searchResult) < 1)
      
      /mnt/disk1/home/vamosax/build/CE/platform/HPCC-Platform/system/security/LdapSecurity/ldapconnection.cpp: 2247 in CLdapClient::lookupAccount(MemoryBuffer &, StringBuffer &, ACT_TYPE &)()
      
      2241             \{
      
      2242                 searchResult.ldapMsgFree();
      
      2243                 ldap_search_ext_s(ld, (char*)m_ldapconfig->getGroupBasedn(), LDAP_SCOPE_SUBTREE, (char*)filter.str(), attrs, 0, NULL, NULL, &timeOut, LDAP_NO_LIMIT,   &searchResult.msg );
      
      2244                 if(ldap_count_entries(ld, searchResult) < 1)
      
      2245                 \{
      
      2246                     searchResult.ldapMsgFree();
      
      >>>     CID 1465645:    (CHECKED_RETURN)
      
      >>>     Calling "ldap_search_ext_s" without checking return value (as is done elsewhere 22 out of 24 times).
      
      2247                     ldap_search_ext_s(ld, (char*)m_ldapconfig->getSysUserBasedn(), LDAP_SCOPE_SUBTREE, (char*)filter.str(), attrs, 0, NULL, NULL, &timeOut, LDAP_NO_LIMIT, &searchResult.msg );
      
      2248                     if(ldap_count_entries(ld, searchResult) < 1)
      
      2249                     \{
      
      2250                         DBGLOG("CLdapClient::lookupAccount No entries found");
      
      2251                         return false;
      
      2252                     }
      
       ________________________________________________________________________________________________________
      

      To view the defects in Coverity Scan visit, https://u2389337.ct.sendgrid.net/wf/click?upn=08onrYu34A-2BWcWUl-2F-2BfV0V05UPxvVjWch-2Bd2MGckcRaNjvQL1JwbRRXECNADpFWbJmd1u5Ft08MVOUAWsoMXj3-2FOk3grCOW6BgQyMmqdP24-3D_V7u2yOhiGAr-2Biu54nFTzz1cdmowKR-2FlEFg5vqux4F9sauiHMWywxI-2BQiuDUlZm9O6TRxpvbK-2FEc1nR3TCVySTc0pDALgh6B0OZJrINyjYK2cSgBgw-2FbMaU8N5h4idiMY6nm6r7-2BauPwIgwrAvakCyUIly4VCCAThJ7uBODRLz4b71-2F9cUEwduzQ3iJgien8YH7wcwmvJXuBBtEbk1f04S1vjea7WcXnqfnWdaKY6fP0-3D

        Attachments

          Activity

            People

            • Assignee:
              ghalliday Gavin Halliday
              Reporter:
              attilavamos Attila Vamos
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: