Closed Bug 478501 Opened 16 years ago Closed 16 years ago

E4X truncate String when it found the '\0'.

Categories

(Tamarin Graveyard :: Virtual Machine, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: jodyer, Assigned: daumling)

References

Details

Attachments

(1 file, 1 obsolete file)

Steps to reproduce: write following ActionScript code. var s = "a" + String.fromCharCode(0) + "a"; trace(s.length); trace(<e a={s}/>.toXMLString()); Actual Results: 3 <e a="a"/> Expected Results: 3 <e a="a&#0;a"/> Workaround (if any): Transferred Comments: Chris Peyer - Thu Apr 10 11:40:41 CDT 2008 Verified valid bug by Werner Sharp. Trevor Baker - Tue Jan 27 16:30:13 CST 2009 send to internal review for prioritization This bug transferred from: http://bugs.adobe.com/jira/browse/ASC-3116
Blocks: AS3_Builtins
The simple fix is to supply a length when creating the resulting string in AvmCore::EscapeAttributeValue(). This fix would produce the same output as in SpiderMonkey (which is still wrong - this is also a SpiderMonkey bug). Jeff's expected value is not covered in ECMA-357, where 0x00 is just an ordinary character. It does not hurt IMHO to add 0x00 as a value to be escaped as Jeff's expected result suggests.
Assignee: nobody → daumling
Status: NEW → ASSIGNED
Attachment #382117 - Flags: review?(lhansen)
Attachment #382117 - Flags: superreview?(stejohns)
Attachment #382117 - Flags: review?(lhansen)
Attachment #382117 - Flags: review+
Comment on attachment 382117 [details] [diff] [review] Fis adds to ECMA-357 (Steven gets superreview on builtin fixes.)
Attachment #382117 - Flags: superreview?(stejohns) → superreview+
Patch pushed as #2018:96dc103550a9
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Blocks: 486742
Attached patch testcase (obsolete) — Splinter Review
Attachment #404629 - Flags: review?(dschaffe)
Attachment #404629 - Flags: review?(dschaffe) → review+
Comment on attachment 404629 [details] [diff] [review] testcase Pushed 2689:f822799a7fe3
Attachment #404629 - Attachment is obsolete: true
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: