mirror of
https://github.com/servo/servo
synced 2026-05-05 06:32:13 +02:00
Don't crash on invalid utf-8 in the HTML parser.
This was regressed by the html5ever landing.
This commit is contained in:
@@ -496,7 +496,7 @@ pub fn parse_html(page: &Page,
|
||||
match msg {
|
||||
Payload(data) => {
|
||||
// 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);
|
||||
}
|
||||
Done(Err(err)) => {
|
||||
|
||||
Reference in New Issue
Block a user