Closed
Bug 620184
Opened 15 years ago
Closed 15 years ago
remove null checks from GetDOMSlots() and rename it to DOMSlots() because it is infallible in m-c
Categories
(Core :: DOM: Core & HTML, enhancement)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla2.0b9
People
(Reporter: timeless, Assigned: timeless)
References
(Blocks 1 open bug)
Details
(Keywords: coverity)
Attachments
(1 file, 1 obsolete file)
|
3.90 KB,
patch
|
timeless
:
review+
|
Details | Diff | Splinter Review |
248 nsStyledElement::GetStyle(nsresult* retval)
259 nsGenericElement::nsDOMSlots *slots = GetDOMSlots();
261 if (!slots->mStyle) {
this is the only place which doesn't null check GetDOMSlots(), coverity thinks this is suspicious.
It looks to me like slots creation uses infallible malloc (nsINode::CreateSlots), and therefore the things that null-check it all shouldn't be null-checking it anymore.
That said, before we had infallible malloc this does look like a valid OOM crash bug.
Component: Style System (CSS) → DOM
QA Contact: style-system → general
afaict 1.9.2 and 1.9.1 have null checks there
Severity: critical → enhancement
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: crash
Summary: potential crash [@ nsStyledElement::GetStyle] if GetDOMSlots() can return null here → remove null checks from GetDOMSlots() because it is infallible in m-c
Assignee: nobody → timeless
Status: NEW → ASSIGNED
Attachment #498581 -
Flags: review?(dbaron)
Attachment #498581 -
Flags: approval2.0?
Attachment #498581 -
Flags: review?(dbaron) → review?(jonas)
Comment on attachment 498581 [details] [diff] [review]
remove checks
Please also rename the function to DOMSlots(). We usually drop the "Get" for functions that never return null.
Attachment #498581 -
Flags: review?(jonas)
Attachment #498581 -
Flags: review+
Attachment #498581 -
Flags: approval2.0?
Attachment #498581 -
Flags: approval2.0+
Summary: remove null checks from GetDOMSlots() because it is infallible in m-c → remove null checks from GetDOMSlots() and rename it to DOMSlots() because it is infallible in m-c
Attachment #498581 -
Attachment is obsolete: true
Attachment #499198 -
Flags: review+
Keywords: checkin-needed
Comment 6•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Flags: in-testsuite-
Keywords: checkin-needed
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.0b9
Updated•8 years ago
|
Blocks: coverity-analysis
Updated•7 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•