[RTEMS Project] #4415: ReportsBase.cc: Division or modulo by float zero error spotted by Coverity

RTEMS trac trac at rtems.org
Mon May 17 14:47:47 UTC 2021


#4415: ReportsBase.cc: Division or modulo by float zero error spotted by Coverity
------------------------+--------------------
  Reporter:  Ryan Long  |      Owner:  (none)
      Type:  defect     |     Status:  new
  Priority:  normal     |  Milestone:  6.1
 Component:  tool       |    Version:  6
  Severity:  normal     |   Keywords:
Blocked By:             |   Blocking:
------------------------+--------------------
 CID 1503709: Division or modulo by float zero in WriteSummaryReport().

 {{{
 485  percentage = (double) notExecuted;
    CID 1503709 (#1 of 1): Division or modulo by float zero
 (DIVIDE_BY_ZERO)7. 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;
 }}}

--
Ticket URL: <http://devel.rtems.org/ticket/4415>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list