aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/lib.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib.rs b/src/lib.rs
index ed0da37..e5b9d58 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -326,6 +326,10 @@ impl<'input, 'output, I: ByteStream, W: Write> Parser<'input, 'output, I, W> {
b'\\' => {
self.walk_escape()?;
}
+ c if c < 0x20 => {
+ // A raw byte less than 0x20 cannot be embedded in string.
+ return Err(SyntaxError::InvalidValue.into());
+ }
c => {
self.output.write_all(&[c])?;
}