Closed
Bug 184697
Opened 22 years ago
Closed 22 years ago
Crash on XML that uses a namespace that's not declared
Categories
(Core :: DOM: HTML Parser, defect)
Tracking
()
RESOLVED
FIXED
mozilla1.3beta
People
(Reporter: bzbarsky, Assigned: sicking)
References
()
Details
(Keywords: crash)
Attachments
(2 files, 2 obsolete files)
|
7 bytes,
text/xml
|
Details | |
|
898 bytes,
patch
|
harishd
:
review+
hjtoi-bugzilla
:
superreview+
|
Details | Diff | Splinter Review |
The basic problem is that if I use an element like <foo:bar> in XML and do not have an xmlns:foo="something", we will crash because the PR_ASSERT in nsXMLContentSink::HandleEndElement triggers (the one that asserts eXMLContentSinkState_InDocumentElement == mState). It does not seem to matter what else is in the document.... Minimal testcase is an XML document containing the 6 chars: <a:b/>
| Reporter | ||
Updated•22 years ago
|
Severity: normal → critical
Keywords: crash,
mozilla1.3
| Reporter | ||
Comment 1•22 years ago
|
||
| Reporter | ||
Comment 2•22 years ago
|
||
Oh, if I uncomment the PR_ASSERT then PopContent() returns null (asserting as it does so) and we crash in nsXMLContentSink::CloseElement after asserting that we've got nothing to close.....
| Reporter | ||
Comment 3•22 years ago
|
||
*** Bug 188026 has been marked as a duplicate of this bug. ***
| Reporter | ||
Updated•22 years ago
|
Flags: blocking1.3b?
Comment 4•22 years ago
|
||
Sounds like this has the potential to become a topcrash. Harish, can you take a look at this for fixing in 1.3beta (about 2 weeks away).
Flags: blocking1.3b? → blocking1.3b+
Added a couple of lines that got yanked when sicking landed the pretty printing changes.
Updated•22 years ago
|
Target Milestone: --- → mozilla1.3beta
| Assignee | ||
Comment 6•22 years ago
|
||
Comment on attachment 111450 [details] [diff] [review] Patch v1.0 this shouldn't be needed. If no factory is registered we set up a default factory that always calls NS_NewXMLElement(aResult, aNodeInfo);
| Assignee | ||
Comment 7•22 years ago
|
||
ooh, i understand what's happening. When the prefix is undeclared nameSpaceID will be -1 (kNameSpaceID_Unknown) and GetElementFactory will return null. IMHO a better fix would be to let GetElementFactory return the default factory for that namespace.
URL: da
| Assignee | ||
Comment 8•22 years ago
|
||
actually we should abort the parsing if this occurs (I have that filed as a bug somewhere), but for now we will have to work around it.
| Assignee | ||
Comment 9•22 years ago
|
||
| Assignee | ||
Comment 10•22 years ago
|
||
harish: which approach do you think we should go with?
Comment 11•22 years ago
|
||
Jonas: I like your patch, however, you should addref aElementFactory before returning. no?
| Assignee | ||
Comment 12•22 years ago
|
||
thanks! of course i thould addref
Attachment #111450 -
Attachment is obsolete: true
Attachment #111472 -
Attachment is obsolete: true
Comment 13•22 years ago
|
||
Comment on attachment 111589 [details] [diff] [review] ...with an addref r=harishd
Attachment #111589 -
Flags: superreview?(heikki)
Attachment #111589 -
Flags: review+
Updated•22 years ago
|
Attachment #111589 -
Flags: superreview?(heikki) → superreview+
| Assignee | ||
Comment 15•22 years ago
|
||
checked in. Thanks for catching this and for the reviews
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•