Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler. Number of rules (primarily dangerous function names) in C/C++ ruleset: 223 Examining data/json-c-0.15/apps/json_parse.c Examining data/json-c-0.15/arraylist.c Examining data/json-c-0.15/arraylist.h Examining data/json-c-0.15/debug.c Examining data/json-c-0.15/debug.h Examining data/json-c-0.15/fuzz/tokener_parse_ex_fuzzer.cc Examining data/json-c-0.15/json.h Examining data/json-c-0.15/json_c_version.c Examining data/json-c-0.15/json_c_version.h Examining data/json-c-0.15/json_inttypes.h Examining data/json-c-0.15/json_object.c Examining data/json-c-0.15/json_object.h Examining data/json-c-0.15/json_object_iterator.c Examining data/json-c-0.15/json_object_iterator.h Examining data/json-c-0.15/json_object_private.h Examining data/json-c-0.15/json_pointer.c Examining data/json-c-0.15/json_pointer.h Examining data/json-c-0.15/json_tokener.c Examining data/json-c-0.15/json_tokener.h Examining data/json-c-0.15/json_types.h Examining data/json-c-0.15/json_util.c Examining data/json-c-0.15/json_util.h Examining data/json-c-0.15/json_visit.c Examining data/json-c-0.15/json_visit.h Examining data/json-c-0.15/libjson.c Examining data/json-c-0.15/linkhash.c Examining data/json-c-0.15/linkhash.h Examining data/json-c-0.15/math_compat.h Examining data/json-c-0.15/printbuf.c Examining data/json-c-0.15/printbuf.h Examining data/json-c-0.15/random_seed.c Examining data/json-c-0.15/random_seed.h Examining data/json-c-0.15/snprintf_compat.h Examining data/json-c-0.15/strdup_compat.h Examining data/json-c-0.15/strerror_override.c Examining data/json-c-0.15/strerror_override.h Examining data/json-c-0.15/strerror_override_private.h Examining data/json-c-0.15/tests/parse_flags.c Examining data/json-c-0.15/tests/parse_flags.h Examining data/json-c-0.15/tests/test1.c Examining data/json-c-0.15/tests/test2.c Examining data/json-c-0.15/tests/test4.c Examining data/json-c-0.15/tests/testReplaceExisting.c Examining data/json-c-0.15/tests/test_cast.c Examining data/json-c-0.15/tests/test_charcase.c Examining data/json-c-0.15/tests/test_compare.c Examining data/json-c-0.15/tests/test_deep_copy.c Examining data/json-c-0.15/tests/test_double_serializer.c Examining data/json-c-0.15/tests/test_float.c Examining data/json-c-0.15/tests/test_int_add.c Examining data/json-c-0.15/tests/test_json_pointer.c Examining data/json-c-0.15/tests/test_locale.c Examining data/json-c-0.15/tests/test_null.c Examining data/json-c-0.15/tests/test_object_iterator.c Examining data/json-c-0.15/tests/test_parse.c Examining data/json-c-0.15/tests/test_parse_int64.c Examining data/json-c-0.15/tests/test_printbuf.c Examining data/json-c-0.15/tests/test_set_serializer.c Examining data/json-c-0.15/tests/test_set_value.c Examining data/json-c-0.15/tests/test_util_file.c Examining data/json-c-0.15/tests/test_visit.c Examining data/json-c-0.15/vasprintf_compat.h FINAL RESULTS: data/json-c-0.15/debug.c:45:31: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. extern void mc_set_syslog(int syslog) data/json-c-0.15/debug.c:47:12: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. _syslog = syslog; data/json-c-0.15/debug.c:63:4: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(msg, ap); data/json-c-0.15/debug.c:79:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, msg, ap); data/json-c-0.15/debug.c:94:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, msg, ap); data/json-c-0.15/debug.h:37:36: [4] (format) syslog: If syslog's format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant format string for syslog. JSON_EXPORT void mc_set_syslog(int syslog); data/json-c-0.15/json_object.c:725:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(sbuf, sizeof(sbuf), "%" PRId64, JC_INT(jso)->cint.c_int64); data/json-c-0.15/json_object.c:727:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(sbuf, sizeof(sbuf), "%" PRIu64, JC_INT(jso)->cint.c_uint64); data/json-c-0.15/json_object.c:1044:10: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. size = snprintf(buf, sizeof(buf), format, jsodbl->c_double); data/json-c-0.15/json_tokener.c:53:44: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. #error You do not have strncasecmp on your system. data/json-c-0.15/json_util.c:76:8: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. (void)vsnprintf(_last_err, sizeof(_last_err), err_fmt, ap); data/json-c-0.15/printbuf.c:139:9: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. size = vsnprintf(buf, 128, msg, ap); data/json-c-0.15/snprintf_compat.h:24:9: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define vsnprintf json_c_vsnprintf data/json-c-0.15/snprintf_compat.h:35:9: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #define snprintf json_c_snprintf data/json-c-0.15/snprintf_compat.h:38:13: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. #error Need vsnprintf! data/json-c-0.15/strdup_compat.h:13:39: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. #error You do not have strdup on your system. data/json-c-0.15/tests/parse_flags.c:12:43: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. #error You do not have strcasecmp on your system. data/json-c-0.15/vasprintf_compat.h:34:10: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. chars = vsnprintf(&_T_emptybuffer, 0, fmt, ap) + 1; data/json-c-0.15/vasprintf_compat.h:47:15: [4] (format) vsprintf: Potential format string problem (CWE-134). Make format string constant. if ((chars = vsprintf(b, fmt, ap)) < 0) data/json-c-0.15/apps/json_parse.c:163:16: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((opt = getopt(argc, argv, "fhns")) != -1) data/json-c-0.15/strerror_override.c:63:14: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. extern char *getenv(const char *name); // Avoid including stdlib.h data/json-c-0.15/strerror_override.c:74:30: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. _json_c_strerror_enable = (getenv("_JSON_C_STRERROR_ENABLE") == NULL) ? -1 : 1; data/json-c-0.15/tests/test_parse.c:39:23: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. int chunksize = atoi(getenv("TEST_PARSE_CHUNKSIZE")); data/json-c-0.15/tests/test_parse.c:59:7: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("TEST_PARSE_DEBUG") != NULL) data/json-c-0.15/tests/test_parse.c:92:6: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. if (getenv("TEST_PARSE_CHUNKSIZE") != NULL) data/json-c-0.15/apps/json_parse.c:52:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[32768]; data/json-c-0.15/apps/json_parse.c:180:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open(argv[optind], O_RDONLY, 0); data/json-c-0.15/json_object.c:263:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sbuf[7]; data/json-c-0.15/json_object.c:723:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sbuf[21]; data/json-c-0.15/json_object.c:1008:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128], *p, *q; data/json-c-0.15/json_object.c:1068:4: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buf, ".0"); data/json-c-0.15/json_object.c:1283:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(jso->c_string.idata, s, len); data/json-c-0.15/json_object.c:1363:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dstbuf, (const void *)s, len); data/json-c-0.15/json_object_private.h:94:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char idata[1]; // Immediate data. Actually longer data/json-c-0.15/json_tokener.c:121:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static unsigned char utf8_replacement_char[3] = {0xEF, 0xBF, 0xBD}; data/json-c-0.15/json_tokener.c:699:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char unescaped_utf[1]; data/json-c-0.15/json_tokener.c:705:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char unescaped_utf[2]; data/json-c-0.15/json_tokener.c:738:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char unescaped_utf[3]; data/json-c-0.15/json_tokener.c:746:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char unescaped_utf[4]; data/json-c-0.15/json_util.c:48:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). #define open _open data/json-c-0.15/json_util.c:62:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char _last_err[256] = ""; data/json-c-0.15/json_util.c:88:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[JSON_FILE_BUF_SIZE]; data/json-c-0.15/json_util.c:139:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(filename, O_RDONLY)) < 0) data/json-c-0.15/json_util.c:163:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(filename, O_WRONLY | O_TRUNC | O_CREAT, 0644)) < 0) data/json-c-0.15/printbuf.c:101:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->buf + p->bpos, buf, size); data/json-c-0.15/printbuf.c:135:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[128]; data/json-c-0.15/printbuf.h:63:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p->buf + p->bpos, (bufptr), bufsize); \ data/json-c-0.15/random_seed.c:190:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open(dev_random_file, O_RDONLY); data/json-c-0.15/strerror_override.c:66:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char errno_buf[128] = PREFIX; data/json-c-0.15/strerror_override.c:70:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char digbuf[20]; data/json-c-0.15/tests/test4.c:34:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char key[50]; data/json-c-0.15/tests/test_locale.c:28:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf1[10], buf2[10]; data/json-c-0.15/tests/test_parse.c:39:18: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). int chunksize = atoi(getenv("TEST_PARSE_CHUNKSIZE")); data/json-c-0.15/tests/test_parse_int64.c:36:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[100]; data/json-c-0.15/tests/test_parse_int64.c:49:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "2147483647"); // aka INT32_MAX data/json-c-0.15/tests/test_parse_int64.c:52:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-1"); data/json-c-0.15/tests/test_parse_int64.c:55:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, " -1"); data/json-c-0.15/tests/test_parse_int64.c:58:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "00001234"); data/json-c-0.15/tests/test_parse_int64.c:61:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "0001234x"); data/json-c-0.15/tests/test_parse_int64.c:64:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-00001234"); data/json-c-0.15/tests/test_parse_int64.c:67:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-00001234x"); data/json-c-0.15/tests/test_parse_int64.c:70:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "4294967295"); // aka UINT32_MAX data/json-c-0.15/tests/test_parse_int64.c:73:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "4294967296"); // aka UINT32_MAX + 1 data/json-c-0.15/tests/test_parse_int64.c:76:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "21474836470"); // INT32_MAX * 10 data/json-c-0.15/tests/test_parse_int64.c:79:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "31474836470"); // INT32_MAX * 10 + a bunch data/json-c-0.15/tests/test_parse_int64.c:82:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-2147483647"); // INT32_MIN + 1 data/json-c-0.15/tests/test_parse_int64.c:85:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-2147483648"); // INT32_MIN data/json-c-0.15/tests/test_parse_int64.c:88:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-2147483649"); // INT32_MIN - 1 data/json-c-0.15/tests/test_parse_int64.c:91:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-21474836480"); // INT32_MIN * 10 data/json-c-0.15/tests/test_parse_int64.c:94:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "9223372036854775806"); // INT64_MAX - 1 data/json-c-0.15/tests/test_parse_int64.c:97:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "9223372036854775807"); // INT64_MAX data/json-c-0.15/tests/test_parse_int64.c:100:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "9223372036854775808"); // INT64_MAX + 1 data/json-c-0.15/tests/test_parse_int64.c:103:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-9223372036854775808"); // INT64_MIN data/json-c-0.15/tests/test_parse_int64.c:106:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-9223372036854775809"); // INT64_MIN - 1 data/json-c-0.15/tests/test_parse_int64.c:109:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "18446744073709551614"); // UINT64_MAX - 1 data/json-c-0.15/tests/test_parse_int64.c:112:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "18446744073709551615"); // UINT64_MAX data/json-c-0.15/tests/test_parse_int64.c:115:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "18446744073709551616"); // UINT64_MAX + 1 data/json-c-0.15/tests/test_parse_int64.c:118:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-18446744073709551616"); // -UINT64_MAX data/json-c-0.15/tests/test_parse_int64.c:122:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "123"); data/json-c-0.15/tests/test_parse_int64.c:136:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "2147483647"); // aka INT32_MAX data/json-c-0.15/tests/test_parse_int64.c:139:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-1"); data/json-c-0.15/tests/test_parse_int64.c:142:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "-9223372036854775808"); data/json-c-0.15/tests/test_parse_int64.c:145:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, " 1"); data/json-c-0.15/tests/test_parse_int64.c:148:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "00001234"); data/json-c-0.15/tests/test_parse_int64.c:151:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "0001234x"); data/json-c-0.15/tests/test_parse_int64.c:154:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "4294967295"); // aka UINT32_MAX data/json-c-0.15/tests/test_parse_int64.c:157:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "4294967296"); // aka UINT32_MAX + 1 data/json-c-0.15/tests/test_parse_int64.c:160:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "21474836470"); // INT32_MAX * 10 data/json-c-0.15/tests/test_parse_int64.c:163:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "31474836470"); // INT32_MAX * 10 + a bunch data/json-c-0.15/tests/test_parse_int64.c:166:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "9223372036854775806"); // INT64_MAX - 1 data/json-c-0.15/tests/test_parse_int64.c:169:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "9223372036854775807"); // INT64_MAX data/json-c-0.15/tests/test_parse_int64.c:172:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "9223372036854775808"); // INT64_MAX + 1 data/json-c-0.15/tests/test_parse_int64.c:175:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "18446744073709551614"); // UINT64_MAX - 1 data/json-c-0.15/tests/test_parse_int64.c:178:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "18446744073709551615"); // UINT64_MAX data/json-c-0.15/tests/test_parse_int64.c:181:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "18446744073709551616"); // UINT64_MAX + 1 data/json-c-0.15/tests/test_parse_int64.c:185:2: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(buf, "123"); data/json-c-0.15/tests/test_util_file.c:70:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int d = open(outfile3, O_WRONLY | O_CREAT, 0600); data/json-c-0.15/tests/test_util_file.c:93:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int d = open(file, O_RDONLY, 0600); data/json-c-0.15/tests/test_util_file.c:168:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[PATH_MAX]; data/json-c-0.15/tests/test_util_file.c:171:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int d = open(filename, O_RDONLY, 0); data/json-c-0.15/tests/test_util_file.c:193:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[PATH_MAX]; data/json-c-0.15/tests/test_util_file.c:196:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int d = open(filename, O_RDONLY, 0); data/json-c-0.15/tests/test_util_file.c:255:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int d = open("/dev/null", O_RDONLY, 0); data/json-c-0.15/tests/test_util_file.c:285:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char filename[PATH_MAX]; data/json-c-0.15/tests/test_util_file.c:290:10: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int d = open(filename, O_RDONLY, 0); data/json-c-0.15/apps/json_parse.c:74:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((ret = read(fd, buf, sizeof(buf))) > 0) data/json-c-0.15/json_object.c:521:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). json_escape_str(pb, iter.key, strlen(iter.key), flags); data/json-c-0.15/json_object.c:728:38: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return printbuf_memappend(pb, sbuf, strlen(sbuf)); data/json-c-0.15/json_object.c:1154:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int userdata_len = strlen((const char *)jso->_userdata); data/json-c-0.15/json_object.c:1290:36: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return _json_object_new_string(s, strlen(s)); data/json-c-0.15/json_object.c:1371:45: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return _json_object_set_string_len(jso, s, strlen(s)); data/json-c-0.15/json_pointer.c:30:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int slen = strlen(s); data/json-c-0.15/json_pointer.c:31:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int skip = strlen(occur) - 1; /* length of the occurrence, minus the char we're replacing */ data/json-c-0.15/json_pointer.c:44:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int i, len = strlen(path); data/json-c-0.15/json_tokener.c:203:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). || json_tokener_get_parse_end(tok) != strlen(str) data/json-c-0.15/json_tokener.c:283:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len < -1) || (len == -1 && strlen(str) > INT32_MAX)) data/json-c-0.15/json_util.c:111:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while ((ret = read(fd, buf, JSON_FILE_BUF_SIZE)) > 0) data/json-c-0.15/json_util.c:200:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). wsize = (unsigned int)(strlen(json_str) & UINT_MAX); data/json-c-0.15/linkhash.c:489:37: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return hashlittle((const char *)k, strlen((const char *)k), random_seed); data/json-c-0.15/random_seed.c:198:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t nread = read(fd, &r, sizeof(r)); data/json-c-0.15/tests/test1.c:44:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (length != strlen(result)) data/json-c-0.15/tests/test_parse.c:52:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int test_string_len = strlen(test_string) + 1; // Including '\0' ! data/json-c-0.15/tests/test_parse.c:599:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). length = (int)strlen(step->string_to_parse); data/json-c-0.15/tests/test_printbuf.c:146:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). printbuf_length(pb), pb->buf, (int)strlen(pb->buf)); data/json-c-0.15/tests/test_util_file.c:112:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(d, buf, sb.st_size) < sb.st_size) ANALYSIS SUMMARY: Hits = 125 Lines analyzed = 12656 in approximately 0.41 seconds (31098 lines/second) Physical Source Lines of Code (SLOC) = 8153 Hits@level = [0] 427 [1] 20 [2] 80 [3] 6 [4] 19 [5] 0 Hits@level+ = [0+] 552 [1+] 125 [2+] 105 [3+] 25 [4+] 19 [5+] 0 Hits/KSLOC@level+ = [0+] 67.7051 [1+] 15.3318 [2+] 12.8787 [3+] 3.06636 [4+] 2.33043 [5+] 0 Dot directories skipped = 2 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.