]> granicus.if.org Git - file/commitdiff
avoid accessing memory beyond the end of the buffer (found by oss-fuzz)
authorChristos Zoulas <christos@zoulas.com>
Mon, 27 Aug 2018 06:17:23 +0000 (06:17 +0000)
committerChristos Zoulas <christos@zoulas.com>
Mon, 27 Aug 2018 06:17:23 +0000 (06:17 +0000)
src/is_json.c

index 61bdc4df8afb67154eaa9e32ffcbb82573377230..2b9b8e8b2fbf9e6f5fcc61bf2d54c74f682ac85b 100644 (file)
@@ -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 <string.h>
@@ -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++;