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/cjson-1.7.14/cJSON.c Examining data/cjson-1.7.14/cJSON.h Examining data/cjson-1.7.14/cJSON_Utils.c Examining data/cjson-1.7.14/cJSON_Utils.h Examining data/cjson-1.7.14/fuzzing/afl.c Examining data/cjson-1.7.14/fuzzing/cjson_read_fuzzer.c Examining data/cjson-1.7.14/fuzzing/fuzz_main.c Examining data/cjson-1.7.14/test.c Examining data/cjson-1.7.14/tests/cjson_add.c Examining data/cjson-1.7.14/tests/common.h Examining data/cjson-1.7.14/tests/compare_tests.c Examining data/cjson-1.7.14/tests/json_patch_tests.c Examining data/cjson-1.7.14/tests/minify_tests.c Examining data/cjson-1.7.14/tests/misc_tests.c Examining data/cjson-1.7.14/tests/misc_utils_tests.c Examining data/cjson-1.7.14/tests/old_utils_tests.c Examining data/cjson-1.7.14/tests/parse_array.c Examining data/cjson-1.7.14/tests/parse_examples.c Examining data/cjson-1.7.14/tests/parse_hex4.c Examining data/cjson-1.7.14/tests/parse_number.c Examining data/cjson-1.7.14/tests/parse_object.c Examining data/cjson-1.7.14/tests/parse_string.c Examining data/cjson-1.7.14/tests/parse_value.c Examining data/cjson-1.7.14/tests/parse_with_opts.c Examining data/cjson-1.7.14/tests/print_array.c Examining data/cjson-1.7.14/tests/print_number.c Examining data/cjson-1.7.14/tests/print_object.c Examining data/cjson-1.7.14/tests/print_string.c Examining data/cjson-1.7.14/tests/print_value.c Examining data/cjson-1.7.14/tests/readme_examples.c Examining data/cjson-1.7.14/tests/unity/examples/example_1/src/ProductionCode.c Examining data/cjson-1.7.14/tests/unity/examples/example_1/src/ProductionCode.h Examining data/cjson-1.7.14/tests/unity/examples/example_1/src/ProductionCode2.c Examining data/cjson-1.7.14/tests/unity/examples/example_1/src/ProductionCode2.h Examining data/cjson-1.7.14/tests/unity/examples/example_1/test/TestProductionCode.c Examining data/cjson-1.7.14/tests/unity/examples/example_1/test/TestProductionCode2.c Examining data/cjson-1.7.14/tests/unity/examples/example_1/test/test_runners/TestProductionCode2_Runner.c Examining data/cjson-1.7.14/tests/unity/examples/example_1/test/test_runners/TestProductionCode_Runner.c Examining data/cjson-1.7.14/tests/unity/examples/example_2/src/ProductionCode.c Examining data/cjson-1.7.14/tests/unity/examples/example_2/src/ProductionCode.h Examining data/cjson-1.7.14/tests/unity/examples/example_2/src/ProductionCode2.c Examining data/cjson-1.7.14/tests/unity/examples/example_2/src/ProductionCode2.h Examining data/cjson-1.7.14/tests/unity/examples/example_2/test/TestProductionCode.c Examining data/cjson-1.7.14/tests/unity/examples/example_2/test/TestProductionCode2.c Examining data/cjson-1.7.14/tests/unity/examples/example_2/test/test_runners/TestProductionCode2_Runner.c Examining data/cjson-1.7.14/tests/unity/examples/example_2/test/test_runners/TestProductionCode_Runner.c Examining data/cjson-1.7.14/tests/unity/examples/example_2/test/test_runners/all_tests.c Examining data/cjson-1.7.14/tests/unity/examples/example_3/helper/UnityHelper.c Examining data/cjson-1.7.14/tests/unity/examples/example_3/helper/UnityHelper.h Examining data/cjson-1.7.14/tests/unity/examples/example_3/src/ProductionCode.c Examining data/cjson-1.7.14/tests/unity/examples/example_3/src/ProductionCode.h Examining data/cjson-1.7.14/tests/unity/examples/example_3/src/ProductionCode2.c Examining data/cjson-1.7.14/tests/unity/examples/example_3/src/ProductionCode2.h Examining data/cjson-1.7.14/tests/unity/examples/example_3/test/TestProductionCode.c Examining data/cjson-1.7.14/tests/unity/examples/example_3/test/TestProductionCode2.c Examining data/cjson-1.7.14/tests/unity/examples/unity_config.h Examining data/cjson-1.7.14/tests/unity/extras/fixture/src/unity_fixture.c Examining data/cjson-1.7.14/tests/unity/extras/fixture/src/unity_fixture.h Examining data/cjson-1.7.14/tests/unity/extras/fixture/src/unity_fixture_internals.h Examining data/cjson-1.7.14/tests/unity/extras/fixture/src/unity_fixture_malloc_overrides.h Examining data/cjson-1.7.14/tests/unity/extras/fixture/test/main/AllTests.c Examining data/cjson-1.7.14/tests/unity/extras/fixture/test/template_fixture_tests.c Examining data/cjson-1.7.14/tests/unity/extras/fixture/test/unity_fixture_Test.c Examining data/cjson-1.7.14/tests/unity/extras/fixture/test/unity_fixture_TestRunner.c Examining data/cjson-1.7.14/tests/unity/extras/fixture/test/unity_output_Spy.c Examining data/cjson-1.7.14/tests/unity/extras/fixture/test/unity_output_Spy.h Examining data/cjson-1.7.14/tests/unity/src/unity.c Examining data/cjson-1.7.14/tests/unity/src/unity.h Examining data/cjson-1.7.14/tests/unity/src/unity_internals.h Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_cmd.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_def.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_head1.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_head1.h Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_mock_cmd.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_mock_def.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_mock_head1.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_mock_head1.h Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_mock_new1.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_mock_new2.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_mock_param.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_mock_run1.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_mock_run2.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_mock_yaml.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_new1.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_new2.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_param.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_run1.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_run2.c Examining data/cjson-1.7.14/tests/unity/test/expectdata/testsample_yaml.c Examining data/cjson-1.7.14/tests/unity/test/testdata/CException.h Examining data/cjson-1.7.14/tests/unity/test/testdata/Defs.h Examining data/cjson-1.7.14/tests/unity/test/testdata/cmock.h Examining data/cjson-1.7.14/tests/unity/test/testdata/mockMock.h Examining data/cjson-1.7.14/tests/unity/test/testdata/testRunnerGenerator.c Examining data/cjson-1.7.14/tests/unity/test/testdata/testRunnerGeneratorSmall.c Examining data/cjson-1.7.14/tests/unity/test/testdata/testRunnerGeneratorWithMocks.c Examining data/cjson-1.7.14/tests/unity/test/tests/testparameterized.c Examining data/cjson-1.7.14/tests/unity/test/tests/testunity.c Examining data/cjson-1.7.14/tests/unity_setup.c FINAL RESULTS: data/cjson-1.7.14/cJSON.c:406:9: [4] (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). strcpy(object->valuestring, valuestring); data/cjson-1.7.14/cJSON_Utils.c:234:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf((char*)full_pointer, "/%lu%s", (unsigned long)child_index, target_pointer); /* /<array_index><path> */ data/cjson-1.7.14/cJSON_Utils.c:245:17: [4] (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). strcat((char*)full_pointer, (char*)target_pointer); data/cjson-1.7.14/cJSON_Utils.c:1120:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf((char*)full_path, "%s/", (const char*)path); data/cjson-1.7.14/cJSON_Utils.c:1186:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf((char*)new_path, "%s/%lu", path, (unsigned long)index); /* path of the current array element */ data/cjson-1.7.14/cJSON_Utils.c:1246:21: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf((char*)new_path, "%s/", path); data/cjson-1.7.14/tests/minify_tests.c:50:5: [4] (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). strcpy(minified, to_minify); data/cjson-1.7.14/tests/minify_tests.c:64:5: [4] (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). strcpy(minified, to_minify); data/cjson-1.7.14/tests/minify_tests.c:78:5: [4] (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). strcpy(minified, to_minify); data/cjson-1.7.14/tests/minify_tests.c:92:5: [4] (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). strcpy(minified, to_minify); data/cjson-1.7.14/tests/minify_tests.c:147:5: [4] (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). strcpy(buffer, to_minify); data/cjson-1.7.14/tests/parse_examples.c:68:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(test_path, TEST_DIR_PATH"%s", test_name); data/cjson-1.7.14/tests/parse_examples.c:69:5: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(expected_path, TEST_DIR_PATH"%s.expected", test_name); data/cjson-1.7.14/tests/unity/test/tests/testunity.c:4544:71: [4] (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). if (isfinite(lower)) sprintf(expected_lower, "%.6g", lower); else strcpy(expected_lower, expected); data/cjson-1.7.14/tests/unity/test/tests/testunity.c:4545:74: [4] (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). if (isfinite(higher)) sprintf(expected_higher, "%.6g", higher); else strcpy(expected_higher, expected); data/cjson-1.7.14/tests/old_utils_tests.c:151:18: [3] (random) random: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. buf[0] = random[i]; data/cjson-1.7.14/cJSON.c:122:12: [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 version[15]; data/cjson-1.7.14/cJSON.c:123:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(version, "%i.%i.%i", CJSON_VERSION_MAJOR, CJSON_VERSION_MINOR, CJSON_VERSION_PATCH); data/cjson-1.7.14/cJSON.c:200:5: [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(copy, string, length); data/cjson-1.7.14/cJSON.c:305: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 number_c_string[64]; data/cjson-1.7.14/cJSON.c:512:13: [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(newbuffer, p->buffer, p->offset + 1); data/cjson-1.7.14/cJSON.c:549: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 number_buffer[26] = {0}; /* temporary buffer to print the number into */ data/cjson-1.7.14/cJSON.c:561:18: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. length = sprintf((char*)number_buffer, "null"); data/cjson-1.7.14/cJSON.c:566:18: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. length = sprintf((char*)number_buffer, "%1.15g", d); data/cjson-1.7.14/cJSON.c:572:22: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. length = sprintf((char*)number_buffer, "%1.17g", d); data/cjson-1.7.14/cJSON.c:918:9: [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((char*)output, "\"\""); data/cjson-1.7.14/cJSON.c:959:9: [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(output + 1, input, output_length); data/cjson-1.7.14/cJSON.c:1005:21: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf((char*)output_pointer, "u%04x", *input_pointer); data/cjson-1.7.14/cJSON.c:1222:9: [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(printed, buffer->buffer, cjson_min(buffer->length, buffer->offset + 1)); data/cjson-1.7.14/cJSON.c:1378:13: [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((char*)output, "null"); data/cjson-1.7.14/cJSON.c:1387:13: [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((char*)output, "false"); data/cjson-1.7.14/cJSON.c:1396:13: [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((char*)output, "true"); data/cjson-1.7.14/cJSON.c:1416:13: [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(output, item->valuestring, raw_length); data/cjson-1.7.14/cJSON.c:1943:5: [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(reference, item, sizeof(cJSON)); data/cjson-1.7.14/cJSON_Utils.c:77:5: [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(copy, string, length); data/cjson-1.7.14/cJSON_Utils.c:804:5: [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(root, &replacement, sizeof(cJSON)); data/cjson-1.7.14/cJSON_Utils.c:1201:17: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf((char*)new_path, "%lu", (unsigned long)index); data/cjson-1.7.14/fuzzing/afl.c:37:12: [2] (misc) fopen: 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). file = fopen(filename, "rb"); data/cjson-1.7.14/fuzzing/cjson_read_fuzzer.c:62:9: [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(copied, data, size); data/cjson-1.7.14/fuzzing/fuzz_main.c:21:9: [2] (misc) fopen: 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). f = fopen(argv[1], "rb"); data/cjson-1.7.14/test.c:120:11: [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. const char *strings[7] = data/cjson-1.7.14/tests/common.h:54:12: [2] (misc) fopen: 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). file = fopen(filename, "rb"); data/cjson-1.7.14/tests/misc_tests.c:210: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 deep_json[CJSON_NESTING_LIMIT + 1]; data/cjson-1.7.14/tests/misc_tests.c:354: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 buffer[10]; data/cjson-1.7.14/tests/old_utils_tests.c:33: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. static const char *merges[15][3] = data/cjson-1.7.14/tests/old_utils_tests.c:142: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 buf[2] = {'\0', '\0'}; data/cjson-1.7.14/tests/parse_examples.c:215: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 test_13_wo_null[sizeof(test_13) - 1]; data/cjson-1.7.14/tests/parse_examples.c:216:5: [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(test_13_wo_null, test_13, sizeof(test_13) - 1); data/cjson-1.7.14/tests/parse_hex4.c:34: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 digits_lower[6]; data/cjson-1.7.14/tests/parse_hex4.c:35: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 digits_upper[6]; data/cjson-1.7.14/tests/parse_hex4.c:39:42: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. TEST_ASSERT_EQUAL_INT_MESSAGE(4, sprintf((char*)digits_lower, "%.4x", number), "sprintf failed."); data/cjson-1.7.14/tests/parse_hex4.c:40:42: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. TEST_ASSERT_EQUAL_INT_MESSAGE(4, sprintf((char*)digits_upper, "%.4X", number), "sprintf failed."); data/cjson-1.7.14/tests/parse_object.c:128:15: [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. const char *expected_names[7] = data/cjson-1.7.14/tests/print_array.c:29: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 printed_unformatted[1024]; data/cjson-1.7.14/tests/print_array.c:30: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 printed_formatted[1024]; data/cjson-1.7.14/tests/print_number.c:29: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 printed[1024]; data/cjson-1.7.14/tests/print_number.c:30: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 new_buffer[26]; data/cjson-1.7.14/tests/print_object.c:29: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 printed_unformatted[1024]; data/cjson-1.7.14/tests/print_object.c:30: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 printed_formatted[1024]; data/cjson-1.7.14/tests/print_string.c:29: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 printed[1024]; data/cjson-1.7.14/tests/print_string.c:49: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 ascii[0x7F]; data/cjson-1.7.14/tests/print_value.c:33: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 printed[1024]; data/cjson-1.7.14/tests/unity/extras/fixture/src/unity_fixture.c:166: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 unity_heap[UNITY_INTERNAL_HEAP_SIZE_BYTES]; data/cjson-1.7.14/tests/unity/extras/fixture/src/unity_fixture.c:213:5: [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(&mem[size], end, sizeof(end)); data/cjson-1.7.14/tests/unity/extras/fixture/src/unity_fixture.c:300:5: [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(newMem, oldMem, guard->size); data/cjson-1.7.14/tests/unity/extras/fixture/test/unity_fixture_Test.c:80:5: [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((char*)m1, "123456789"); data/cjson-1.7.14/tests/unity/extras/fixture/test/unity_fixture_Test.c:336:5: [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(TestAbortFrame, Unity.AbortFrame, sizeof(jmp_buf)); \ data/cjson-1.7.14/tests/unity/extras/fixture/test/unity_fixture_Test.c:342:5: [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(Unity.AbortFrame, TestAbortFrame, sizeof(jmp_buf)); \ data/cjson-1.7.14/tests/unity/src/unity.c:286:9: [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[16]; data/cjson-1.7.14/tests/unity/test/tests/testunity.c:3307: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 putcharSpyBuffer[SPY_BUFFER_MAX]; data/cjson-1.7.14/tests/unity/test/tests/testunity.c:4527: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 expected[18]; data/cjson-1.7.14/tests/unity/test/tests/testunity.c:4528: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 expected_lower[18]; data/cjson-1.7.14/tests/unity/test/tests/testunity.c:4529: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 expected_higher[18]; data/cjson-1.7.14/tests/unity/test/tests/testunity.c:4535:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(expected, "%.6g", f); data/cjson-1.7.14/tests/unity/test/tests/testunity.c:4538:39: [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. if(strcmp(expected, "-nan") == 0) strcpy(expected, "nan"); data/cjson-1.7.14/tests/unity/test/tests/testunity.c:4544:26: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. if (isfinite(lower)) sprintf(expected_lower, "%.6g", lower); else strcpy(expected_lower, expected); data/cjson-1.7.14/tests/unity/test/tests/testunity.c:4545:27: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. if (isfinite(higher)) sprintf(expected_higher, "%.6g", higher); else strcpy(expected_higher, expected); data/cjson-1.7.14/cJSON.c:194:14: [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 = strlen((const char*)string) + sizeof(""); data/cjson-1.7.14/cJSON.c:404:9: [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 (strlen(valuestring) <= strlen(object->valuestring)) data/cjson-1.7.14/cJSON.c:404:32: [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 (strlen(valuestring) <= strlen(object->valuestring)) data/cjson-1.7.14/cJSON.c:532:23: [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). buffer->offset += strlen((const char*)buffer_pointer); data/cjson-1.7.14/cJSON.c:1083: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). buffer_length = strlen(value) + sizeof(""); data/cjson-1.7.14/cJSON.c:1410:26: [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). raw_length = strlen(item->valuestring) + sizeof(""); data/cjson-1.7.14/cJSON_Utils.c:71:14: [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 = strlen((const char*)string) + sizeof(""); data/cjson-1.7.14/cJSON_Utils.c:224:76: [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). unsigned char *full_pointer = (unsigned char*)cJSON_malloc(strlen((char*)target_pointer) + 20 + sizeof("/")); data/cjson-1.7.14/cJSON_Utils.c:242:76: [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). unsigned char *full_pointer = (unsigned char*)cJSON_malloc(strlen((char*)target_pointer) + pointer_encoded_length((unsigned char*)current_child->string) + 2); data/cjson-1.7.14/cJSON_Utils.c:1117:30: [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). size_t path_length = strlen((const char*)path); data/cjson-1.7.14/cJSON_Utils.c:1173:68: [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). unsigned char *new_path = (unsigned char*)cJSON_malloc(strlen((const char*)path) + 20 + sizeof("/")); /* Allow space for 64bit int. log10(2^64) = 20 */ data/cjson-1.7.14/cJSON_Utils.c:1242:42: [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). size_t path_length = strlen((const char*)path); data/cjson-1.7.14/test.c:57:11: [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). len = strlen(out) + 5; data/cjson-1.7.14/test.c:66:16: [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). len_fail = strlen(out); data/cjson-1.7.14/tests/parse_array.c:49: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). buffer.length = strlen(json) + sizeof(""); data/cjson-1.7.14/tests/parse_array.c:60: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). buffer.length = strlen(json) + sizeof(""); data/cjson-1.7.14/tests/parse_examples.c:58: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). test_name_length = strlen(test_name); data/cjson-1.7.14/tests/parse_examples.c:190: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). TEST_ASSERT_EQUAL_PTR_MESSAGE(test12 + strlen(test12), cJSON_GetErrorPtr(), "Error pointer is incorrect."); data/cjson-1.7.14/tests/parse_number.c:50: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). buffer.length = strlen(string) + sizeof(""); data/cjson-1.7.14/tests/parse_object.c:57:26: [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). parsebuffer.length = strlen(json) + sizeof(""); data/cjson-1.7.14/tests/parse_object.c:69:26: [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). parsebuffer.length = strlen(json) + sizeof(""); data/cjson-1.7.14/tests/parse_string.c:50: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). buffer.length = strlen(string) + sizeof(""); data/cjson-1.7.14/tests/parse_string.c:64: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). buffer.length = strlen(string) + sizeof(""); data/cjson-1.7.14/tests/parse_value.c:48: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). buffer.length = strlen(string) + sizeof(""); data/cjson-1.7.14/tests/parse_with_opts.c:58: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). TEST_ASSERT_EQUAL_PTR(json + strlen(json), parse_end); data/cjson-1.7.14/tests/parse_with_opts.c:59: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). TEST_ASSERT_EQUAL_PTR(json + strlen(json), cJSON_GetErrorPtr()); data/cjson-1.7.14/tests/print_array.c:39:26: [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). parsebuffer.length = strlen(input) + sizeof(""); data/cjson-1.7.14/tests/print_object.c:40:26: [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). parsebuffer.length = strlen(input) + sizeof(""); data/cjson-1.7.14/tests/print_value.c:44:26: [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). parsebuffer.length = strlen(input) + sizeof(""); data/cjson-1.7.14/tests/unity/test/tests/testunity.c:1732:58: [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). TEST_ASSERT_EQUAL_STRING_LEN(testString, testString, strlen(testString)); data/cjson-1.7.14/tests/unity/test/tests/testunity.c:3374:48: [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). TEST_ASSERT_EQUAL_INT(sizeof(UNITY_INT)*2, strlen(getBufferPutcharSpy())); ANALYSIS SUMMARY: Hits = 108 Lines analyzed = 21999 in approximately 0.57 seconds (38270 lines/second) Physical Source Lines of Code (SLOC) = 16772 Hits@level = [0] 39 [1] 31 [2] 61 [3] 1 [4] 15 [5] 0 Hits@level+ = [0+] 147 [1+] 108 [2+] 77 [3+] 16 [4+] 15 [5+] 0 Hits/KSLOC@level+ = [0+] 8.76461 [1+] 6.4393 [2+] 4.59098 [3+] 0.953971 [4+] 0.894348 [5+] 0 Dot directories skipped = 1 (--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.