Closed
Bug 563303
Opened 15 years ago
Closed 15 years ago
useless check of !data.index in nsContentUtils::ReparentClonedObjectToScope
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
People
(Reporter: timeless, Assigned: timeless)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: [build_warning])
Attachments
(1 file, 1 obsolete file)
(deleted),
patch
|
timeless
:
review+
|
Details | Diff | Splinter Review |
5822 nsContentUtils::ReparentClonedObjectToScope(JSContext* cx,
5833 while (!objectData.IsEmpty()) {
5836 if (!data.ids && !data.index) {
5874 }
5878 if (data.index == data.ids->length) {
http://mxr.mozilla.org/mozilla-central/source/content/base/src/nsContentUtils.cpp#5871 Sets data.ids or exits if it fails. INVALID.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → INVALID
you're assuming data.index == 0, what if data.index isn't 0?
Status: RESOLVED → REOPENED
Resolution: INVALID → ---
data.index is initialized to 0 and it's only ever set to a nonzero value if data.ids is nonzero. Since it's impossible to have a null data.ids without failing I don't see any bug here. Please correct me or close this bug as appropriate.
Assignee: nobody → timeless
Severity: critical → trivial
Status: REOPENED → ASSIGNED
Keywords: crash
Summary: crash [@ nsContentUtils::ReparentClonedObjectToScope] if !data.ids → useless check of !data.index in nsContentUtils::ReparentClonedObjectToScope
Attachment #443371 -
Flags: review?(bent.mozilla)
Comment on attachment 443371 [details] [diff] [review]
patch
>- if (!data.ids && !data.index) {
>+ if (!data.ids) {
Can you add NS_ASSERTION(!data.index, "Shouldn't have index here") right here? r=me with that.
Attachment #443371 -
Flags: review?(bent.mozilla) → review+
Attachment #443371 -
Attachment is obsolete: true
Attachment #443459 -
Flags: review+
Updated•15 years ago
|
Keywords: checkin-needed
Comment 7•15 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 15 years ago → 15 years ago
Keywords: checkin-needed
Resolution: --- → FIXED
Whiteboard: [build_warning]
Updated•6 years ago
|
Blocks: coverity-analysis
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
•