Skip to content

Commit 9ca7e84

Browse files
eemeliaphillips
andauthored
Do not allow null characters in message source (#682)
* Just ban NUL * NUL → NULL Co-authored-by: Addison Phillips <[email protected]> --------- Co-authored-by: Addison Phillips <[email protected]>
1 parent c3c213d commit 9ca7e84

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

spec/message.abnf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ simple-start-char = content-char / s / "@" / "|"
8888
text-char = content-char / s / "." / "@" / "|"
8989
quoted-char = content-char / s / "." / "@" / "{" / "}"
9090
reserved-char = content-char / "."
91-
content-char = %x00-08 ; omit HTAB (%x09) and LF (%x0A)
91+
content-char = %x01-08 ; omit NULL (%x00), HTAB (%x09) and LF (%x0A)
9292
/ %x0B-0C ; omit CR (%x0D)
9393
/ %x0E-1F ; omit SP (%x20)
9494
/ %x21-2D ; omit . (%x2E)

spec/syntax.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -284,8 +284,8 @@ A _quoted pattern_ MAY be empty.
284284
### Text
285285
286286
**_<dfn>text</dfn>_** is the translateable content of a _pattern_.
287-
Any Unicode code point is allowed, except for surrogate code points U+D800
288-
through U+DFFF inclusive.
287+
Any Unicode code point is allowed, except for U+0000 NULL
288+
and the surrogate code points U+D800 through U+DFFF inclusive.
289289
The characters U+005C REVERSE SOLIDUS `\`,
290290
U+007B LEFT CURLY BRACKET `{`, and U+007D RIGHT CURLY BRACKET `}`
291291
MUST be escaped as `\\`, `\{`, and `\}` respectively.
@@ -304,7 +304,7 @@ simple-start-char = content-char / s / "@" / "|"
304304
text-char = content-char / s / "." / "@" / "|"
305305
quoted-char = content-char / s / "." / "@" / "{" / "}"
306306
reserved-char = content-char / "."
307-
content-char = %x00-08 ; omit HTAB (%x09) and LF (%x0A)
307+
content-char = %x01-08 ; omit NULL (%x00), HTAB (%x09) and LF (%x0A)
308308
/ %x0B-0C ; omit CR (%x0D)
309309
/ %x0E-1F ; omit SP (%x20)
310310
/ %x21-2D ; omit . (%x2E)
@@ -807,7 +807,7 @@ as a _key_ value,
807807
as the _operand_ of a _literal-expression_,
808808
or in the value of an _option_.
809809
A _literal_ MAY include any Unicode code point
810-
except for surrogate code points U+D800 through U+DFFF.
810+
except for U+0000 NULL or the surrogate code points U+D800 through U+DFFF.
811811

812812
All code points are preserved.
813813

0 commit comments

Comments
 (0)