[RTEMS Project] #4389: Undefined behaviour if the area size calculation in calloc() and rtems_calloc() overflows

RTEMS trac trac at rtems.org
Wed Apr 21 05:03:30 UTC 2021


#4389: Undefined behaviour if the area size calculation in calloc() and
rtems_calloc() overflows
-----------------------------+------------------------------
 Reporter:  Sebastian Huber  |       Owner:  Sebastian Huber
     Type:  defect           |      Status:  closed
 Priority:  normal           |   Milestone:  6.1
Component:  lib              |     Version:
 Severity:  normal           |  Resolution:  fixed
 Keywords:                   |  Blocked By:
 Blocking:                   |
-----------------------------+------------------------------
Changes (by Sebastian Huber <sebastian.huber@…>):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"51defd927427b5b74c3a0c0f0b5c161929547cfc/rtems"
 51defd92/rtems]:
 {{{
 #!CommitTicketReference repository="rtems"
 revision="51defd927427b5b74c3a0c0f0b5c161929547cfc"
 Fix calloc() behaviour in case of overflow

 The multiplication to calculate the length of the memory area to
 allocate may overflow.  Return NULL in case of an overflow.

 Close #4389.
 }}}

--
Ticket URL: <http://devel.rtems.org/ticket/4389#comment:1>
RTEMS Project <http://www.rtems.org/>
RTEMS Project


More information about the bugs mailing list