mirror of
https://github.com/servo/servo.git
synced 2025-06-13 10:54:29 +00:00
Don't crash on invalid utf-8 in the HTML parser.
This was regressed by the html5ever landing.
This commit is contained in:
parent
65856dd00a
commit
b9d8533760
4 changed files with 5 additions and 6 deletions
|
@ -496,7 +496,7 @@ pub fn parse_html(page: &Page,
|
||||||
match msg {
|
match msg {
|
||||||
Payload(data) => {
|
Payload(data) => {
|
||||||
// FIXME: use Vec<u8> (html5ever #34)
|
// FIXME: use Vec<u8> (html5ever #34)
|
||||||
let data = String::from_utf8(data).unwrap();
|
let data = UTF_8.decode(data.as_slice(), DecodeReplace).unwrap();
|
||||||
parser.tokenizer().borrow_mut().feed(data);
|
parser.tokenizer().borrow_mut().feed(data);
|
||||||
}
|
}
|
||||||
Done(Err(err)) => {
|
Done(Err(err)) => {
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
[open-url-encoding.htm]
|
[open-url-encoding.htm]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: CRASH
|
[XMLHttpRequest: open() - URL encoding]
|
||||||
|
expected: FAIL
|
||||||
|
|
||||||
|
|
|
@ -1,3 +0,0 @@
|
||||||
[send-content-type-string.htm]
|
|
||||||
type: testharness
|
|
||||||
expected: CRASH
|
|
|
@ -1,3 +1,3 @@
|
||||||
[send-entity-body-document.htm]
|
[send-entity-body-document.htm]
|
||||||
type: testharness
|
type: testharness
|
||||||
expected: CRASH
|
expected: TIMEOUT
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue