diff --git a/release/c/wuffs-unsupported-snapshot.c b/release/c/wuffs-unsupported-snapshot.c index a6767555..73323227 100644 --- a/release/c/wuffs-unsupported-snapshot.c +++ b/release/c/wuffs-unsupported-snapshot.c @@ -18456,6 +18456,10 @@ wuffs_json__decoder__decode_tokens(wuffs_json__decoder* self, } goto label_0_continue; } else if ((v_c >= 48) || (v_c == 45)) { + if (0 == (v_expect & 1)) { + status = wuffs_base__make_status(wuffs_json__error__bad_input); + goto exit; + } while (true) { if (a_src) { a_src->meta.ri = ((size_t)(iop_a_src - a_src->data.ptr)); diff --git a/std/json/decode_json.wuffs b/std/json/decode_json.wuffs index 0739b823..effd2e17 100644 --- a/std/json/decode_json.wuffs +++ b/std/json/decode_json.wuffs @@ -248,6 +248,9 @@ pub func decoder.decode_tokens?(dst: base.token_writer, src: base.io_reader) { } else if (c >= 0x30) or (c == 0x2D) { // 0x30 is '0', 0x2D is '-'. // -------- BEGIN parse numbers. + if 0 == (expect & 0x01) { // 0x02 is EXPECT_NON_STRING_VALUE. + return "#bad input" + } while true, pre args.dst.available() > 0, {