From a23a5ced925aa3bab729769ded8bfd1af4e24824 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Mon, 27 Aug 2018 06:17:23 +0000 Subject: [PATCH] avoid accessing memory beyond the end of the buffer (found by oss-fuzz) --- src/is_json.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/is_json.c b/src/is_json.c index 61bdc4df..2b9b8e8b 100644 --- a/src/is_json.c +++ b/src/is_json.c @@ -32,7 +32,7 @@ #include "file.h" #ifndef lint -FILE_RCSID("@(#)$File: is_json.c,v 1.8 2018/08/20 08:06:54 christos Exp $") +FILE_RCSID("@(#)$File: is_json.c,v 1.9 2018/08/27 06:17:23 christos Exp $") #endif #include @@ -176,6 +176,8 @@ json_parse_array(const unsigned char **ucp, const unsigned char *ue, while (uc < ue) { if (!json_parse(&uc, ue, st, lvl + 1)) goto out; + if (uc == ue) + goto out; switch (*uc) { case ',': uc++; -- 2.40.0