[Static Analysis][Uninitialized pointer field] In constructor Paint

RESOLVED INVALID

Status

()

defect
RESOLVED INVALID
3 years ago
3 years ago

People

(Reporter: andi, Assigned: andi)

Tracking

(Blocks 2 bugs, {coverity})

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox51 affected)

Details

(Whiteboard: CID 1368332)

Attachments

(1 attachment)

The Static Analysis tool Coverity detected that |mFrame| os not initialised in the default constructor. This should be fixed in order to integrate our un-initilisation checker based on clang-analysis
Why isn't MOZ_INIT_OUTSIDE_CTOR enough here?

    // Initialized (if needed) in SetPaintServer():
    MOZ_INIT_OUTSIDE_CTOR nsIFrame* mFrame;

If we really need to rewrite this we need to remove that too.
(In reply to Robert Longson from comment #2)
> Why isn't MOZ_INIT_OUTSIDE_CTOR enough here?
> 
>     // Initialized (if needed) in SetPaintServer():
>     MOZ_INIT_OUTSIDE_CTOR nsIFrame* mFrame;
> 
> If we really need to rewrite this we need to remove that too.

Ive noticed that was initialised in SetPaintServer like mPaintType, so i initialised it for consistency with mPaintType
It's not accessed if mPaintType is none.
Attachment #8791535 - Flags: review?(longsonr) → review-
Comment on attachment 8791535 [details]
Bug 1302975 - initialise mFrame in Paint constructor.

Just do a hg pull -u and you'll find the code already looks like this.
Attachment #8791535 - Flags: review?(longsonr) → review-
yes just did this and the fix is there.
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.