New Defects reported by Coverity Scan for RTEMS-Tools

scan-admin at coverity.com scan-admin at coverity.com
Wed Apr 7 17:20:27 UTC 2021


Hi,

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

4 new defect(s) introduced to RTEMS-Tools found with Coverity Scan.
3 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 4 of 4 defect(s)


** CID 1503711:  Resource leaks  (RESOURCE_LEAK)
/tester/covoar/ReportsBase.cc: 554 in Coverage::ReportsBase::WriteSummaryReport(const char *, const char *)()


________________________________________________________________________________________________________
*** CID 1503711:  Resource leaks  (RESOURCE_LEAK)
/tester/covoar/ReportsBase.cc: 554 in Coverage::ReportsBase::WriteSummaryReport(const char *, const char *)()
548         fprintf(
549           report,
550           "Percentage branch paths covered  : %4.4g\n",
551           100.0 - percentageBranches
552         );
553       }
>>>     CID 1503711:  Resource leaks  (RESOURCE_LEAK)
>>>     Variable "report" going out of scope leaks the storage it points to.
554     }
555     
556     void GenerateReports(const std::string& symbolSetName)
557     {
558       typedef std::list<ReportsBase *> reportList_t;
559     

** CID 1503710:  Null pointer dereferences  (FORWARD_NULL)


________________________________________________________________________________________________________
*** CID 1503710:  Null pointer dereferences  (FORWARD_NULL)
/tester/covoar/ReportsBase.cc: 225 in Coverage::ReportsBase::WriteAnnotatedReport(const char *)()
219         if ((info.uncoveredRanges == NULL) &&
220             (info.uncoveredBranches == NULL))
221           continue;
222     
223         // If uncoveredRanges and uncoveredBranches are empty, then everything
224         // must have been covered for this symbol.  Just skip it.
>>>     CID 1503710:  Null pointer dereferences  (FORWARD_NULL)
>>>     Passing null pointer "info.uncoveredRanges->set" to "empty", which dereferences it.
225         if ((info.uncoveredRanges->set.empty()) &&
226             (info.uncoveredBranches->set.empty()))
227           continue;
228     
229         theCoverageMap = info.unifiedCoverageMap;
230         bAddress = info.baseAddress;

** CID 1503709:  Incorrect expression  (DIVIDE_BY_ZERO)
/tester/covoar/ReportsBase.cc: 486 in Coverage::ReportsBase::WriteSummaryReport(const char *, const char *)()


________________________________________________________________________________________________________
*** CID 1503709:  Incorrect expression  (DIVIDE_BY_ZERO)
/tester/covoar/ReportsBase.cc: 486 in Coverage::ReportsBase::WriteSummaryReport(const char *, const char *)()
480               notExecuted++;
481           }
482         }
483       }
484     
485       percentage = (double) notExecuted;
>>>     CID 1503709:  Incorrect expression  (DIVIDE_BY_ZERO)
>>>     In expression "percentage /= (double)totalBytes", division by expression "totalBytes" which may be zero has undefined behavior.
486       percentage /= (double) totalBytes;
487       percentage *= 100.0;
488     
489       percentageBranches = (double) (
490         SymbolsToAnalyze->getNumberBranchesAlwaysTaken(symbolSetName) +
491           SymbolsToAnalyze->getNumberBranchesNeverTaken(symbolSetName) +

** CID 1503708:  Uninitialized members  (UNINIT_CTOR)
/tester/covoar/ReportsHtml.cc: 38 in Coverage::ReportsHtml::ReportsHtml(long, std::basic_string<char, std::char_traits<char>, std::allocator<char>>)()


________________________________________________________________________________________________________
*** CID 1503708:  Uninitialized members  (UNINIT_CTOR)
/tester/covoar/ReportsHtml.cc: 38 in Coverage::ReportsHtml::ReportsHtml(long, std::basic_string<char, std::char_traits<char>, std::allocator<char>>)()
32     namespace Coverage {
33     
34       ReportsHtml::ReportsHtml( time_t timestamp, std::string symbolSetName ):
35         ReportsBase( timestamp, symbolSetName )
36       {
37         reportExtension_m = ".html";
>>>     CID 1503708:  Uninitialized members  (UNINIT_CTOR)
>>>     Non-static class member "lastState_m" is not initialized in this constructor nor in any functions that it calls.
38       }
39     
40       ReportsHtml::~ReportsHtml()
41       {
42       }
43     


________________________________________________________________________________________________________
To view the defects in Coverity Scan visit, https://u15810271.ct.sendgrid.net/ls/click?upn=HRESupC-2F2Czv4BOaCWWCy7my0P0qcxCbhZ31OYv50ypUUzi-2FdSNmuyRB7BEFT8xQi8c7-2B1U0roIV5G3HXifs2odF2CS2aZ-2FK5CtfMSQ5p34-3DpAI5_EU3W9teASMK00lBXX9WT4lsogDrkCcNZLvg-2FVxwAXMpaeOOV0nGMdkAGR992uNv-2BAnvYROM7N3y8kBZ4-2F5FBJ-2FRNljiaVxiD3gMvNQSVIJlKwnX0Lz-2FI1X-2FEDmTNHaHztWap3mKUko07l02iALuRVu7-2FphOIwGmw-2Fiqzs9MSu5WDrScFrYjVolaUEHzeCshlTBpSDWfT9O0-2B5pn8tmabvw-3D-3D



More information about the build mailing list