Fix #65
This commit is contained in:
parent
cd5b79295c
commit
4c7a335bac
2 changed files with 8 additions and 1 deletions
|
@ -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()) {
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue