summaryrefslogtreecommitdiff
path: root/extmod
diff options
context:
space:
mode:
Diffstat (limited to 'extmod')
-rw-r--r--extmod/modjson.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/extmod/modjson.c b/extmod/modjson.c
index e655a02bc..11aedd198 100644
--- a/extmod/modjson.c
+++ b/extmod/modjson.c
@@ -160,7 +160,8 @@ static mp_obj_t mod_json_load(mp_obj_t stream_obj) {
for (;;) {
cont:
if (S_END(s)) {
- break;
+ // Input finished abruptly in the middle of a composite entity.
+ goto fail;
}
mp_obj_t next = MP_OBJ_NULL;
bool enter = false;