Opened 15 years ago
Last modified 14 years ago
#5535 confirmed Bug
Stack overlow in IE6 when pasting strange HTML
Reported by: | Wiktor Walc | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | 3.0 |
Keywords: | IE HasPatch | Cc: | satya_minnekanti@… |
Description
When pasting HTML that contains lots of nested tags, IE6 throws an error: "stack overflow at line: 27".
Steps to reproduce
- Open _samples/api.html
- Copy content from attached file
- Paste it into the textarea
- Press the "Insert HTML" button
Attachments (3)
Change History (6)
Changed 15 years ago by
Attachment: | multiple_tags_stack_overflow.txt added |
---|
Changed 15 years ago by
Attachment: | ckeditor-htmlparser-recursion-test.patch added |
---|
comment:1 Changed 15 years ago by
Changed 15 years ago by
Attachment: | ckeditor-htmlparser-recursion.patch added |
---|
fixed a typo in the patch
comment:2 Changed 15 years ago by
Keywords: | HasPatch added |
---|
comment:3 Changed 14 years ago by
Cc: | satya_minnekanti@… added |
---|
The bug actually does affect any browser. The problem is that CKEDITOR.htmlParser.element.prototype.writeHtml method uses recursion, thus causing inevitable stack overflow on 'strange' html documents with deep nesting which sometimes are encountered in the wild. Attached are patches for ckeditor tests and for ckeditor itself that fix it by using array-based stack instead of recursion when writing element hierarchies.