]> granicus.if.org Git - file/commitdiff
Avoid read out of bounds (found by oss-fuzz)
authorChristos Zoulas <christos@zoulas.com>
Mon, 13 Aug 2018 12:59:05 +0000 (12:59 +0000)
committerChristos Zoulas <christos@zoulas.com>
Mon, 13 Aug 2018 12:59:05 +0000 (12:59 +0000)
src/is_json.c

index 059ba669feacd49505700aa55a4456f9a9ed6ed3..5d4e8b904bd465ccaea3e7f27b583d7596a83317 100644 (file)
@@ -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 <string.h>
@@ -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;