From: Christos Zoulas Date: Mon, 13 Aug 2018 12:59:05 +0000 (+0000) Subject: Avoid read out of bounds (found by oss-fuzz) X-Git-Tag: FILE5_35~49 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=473e039b48fd72660dd00f4b52a2880cc0dd5632;p=file Avoid read out of bounds (found by oss-fuzz) --- diff --git a/src/is_json.c b/src/is_json.c index 059ba669..5d4e8b90 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.5 2018/08/11 14:43:43 christos Exp $") +FILE_RCSID("@(#)$File: is_json.c,v 1.6 2018/08/13 12:59:05 christos Exp $") #endif #include @@ -221,6 +221,8 @@ json_parse_object(const unsigned char **ucp, const unsigned char *ue, DPRINTF("not json", uc, *ucp); goto out; } + if (uc == ue) + goto out; switch (*uc++) { case ',': continue;