Skip to content

Commit

Permalink
Feat #5: JsonReader does not allow unespaced control flow characters …
Browse files Browse the repository at this point in the history
…in strict mode
  • Loading branch information
marten-voorberg committed Feb 24, 2023
1 parent a78764a commit 45692b9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion gson/src/main/java/com/google/gson/stream/JsonReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,9 @@ private String nextQuotedValue(char quote) throws IOException {
while (p < l) {
int c = buffer[p++];

if (c == quote) {
if (strict && c <= '\u001F') {
throw syntaxError("Unescaped control characters (\\u0000-\\u001F) are not allowed in strict mode.");
} else if (c == quote) {
pos = p;
int len = p - start - 1;
if (builder == null) {
Expand Down

0 comments on commit 45692b9

Please sign in to comment.