This commit is contained in:
Yuheng Chen 2017-05-13 20:48:48 +08:00
parent cd5b79295c
commit 4c7a335bac
2 changed files with 8 additions and 1 deletions

View file

@ -1294,12 +1294,12 @@ impl<T: Iterator<Item=char>> Scanner<T> {
}
self.lookahead(2);
}
self.lookahead(1);
match self.ch() {
'\'' if single => { break; },
'"' if !single => { break; },
_ => {}
}
self.lookahead(1);
// Consume blank characters.
while is_blank(self.ch()) || is_break(self.ch()) {

View file

@ -525,6 +525,13 @@ a1: &DEFAULT
assert!(YamlLoader::load_from_str(&s).is_err());
}
#[test]
fn test_issue_65() {
// See: https://github.com/chyh1990/yaml-rust/issues/65
let b = "\n\"ll\\\"ll\\\r\n\"ll\\\"ll\\\r\r\r\rU\r\r\rU";
assert!(YamlLoader::load_from_str(&b).is_err());
}
#[test]
fn test_bad_docstart() {
assert!(YamlLoader::load_from_str("---This used to cause an infinite loop").is_ok());