Closed Bug 1167531 Opened 7 years ago Closed 7 years ago

Uninitialised value uses relating to GonkDisplayJB::GonkDisplayJB

Categories

(Core Graveyard :: Widget: Gonk, defect)

ARM
Gonk (Firefox OS)
defect
Not set
normal

Tracking

(firefox41 fixed)

RESOLVED FIXED
mozilla41
Tracking Status
firefox41 --- fixed

People

(Reporter: jseward, Assigned: jseward)

Details

Attachments

(2 files)

GonkDisplayJB::GonkDisplayJB allocates a secondary structure

GonkDisplayJB.cpp:132
    mList = (hwc_display_contents_1_t *)malloc(sizeof(*mList) + (sizeof(hwc_layer_1_t)*2));

Some but not all of mList's many fields are filled in in GonkDisplayJB::Post.
It appears that some of these fields (5, I suspect) are used uninitialised
shortly thereafter.
Attached file Valgrind complaints
* Allocates mList using calloc so as to ensure that all fields are defined

* [optional cleanup] sets GonkDisplayJB::{mWidth,mHeight} right at the
  start of GonkDisplayJB::GonkDisplayJB so as to make it obvious to all
  that these fields have an initial value regardless of the control flow
  in the constructor body.
Attachment #8609262 - Flags: review?(mwu)
Attachment #8609262 - Flags: review?(mwu) → review+
https://hg.mozilla.org/mozilla-central/rev/ec2a1ba41a7a
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla41
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.