diff options
author | Alex Crichton <alex@alexcrichton.com> | 2015-01-19 13:16:42 -0800 |
---|---|---|
committer | Alex Crichton <alex@alexcrichton.com> | 2015-01-19 13:16:42 -0800 |
commit | 885db13d09f5beb721e215942d1423f4122093e0 (patch) | |
tree | cef1685a727395a45254dcb26e428d848e15b84d | |
parent | 34aaa5f38498ccb2eef53e67c742ceaa2c80865d (diff) | |
download | milf-rs-885db13d09f5beb721e215942d1423f4122093e0.tar.gz milf-rs-885db13d09f5beb721e215942d1423f4122093e0.zip |
Don't infinite loop on bad keys
-rw-r--r-- | src/parser.rs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/parser.rs b/src/parser.rs index df19ba4..8065aa8 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -220,7 +220,7 @@ impl<'a> Parser<'a> { _ => break, } } - None => {} + None => break } } Some(ret) @@ -1135,4 +1135,9 @@ trimmed in raw strings. assert!(table.lookup("f f").is_some()); assert!(table.lookup("\"").is_some()); } + + #[test] + fn invalid_bare_numeral() { + assert!(Parser::new("4").parse().is_none()); + } } |