Task #438 - cjson-1.7.15-4.fc40/scan-results.err
back to task #438download
Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): cjson-1.7.15-build/cJSON-1.7.15/tests/common.h:26: included_from: Included from here. cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:29: included_from: Included from here. cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cJSON_SetValuestring’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:408:45: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘object’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cJSON_SetValuestring’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1067:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1067:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:300:49: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1041:9: note: in expansion of macro ‘cannot_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1041:9: note: in expansion of macro ‘cannot_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1046:12: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1317:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1317:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1324:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1324:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1331:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1331:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1339:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1339:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1344:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1344:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1349:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1349:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1354:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1354:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1608:9: note: in expansion of macro ‘cannot_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:300:49: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1041:9: note: in expansion of macro ‘cannot_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1041:9: note: in expansion of macro ‘cannot_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1046:12: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1615:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cJSON_SetValuestring’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cJSON_SetValuestring’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cJSON_SetValuestring’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cJSON_SetValuestring’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cJSON_SetValuestring’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cJSON_SetValuestring’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cJSON_SetValuestring’ # 406| return NULL; # 407| } # 408|-> if (strlen(valuestring) <= strlen(object->valuestring)) # 409| { # 410| strcpy(object->valuestring, valuestring); Error: CPPCHECK_WARNING (CWE-476): cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2274: warning[nullPointer]: Possible null pointer dereference: newitem # 2272| } # 2273| # 2274|-> newitem->next = after_inserted; # 2275| newitem->prev = after_inserted->prev; # 2276| after_inserted->prev = newitem; Error: CLANG_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:29: included_from: Included from here. cjson-1.7.15-build/cJSON-1.7.15/tests/common.h:26: included_from: Included from here. cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2274:19: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'newitem') # 2272| } # 2273| # 2274|-> newitem->next = after_inserted; # 2275| newitem->prev = after_inserted->prev; # 2276| after_inserted->prev = newitem; Error: CPPCHECK_WARNING (CWE-476): cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2275: warning[nullPointer]: Possible null pointer dereference: newitem # 2273| # 2274| newitem->next = after_inserted; # 2275|-> newitem->prev = after_inserted->prev; # 2276| after_inserted->prev = newitem; # 2277| if (after_inserted == array->child) Error: CPPCHECK_WARNING (CWE-476): cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2277: warning[nullPointer]: Possible null pointer dereference: array # 2275| newitem->prev = after_inserted->prev; # 2276| after_inserted->prev = newitem; # 2277|-> if (after_inserted == array->child) # 2278| { # 2279| array->child = newitem; Error: GCC_ANALYZER_WARNING (CWE-126): cjson-1.7.15-build/cJSON-1.7.15/tests/common.h:26: included_from: Included from here. cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:29: included_from: Included from here. cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘skip_oneline_comment’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2784:20: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2784:20: note: read of 1 byte from after the end of ‘string’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2784:20: note: valid subscripts for ‘string’ are ‘[0]’ to ‘[6]’ # └───────────────────────┘ # ^ # 2782| *input += static_strlen("//"); # 2783| # 2784|-> for (; (*input)[0] != '\0'; ++(*input)) # 2785| { # 2786| if ((*input)[0] == '\n') { Error: GCC_ANALYZER_WARNING (CWE-126): cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘skip_multiline_comment’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2797:20: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2797:20: note: read of 1 byte from after the end of ‘string’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2797:20: note: valid subscripts for ‘string’ are ‘[0]’ to ‘[6]’ # └───────────────────────┘ # ^ # 2795| *input += static_strlen("/*"); # 2796| # 2797|-> for (; (*input)[0] != '\0'; ++(*input)) # 2798| { # 2799| if (((*input)[0] == '*') && ((*input)[1] == '/')) Error: GCC_ANALYZER_WARNING (CWE-126): cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2799:46: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2799:46: note: read of 1 byte from after the end of ‘string’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2799:46: note: valid subscripts for ‘string’ are ‘[0]’ to ‘[6]’ # └───────────────────────┘ # ^ # 2797| for (; (*input)[0] != '\0'; ++(*input)) # 2798| { # 2799|-> if (((*input)[0] == '*') && ((*input)[1] == '/')) # 2800| { # 2801| *input += static_strlen("*/"); Error: GCC_ANALYZER_WARNING (CWE-126): cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘minify_string’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2821:54: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2821:54: note: read of 1 byte from after the end of ‘string’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2821:54: note: valid subscripts for ‘string’ are ‘[0]’ to ‘[6]’ # └───────────────────────┘ # ^ # 2819| *output += static_strlen("\""); # 2820| return; # 2821|-> } else if (((*input)[0] == '\\') && ((*input)[1] == '\"')) { # 2822| (*output)[1] = (*input)[1]; # 2823| *input += static_strlen("\""); Error: GCC_ANALYZER_WARNING (CWE-121): cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2822:26: warning[-Wanalyzer-out-of-bounds]: stack-based buffer overflow cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2822:26: note: write of 1 byte to beyond the end of ‘string’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2822:26: note: valid subscripts for ‘string’ are ‘[0]’ to ‘[6]’ # 2820| return; # 2821| } else if (((*input)[0] == '\\') && ((*input)[1] == '\"')) { # 2822|-> (*output)[1] = (*input)[1]; # 2823| *input += static_strlen("\""); # 2824| *output += static_strlen("\""); Error: GCC_ANALYZER_WARNING (CWE-126): cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cJSON_Minify’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2850:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2850:25: note: read of 1 byte from after the end of ‘pending_escape’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:2850:25: note: valid subscripts for ‘pending_escape’ are ‘[0]’ to ‘[2]’ # └───────────────────────┘ # ^ # 2848| # 2849| case '/': # 2850|-> if (json[1] == '/') # 2851| { # 2852| skip_oneline_comment(&json); Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/fuzzing/cjson_read_fuzzer.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): cjson-1.7.15-build/cJSON-1.7.15/fuzzing/fuzz_main.c: scope_hint: In function ‘main’ cjson-1.7.15-build/cJSON-1.7.15/fuzzing/fuzz_main.c:33:7: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’ # 31| rewind(f); # 32| # 33|-> if(siz_buf < 1) goto err; # 34| # 35| buf = (char*)malloc((size_t)siz_buf); Error: GCC_ANALYZER_WARNING (CWE-401): cjson-1.7.15-build/cJSON-1.7.15/fuzzing/fuzz_main.c:33:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’ # 31| rewind(f); # 32| # 33|-> if(siz_buf < 1) goto err; # 34| # 35| buf = (char*)malloc((size_t)siz_buf); Error: GCC_ANALYZER_WARNING (CWE-775): cjson-1.7.15-build/cJSON-1.7.15/fuzzing/fuzz_main.c:35:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’ # 33| if(siz_buf < 1) goto err; # 34| # 35|-> buf = (char*)malloc((size_t)siz_buf); # 36| if(buf == NULL) # 37| { Error: GCC_ANALYZER_WARNING (CWE-401): cjson-1.7.15-build/cJSON-1.7.15/fuzzing/fuzz_main.c:35:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’ # 33| if(siz_buf < 1) goto err; # 34| # 35|-> buf = (char*)malloc((size_t)siz_buf); # 36| if(buf == NULL) # 37| { Error: GCC_ANALYZER_WARNING (CWE-775): cjson-1.7.15-build/cJSON-1.7.15/fuzzing/fuzz_main.c:42:7: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(argv[1], "rb")’ # 40| } # 41| # 42|-> if(fread(buf, (size_t)siz_buf, 1, f) != 1) # 43| { # 44| fprintf(stderr, "fread() failed\n"); Error: GCC_ANALYZER_WARNING (CWE-401): cjson-1.7.15-build/cJSON-1.7.15/fuzzing/fuzz_main.c:42:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(argv[1], "rb")’ # 40| } # 41| # 42|-> if(fread(buf, (size_t)siz_buf, 1, f) != 1) # 43| { # 44| fprintf(stderr, "fread() failed\n"); Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/test.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:126:5: warning[unix.Malloc]: Potential memory leak # 124| cJSON_InitHooks(&failing_hooks); # 125| # 126|-> TEST_ASSERT_NULL(cJSON_CreateIntArray(numbers, 3)); # 127| # 128| cJSON_InitHooks(NULL); Error: CLANG_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:137:5: warning[unix.Malloc]: Potential memory leak # 135| cJSON_InitHooks(&failing_hooks); # 136| # 137|-> TEST_ASSERT_NULL(cJSON_CreateFloatArray(numbers, 3)); # 138| # 139| cJSON_InitHooks(NULL); Error: CLANG_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:148:5: warning[unix.Malloc]: Potential memory leak # 146| cJSON_InitHooks(&failing_hooks); # 147| # 148|-> TEST_ASSERT_NULL(cJSON_CreateDoubleArray(numbers, 3)); # 149| # 150| cJSON_InitHooks(NULL); Error: CLANG_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:159:5: warning[unix.Malloc]: Potential memory leak # 157| cJSON_InitHooks(&failing_hooks); # 158| # 159|-> TEST_ASSERT_NULL(cJSON_CreateStringArray(strings, 3)); # 160| # 161| cJSON_InitHooks(NULL); Error: GCC_ANALYZER_WARNING (CWE-476): cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:16: included_from: Included from here. cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:28: included_from: Included from here. cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c: scope_hint: In function ‘cJSON_add_object_should_add_object’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:362:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:656:133: note: in definition of macro ‘UNITY_TEST_ASSERT_EQUAL_INT’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:362:5: note: in expansion of macro ‘TEST_ASSERT_EQUAL_INT’ cjson-1.7.15-build/cJSON-1.7.15/tests/common.h:26: included_from: Included from here. cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:29: included_from: Included from here. cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:652:102: note: in definition of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:361:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cJSON_add_object_should_add_object’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:652:102: note: in definition of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:361:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c: scope_hint: In function ‘cJSON_add_object_should_add_object’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:361:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:652:122: note: in expansion of macro ‘UNITY_TEST_FAIL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:361:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:656:133: note: in definition of macro ‘UNITY_TEST_ASSERT_EQUAL_INT’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:362:5: note: in expansion of macro ‘TEST_ASSERT_EQUAL_INT’ # 360| cJSON_AddObjectToObject(root, "object"); # 361| TEST_ASSERT_NOT_NULL(object = cJSON_GetObjectItemCaseSensitive(root, "object")); # 362|-> TEST_ASSERT_EQUAL_INT(object->type, cJSON_Object); # 363| # 364| cJSON_Delete(root); Error: GCC_ANALYZER_WARNING (CWE-476): cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c: scope_hint: In function ‘cJSON_add_array_should_add_array’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:397:32: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:656:133: note: in definition of macro ‘UNITY_TEST_ASSERT_EQUAL_INT’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:397:5: note: in expansion of macro ‘TEST_ASSERT_EQUAL_INT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:652:102: note: in definition of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:396:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cJSON_add_array_should_add_array’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:652:102: note: in definition of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:396:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c: scope_hint: In function ‘cJSON_add_array_should_add_array’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:396:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:652:122: note: in expansion of macro ‘UNITY_TEST_FAIL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:396:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:656:133: note: in definition of macro ‘UNITY_TEST_ASSERT_EQUAL_INT’ cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:397:5: note: in expansion of macro ‘TEST_ASSERT_EQUAL_INT’ # 395| cJSON_AddArrayToObject(root, "array"); # 396| TEST_ASSERT_NOT_NULL(array = cJSON_GetObjectItemCaseSensitive(root, "array")); # 397|-> TEST_ASSERT_EQUAL_INT(array->type, cJSON_Array); # 398| # 399| cJSON_Delete(root); Error: CLANG_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/cjson_add.c:418:5: warning[unix.Malloc]: Potential memory leak # 416| cJSON_InitHooks(&failing_hooks); # 417| # 418|-> TEST_ASSERT_NULL(cJSON_AddArrayToObject(root, "array")); # 419| # 420| cJSON_InitHooks(NULL); Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/compare_tests.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c: scope_hint: In function ‘cjson_minify_should_remove_single_line_comments’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:50:5: warning[-Wanalyzer-null-argument]: use of NULL ‘minified’ where non-null expected cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:16: included_from: Included from here. cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:28: included_from: Included from here. cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:49:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:49:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:652:122: note: in expansion of macro ‘UNITY_TEST_FAIL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:49:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ <built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null # 48| char* minified = (char*) malloc(sizeof(to_minify)); # 49| TEST_ASSERT_NOT_NULL(minified); # 50|-> strcpy(minified, to_minify); # 51| # 52| cJSON_Minify(minified); Error: GCC_ANALYZER_WARNING (CWE-688): cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c: scope_hint: In function ‘cjson_minify_should_remove_spaces’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:64:5: warning[-Wanalyzer-null-argument]: use of NULL ‘minified’ where non-null expected cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:63:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:63:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:652:122: note: in expansion of macro ‘UNITY_TEST_FAIL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:63:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ <built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null # 62| char* minified = (char*) malloc(sizeof(to_minify)); # 63| TEST_ASSERT_NOT_NULL(minified); # 64|-> strcpy(minified, to_minify); # 65| # 66| cJSON_Minify(minified); Error: GCC_ANALYZER_WARNING (CWE-688): cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c: scope_hint: In function ‘cjson_minify_should_remove_multiline_comments’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:78:5: warning[-Wanalyzer-null-argument]: use of NULL ‘minified’ where non-null expected cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:77:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:77:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:652:122: note: in expansion of macro ‘UNITY_TEST_FAIL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:77:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ <built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null # 76| char* minified = (char*) malloc(sizeof(to_minify)); # 77| TEST_ASSERT_NOT_NULL(minified); # 78|-> strcpy(minified, to_minify); # 79| # 80| cJSON_Minify(minified); Error: GCC_ANALYZER_WARNING (CWE-688): cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c: scope_hint: In function ‘cjson_minify_should_not_modify_strings’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:92:5: warning[-Wanalyzer-null-argument]: use of NULL ‘minified’ where non-null expected cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:91:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:91:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:652:122: note: in expansion of macro ‘UNITY_TEST_FAIL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:91:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ <built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null # 90| char* minified = (char*) malloc(sizeof(to_minify)); # 91| TEST_ASSERT_NOT_NULL(minified); # 92|-> strcpy(minified, to_minify); # 93| # 94| cJSON_Minify(minified); Error: GCC_ANALYZER_WARNING (CWE-688): cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c: scope_hint: In function ‘cjson_minify_should_minify_json’ cjson-1.7.15-build/cJSON-1.7.15/tests/minify_tests.c:147:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buffer’ where non-null expected <built-in>: note: argument 1 of ‘__builtin_strcpy’ must be non-null # 145| # 146| char *buffer = (char*) malloc(sizeof(to_minify)); # 147|-> strcpy(buffer, to_minify); # 148| # 149| cJSON_Minify(buffer); Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-476): cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:16: included_from: Included from here. cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:28: included_from: Included from here. cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:637:81: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:730:160: note: in definition of macro ‘UNITY_TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:637:5: note: in expansion of macro ‘TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1067:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1067:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:300:49: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1041:9: note: in expansion of macro ‘cannot_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1041:9: note: in expansion of macro ‘cannot_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1046:12: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1317:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1317:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1324:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1324:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1331:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1331:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1339:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1339:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1344:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1344:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1349:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1349:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1354:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1354:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1608:9: note: in expansion of macro ‘cannot_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:300:49: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1041:9: note: in expansion of macro ‘cannot_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1041:9: note: in expansion of macro ‘cannot_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1046:12: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1615:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:635:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:652:122: note: in expansion of macro ‘UNITY_TEST_FAIL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:635:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:730:160: note: in definition of macro ‘UNITY_TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:637:5: note: in expansion of macro ‘TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:730:160: note: in definition of macro ‘UNITY_TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:637:5: note: in expansion of macro ‘TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:730:160: note: in definition of macro ‘UNITY_TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:637:5: note: in expansion of macro ‘TEST_ASSERT_EQUAL_STRING’ # 635| TEST_ASSERT_NOT_NULL(return_value); # 636| TEST_ASSERT_EQUAL_PTR_MESSAGE(ptr1, return_value, "new valuestring shorter than old should not reallocate memory"); # 637|-> TEST_ASSERT_EQUAL_STRING(short_valuestring, cJSON_GetObjectItem(root, "one")->valuestring); # 638| # 639| /* we needn't to free the original valuestring manually */ Error: GCC_ANALYZER_WARNING (CWE-476): cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:644:80: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:730:160: note: in definition of macro ‘UNITY_TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:644:5: note: in expansion of macro ‘TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1067:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1067:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:300:49: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1041:9: note: in expansion of macro ‘cannot_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1041:9: note: in expansion of macro ‘cannot_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1046:12: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1317:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1317:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1324:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1324:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1331:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1331:9: note: in expansion of macro ‘can_read’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1339:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1339:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1344:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1344:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1349:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1349:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1354:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1354:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1608:9: note: in expansion of macro ‘cannot_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:300:49: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1041:9: note: in expansion of macro ‘cannot_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1041:9: note: in expansion of macro ‘cannot_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1046:12: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c:1615:9: note: in expansion of macro ‘can_access_at_index’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:635:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:652:122: note: in expansion of macro ‘UNITY_TEST_FAIL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:635:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:730:160: note: in definition of macro ‘UNITY_TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:637:5: note: in expansion of macro ‘TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:730:160: note: in definition of macro ‘UNITY_TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:637:5: note: in expansion of macro ‘TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:642:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:652:122: note: in expansion of macro ‘UNITY_TEST_FAIL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:654:98: note: in expansion of macro ‘UNITY_TEST_ASSERT’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.h:125:100: note: in expansion of macro ‘UNITY_TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:642:5: note: in expansion of macro ‘TEST_ASSERT_NOT_NULL’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:730:160: note: in definition of macro ‘UNITY_TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:644:5: note: in expansion of macro ‘TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/cJSON.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:730:160: note: in definition of macro ‘UNITY_TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:644:5: note: in expansion of macro ‘TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c: scope_hint: In function ‘cjson_set_valuestring_to_object_should_not_leak_memory’ cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity_internals.h:730:160: note: in definition of macro ‘UNITY_TEST_ASSERT_EQUAL_STRING’ cjson-1.7.15-build/cJSON-1.7.15/tests/misc_tests.c:644:5: note: in expansion of macro ‘TEST_ASSERT_EQUAL_STRING’ # 642| TEST_ASSERT_NOT_NULL(return_value); # 643| TEST_ASSERT_NOT_EQUAL_MESSAGE(ptr1, return_value, "new valuestring longer than old should reallocate memory") # 644|-> TEST_ASSERT_EQUAL_STRING(long_valuestring, cJSON_GetObjectItem(root, "one")->valuestring); # 645| # 646| return_value = cJSON_SetValuestring(cJSON_GetObjectItem(root, "two"), long_valuestring); Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/parse_array.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/parse_examples.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/parse_examples.c:251:1: warning[core.StackAddressEscape]: Address of stack memory associated with local variable 'test_14' is still referred to by the global variable 'global_error' upon returning to the caller. This will be a dangling reference # 249| cJSON_Delete(tree); # 250| } # 251|-> } # 252| # 253| int CJSON_CDECL main(void) Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/parse_hex4.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/parse_number.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/parse_object.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/parse_object.c:48:5: warning[core.NullDereference]: Access to field 'string' results in a dereference of a null pointer (loaded from variable 'child_item') # 46| { # 47| TEST_ASSERT_NOT_NULL_MESSAGE(child_item, "Child item is NULL."); # 48|-> TEST_ASSERT_NOT_NULL_MESSAGE(child_item->string, "Child item doesn't have a name."); # 49| TEST_ASSERT_EQUAL_STRING_MESSAGE(name, child_item->string, "Child item has the wrong name."); # 50| TEST_ASSERT_BITS(0xFF, type, child_item->type); Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/parse_string.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/parse_value.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/parse_with_opts.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/print_array.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/print_number.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/print_object.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/print_string.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/print_value.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/readme_examples.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: cjson-1.7.15-build/cJSON-1.7.15/tests/unity/src/unity.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches.