Closed Bug 365611 Opened 19 years ago Closed 19 years ago

crash [@ nsSVGDocument::GetRootElement] due to null mRootContent

Categories

(Core :: SVG, defect)

x86
Windows XP
defect
Not set
critical

Tracking

()

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: asqueella, Assigned: asqueella)

References

()

Details

(Keywords: crash, testcase)

Crash Data

Attachments

(2 files, 3 obsolete files)

Attached image testcase
It's possible for a document to end up having null mRootContent and the code should deal with it. http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/content/base/src/nsDocument.cpp&rev=3.698#2558 has a working implementation. (Why does SVG need a method of its own?)
(timeless found this crash and asked me to file it)
Attached patch patch (obsolete) — Splinter Review
Assignee: general → asqueella
Status: NEW → ASSIGNED
Attachment #250136 - Flags: superreview?
Attachment #250136 - Flags: review?
Attachment #250136 - Flags: superreview?(tor)
Attachment #250136 - Flags: superreview?
Attachment #250136 - Flags: review?(tor)
Attachment #250136 - Flags: review?
(In reply to comment #0) >(Why does SVG need a method of its own?) Dunno but I noticed that it will only return an SVG element.
Why not something simpler like this? NS_ENSURE_ARG_POINTER(aRootElement); *aRootElement = nsnull; if (mRootContent) return CallQueryInterface(mRootContent, aRootElement); return NS_OK;
Attached patch patch (obsolete) — Splinter Review
Right, and I think it's okay to move the null assignment after the if too.
Attachment #250136 - Attachment is obsolete: true
Attachment #250480 - Flags: superreview?(tor)
Attachment #250480 - Flags: review?(tor)
Attachment #250136 - Flags: superreview?(tor)
Attachment #250136 - Flags: review?(tor)
Did you mean to attach a different patch?
Attached patch the right patch (obsolete) — Splinter Review
Attachment #250480 - Attachment is obsolete: true
Attachment #250483 - Flags: superreview?(tor)
Attachment #250483 - Flags: review?(tor)
Attachment #250480 - Flags: superreview?(tor)
Attachment #250480 - Flags: review?(tor)
sigh. I'll attach a patch without that typo in a moment...
Attached patch patchSplinter Review
It's sad to make two mistakes in a 5-lines patch. This one should actually build :) Sorry for all the spam.
Attachment #250483 - Attachment is obsolete: true
Attachment #250483 - Flags: superreview?(tor)
Attachment #250483 - Flags: review?(tor)
Attachment #250484 - Flags: superreview?(tor)
Attachment #250484 - Flags: review?(tor)
Attachment #250484 - Flags: superreview?(tor)
Attachment #250484 - Flags: superreview+
Attachment #250484 - Flags: review?(tor)
Attachment #250484 - Flags: review+
Whiteboard: [checkin needed]
mozilla/content/svg/document/src/nsSVGDocument.cpp 1.20
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Target Milestone: --- → mozilla1.9alpha
Flags: in-testsuite?
Crash Signature: [@ nsSVGDocument::GetRootElement]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: