Closed Bug 373072 Opened 18 years ago Closed 18 years ago

XML.prototype.namespace() does not check for xml list

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
critical

Tracking

()

VERIFIED FIXED

People

(Reporter: igor, Assigned: igor)

References

Details

(Keywords: crash, verified1.8.0.12, verified1.8.1.4)

Attachments

(1 file)

xml_namespcae() from jsxml.c implementing XML.prototype.namespace() assumes that this obj can not be XMLList leading to NULL dereference in GetNamespace as the following js shell session demonstrates: js> XML.prototype.function::namespace.call(new XMLList()); XML.prototype.function::namespace.call(new XMLList()); Segmentation fault
Flags: blocking1.8.1.3?
Flags: blocking1.8.0.11?
Attached patch Minimal fix v1Splinter Review
This is a minimal fix that just makes sure that the code does not crash with xml-list argument and instead returns something. A fix with proper logic would be done in bug 373082.
Attachment #257754 - Flags: review?(brendan)
Attachment #257754 - Flags: approval1.8.1.3?
Attachment #257754 - Flags: approval1.8.0.11?
Comment on attachment 257754 [details] [diff] [review] Minimal fix v1 Yeah, that's what I meant to write -- at some point I ordered xml_class values such that JSXML_HAS_NAME worked, but I must have missed this open-coded test. Thanks for fixing, /be
Attachment #257754 - Flags: review?(brendan) → review+
Blocks: 373082
I committed the patch from comment 1 to the trunk: Checking in jsxml.c; /cvsroot/mozilla/js/src/jsxml.c,v <-- jsxml.c new revision: 3.145; previous revision: 3.144 done
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Too late for 1.8.1.3/1.8.0.11 for this type of fix, moving nom out to 1.8.1.4/1.8.0.12
Flags: blocking1.8.1.4?
Flags: blocking1.8.1.3?
Flags: blocking1.8.1.3-
Flags: blocking1.8.0.12?
Flags: blocking1.8.0.11?
Flags: blocking1.8.0.11-
Attachment #257754 - Flags: approval1.8.1.4?
Attachment #257754 - Flags: approval1.8.1.3?
Attachment #257754 - Flags: approval1.8.0.12?
Attachment #257754 - Flags: approval1.8.0.11?
Severity: normal → critical
Flags: blocking1.8.1.4?
Flags: blocking1.8.1.4+
Flags: blocking1.8.0.12?
Flags: blocking1.8.0.12+
Keywords: crash
Comment on attachment 257754 [details] [diff] [review] Minimal fix v1 approved for 1.8/1.8.0 branches, a=dveditz for drivers
Attachment #257754 - Flags: approval1.8.1.4?
Attachment #257754 - Flags: approval1.8.1.4+
Attachment #257754 - Flags: approval1.8.0.12?
Attachment #257754 - Flags: approval1.8.0.12+
/cvsroot/mozilla/js/tests/e4x/XMLList/regress-373072.js,v <-- regress-373072.js initial revision: 1.1
Flags: in-testsuite+
verified fixed 1.9.0 20070320 win/mac*/linux
Status: RESOLVED → VERIFIED
I committed the patch from comment 1 to MOZILLA_1_8_BRANCH: Checking in jsxml.c; /cvsroot/mozilla/js/src/jsxml.c,v <-- jsxml.c new revision: 3.50.2.61; previous revision: 3.50.2.60 done
Keywords: fixed1.8.1.4
I committed the patch from comment 1 to MOZILLA_1_8_0_BRANCH: Checking in jsxml.c; /cvsroot/mozilla/js/src/jsxml.c,v <-- jsxml.c new revision: 3.50.2.15.2.31; previous revision: 3.50.2.15.2.30 done
Keywords: fixed1.8.0.12
update test to reflect new error message from bug 373082. /cvsroot/mozilla/js/tests/e4x/XMLList/regress-373072.js,v <-- regress-373072.js new revision: 1.2; previous revision: 1.1 verified fixed (no crash) 1.8.0, 1.8.1 linux, windows, mac shell 20070406
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: