diff options
author | Alex Crichton <alex@alexcrichton.com> | 2018-07-11 09:04:29 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-11 09:04:29 -0500 |
commit | 1ed9b1ddd4b596fc7aa928a372fefe9d7908326a (patch) | |
tree | bf0b971e9b87756dcb10b51c85e8ae4ed84b3efc /src | |
parent | f99ab3f5e30f2ce00de9bc15083d2671107f1fcf (diff) | |
parent | c67263f359b29cb23c9bf0b1a33fcdcc50fd129d (diff) | |
download | milf-rs-1ed9b1ddd4b596fc7aa928a372fefe9d7908326a.tar.gz milf-rs-1ed9b1ddd4b596fc7aa928a372fefe9d7908326a.zip |
Merge pull request #250 from ehuss/reject-del
0.5: Reject 0x7f (DEL) in strings.
Diffstat (limited to 'src')
-rw-r--r-- | src/tokens.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/tokens.rs b/src/tokens.rs index 1b5a755..79aeb60 100644 --- a/src/tokens.rs +++ b/src/tokens.rs @@ -331,7 +331,7 @@ impl<'a> Tokenizer<'a> { fn literal_string(&mut self, start: usize) -> Result<Token<'a>, Error> { self.read_string('\'', start, &mut |_me, val, _multi, i, ch| { - if ch == '\u{09}' || ('\u{20}' <= ch && ch <= '\u{10ffff}') { + if ch == '\u{09}' || ('\u{20}' <= ch && ch <= '\u{10ffff}' && ch != '\u{7f}') { val.push(ch); Ok(()) } else { @@ -373,7 +373,7 @@ impl<'a> Tokenizer<'a> { } Ok(()) } - ch if '\u{20}' <= ch && ch <= '\u{10ffff}' => { + ch if '\u{20}' <= ch && ch <= '\u{10ffff}' && ch != '\u{7f}' => { val.push(ch); Ok(()) } |