diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index 3ab133be..854353ff 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -7606,6 +7606,7 @@ extern const char wuffs_json__error__bad_c0_control_code[]; extern const char wuffs_json__error__bad_utf_8[]; extern const char wuffs_json__error__bad_backslash_escape[]; extern const char wuffs_json__error__bad_input[]; +extern const char wuffs_json__error__bad_new_line_in_a_string[]; extern const char wuffs_json__error__bad_quirk_combination[]; extern const char wuffs_json__error__unsupported_number_length[]; extern const char wuffs_json__error__unsupported_recursion_depth[]; @@ -25513,6 +25514,7 @@ const char wuffs_json__error__bad_c0_control_code[] = "#json: bad C0 control cod const char wuffs_json__error__bad_utf_8[] = "#json: bad UTF-8"; const char wuffs_json__error__bad_backslash_escape[] = "#json: bad backslash-escape"; const char wuffs_json__error__bad_input[] = "#json: bad input"; +const char wuffs_json__error__bad_new_line_in_a_string[] = "#json: bad new-line in a string"; const char wuffs_json__error__bad_quirk_combination[] = "#json: bad quirk combination"; const char wuffs_json__error__unsupported_number_length[] = "#json: unsupported number length"; const char wuffs_json__error__unsupported_recursion_depth[] = "#json: unsupported recursion depth"; @@ -26611,6 +26613,10 @@ wuffs_json__decoder__decode_tokens( (iop_a_src += 1, wuffs_base__make_empty_struct()); goto label__string_loop_outer__continue; } + if (v_char == 138) { + status = wuffs_base__make_status(wuffs_json__error__bad_new_line_in_a_string); + goto exit; + } status = wuffs_base__make_status(wuffs_json__error__bad_c0_control_code); goto exit; } diff --git a/std/json/common_consts.wuffs b/std/json/common_consts.wuffs index 1365d9e1..dc9ab342 100644 --- a/std/json/common_consts.wuffs +++ b/std/json/common_consts.wuffs @@ -16,6 +16,7 @@ pub status "#bad C0 control code" pub status "#bad UTF-8" pub status "#bad backslash-escape" pub status "#bad input" +pub status "#bad new-line in a string" pub status "#bad quirk combination" pub status "#unsupported number length" pub status "#unsupported recursion depth" diff --git a/std/json/decode_json.wuffs b/std/json/decode_json.wuffs index 8c3bd7e7..49bfd903 100644 --- a/std/json/decode_json.wuffs +++ b/std/json/decode_json.wuffs @@ -846,6 +846,9 @@ pub func decoder.decode_tokens?(dst: base.token_writer, src: base.io_reader, wor args.src.skip_u32_fast!(actual: 1, worst_case: 1) continue.string_loop_outer } + if char == 0x8A { + return "#bad new-line in a string" + } return "#bad C0 control code" } if this.quirks[QUIRK_REPLACE_INVALID_UNICODE - QUIRKS_BASE] {