Closed
Bug 1289780
Opened 8 years ago
Closed 8 years ago
[Static analysis][Uninitialized scalar field] In constructors nsReferencedElement & nsNameSpaceEntry
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla51
Tracking | Status | |
---|---|---|
firefox51 | --- | fixed |
People
(Reporter: paul.bignier, Assigned: paul.bignier)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: [CID 750495 & 750514])
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
bzbarsky
:
review+
|
Details | Diff | Splinter Review |
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Firefox/45.0
Build ID: 20160608174051
Steps to reproduce:
See attached patch.
Assignee | ||
Updated•8 years ago
|
Assignee | ||
Updated•8 years ago
|
Attachment #8775135 -
Flags: review?(bzbarsky)
Comment 1•8 years ago
|
||
Comment on attachment 8775135 [details] [diff] [review]
0001-Static-analysis-Uninitialized-scalar-field-In-constr.patch
>+ nsReferencedElement() : mReferencingImage(false) {}
Three lines, please:
nsReferencedElement()
: mReferencingImage(false)
{}
>+ nameSpaceID(0),
No, that's not ok. 0 is a perfectly valid namespace id (kNamespaceID_None).
But also, why do you really need this? The namespace id is always assigned in the one place nsNameSpaceEntry is allocated: nsXMLNameSpaceMap::AddPrefix?
I guess I would be ok with initializing to kNameSpaceID_Unknown if we do want to initialize in the constructor, though. r=me with that.
Attachment #8775135 -
Flags: review?(bzbarsky) → review+
Assignee | ||
Comment 2•8 years ago
|
||
> The namespace id is always assigned in the one place nsNameSpaceEntry is allocated: nsXMLNameSpaceMap::AddPrefix?
Thanks, I hadn't noticed that, AddPrefix() wasn't intuitive enough so I didn't suspect it being in Create().
Replaced with the moz_init_outside_ctor tag.
Paul
Attachment #8775176 -
Flags: review?(bzbarsky)
Comment 3•8 years ago
|
||
Comment on attachment 8775176 [details] [diff] [review]
0001-Static-analysis-Uninitialized-scalar-field-In-constr.patch
r=me
Attachment #8775176 -
Flags: review?(bzbarsky) → review+
Updated•8 years ago
|
Assignee: nobody → paul.bignier
Whiteboard: [Coverity 750495 & 750514] → [CID 750495 & 750514]
Assignee | ||
Updated•8 years ago
|
Attachment #8775135 -
Attachment is obsolete: true
Assignee | ||
Updated•8 years ago
|
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/563d80710d40
[Static analysis][Uninitialized scalar field] In constructors nsReferencedElement & nsNameSpaceEntry. r=bz
Keywords: checkin-needed
Comment 5•8 years ago
|
||
bugherder |
Status: UNCONFIRMED → RESOLVED
Closed: 8 years ago
status-firefox51:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla51
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•