]> granicus.if.org Git - file/commitdiff
prevent overread (found by oss-fuzz)
authorChristos Zoulas <christos@zoulas.com>
Fri, 17 Aug 2018 09:12:33 +0000 (09:12 +0000)
committerChristos Zoulas <christos@zoulas.com>
Fri, 17 Aug 2018 09:12:33 +0000 (09:12 +0000)
src/is_json.c

index 5d4e8b904bd465ccaea3e7f27b583d7596a83317..527b26c44bf516352d672ae51b4428a36372a6b1 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: is_json.c,v 1.6 2018/08/13 12:59:05 christos Exp $")
+FILE_RCSID("@(#)$File: is_json.c,v 1.7 2018/08/17 09:12:33 christos Exp $")
 #endif
 
 #include <string.h>
@@ -127,6 +127,8 @@ json_parse_string(const unsigned char **ucp, const unsigned char *ue)
                case '\0':
                        goto out;
                case '\\':
+                       if (uc == ue)
+                               goto out;
                        switch (*uc++) {
                        case '\0':
                                goto out;