Task #520 - added.err
back to task #520download
Error: CLANG_WARNING: iniparser-4.2.2-build/iniparser-4.2.2/src/dictionary.c:158:13: warning[unix.Malloc]: Argument to free() is a constant address (128), which is not memory allocated by malloc() # 156| d->hash = (unsigned*) calloc(size, sizeof *d->hash); # 157| if (!d->size || !d->val || !d->hash) { # 158|-> free((void *) d->size); # 159| free((void *) d->val); # 160| free((void *) d->hash); Error: GCC_ANALYZER_WARNING (CWE-401): iniparser-4.2.2-build/iniparser-4.2.2/src/dictionary.c: scope_hint: In function ‘dictionary_new’ iniparser-4.2.2-build/iniparser-4.2.2/src/dictionary.c:161:13: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’ # 159| free((void *) d->val); # 160| free((void *) d->hash); # 161|-> free(d); # 162| d = NULL; # 163| } Error: GCC_ANALYZER_WARNING (CWE-476): iniparser-4.2.2-build/iniparser-4.2.2/src/dictionary.c: scope_hint: In function ‘dictionary_get.part.0’ iniparser-4.2.2-build/iniparser-4.2.2/src/dictionary.c:219:19: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*d.key + i * 8’ iniparser-4.2.2-build/iniparser-4.2.2/test/test_dictionary.c:4: included_from: Included from here. iniparser-4.2.2-build/iniparser-4.2.2/test/CuTest.h:102:107: note: in definition of macro ‘CuAssertPtrEquals’ # 217| hash = dictionary_hash(key); # 218| for (i=0 ; i<d->size ; i++) { # 219|-> if (d->key[i]==NULL) # 220| continue ; # 221| /* Compare hash */ Error: GCC_ANALYZER_WARNING (CWE-476): iniparser-4.2.2-build/iniparser-4.2.2/src/dictionary.c: scope_hint: In function ‘dictionary_set’ iniparser-4.2.2-build/iniparser-4.2.2/src/dictionary.c:295:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*d.key + i * 8’ # 293| d->size. Because d->n < d->size this will necessarily # 294| terminate. */ # 295|-> for (i=d->n ; d->key[i] ; ) { # 296| if(++i == d->size) i = 0; # 297| } Error: GCC_ANALYZER_WARNING (CWE-476): iniparser-4.2.2-build/iniparser-4.2.2/src/iniparser.c: scope_hint: In function ‘parse_quoted_value.part.0’ iniparser-4.2.2-build/iniparser-4.2.2/src/iniparser.c:700:14: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘value’ # 698| } # 699| end_of_value: # 700|-> value[v] = '\0'; # 701| free(quoted); # 702| } Error: GCC_ANALYZER_WARNING (CWE-476): iniparser-4.2.2-build/iniparser-4.2.2/test/CuTest.c: scope_hint: In function ‘CuStringInit’ iniparser-4.2.2-build/iniparser-4.2.2/test/CuTest.c:37:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘string.buffer’ # 35| str->size = STRING_MAX; # 36| str->buffer = (char*) malloc(sizeof(char) * str->size); # 37|-> str->buffer[0] = '\0'; # 38| } # 39| Error: GCC_ANALYZER_WARNING (CWE-401): iniparser-4.2.2-build/iniparser-4.2.2/test/CuTest.c:59:21: warning[-Wanalyzer-malloc-leak]: leak of ‘*str.buffer’ iniparser-4.2.2-build/iniparser-4.2.2/test/CuTest.c: scope_hint: In function ‘CuStringAppend’ iniparser-4.2.2-build/iniparser-4.2.2/test/CuTest.c: scope_hint: In function ‘CuStringAppend’ # 57| void CuStringResize(CuString* str, int newSize) # 58| { # 59|-> str->buffer = (char*) realloc(str->buffer, sizeof(char) * newSize); # 60| str->size = newSize; # 61| } Error: GCC_ANALYZER_WARNING (CWE-401): iniparser-4.2.2-build/iniparser-4.2.2/test/CuTest.c:59:21: warning[-Wanalyzer-malloc-leak]: leak of ‘string.buffer’ iniparser-4.2.2-build/iniparser-4.2.2/test/CuTest.c: scope_hint: In function ‘CuStringAppend’ # 57| void CuStringResize(CuString* str, int newSize) # 58| { # 59|-> str->buffer = (char*) realloc(str->buffer, sizeof(char) * newSize); # 60| str->size = newSize; # 61| } Error: GCC_ANALYZER_WARNING (CWE-688): iniparser-4.2.2-build/iniparser-4.2.2/test/CuTest.c: scope_hint: In function ‘CuStringAppend’ iniparser-4.2.2-build/iniparser-4.2.2/test/CuTest.c:75:9: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected iniparser-4.2.2-build/iniparser-4.2.2/test/CuTest.c: scope_hint: In function ‘CuStringAppend’ <built-in>: note: argument 1 of ‘__builtin_strcat’ must be non-null # 73| CuStringResize(str, str->length + length + 1 + STRING_INC); # 74| str->length += length; # 75|-> strcat(str->buffer, text); # 76| } # 77| Error: GCC_ANALYZER_WARNING (CWE-476): iniparser-4.2.2-build/iniparser-4.2.2/test/CuTest.c:281:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘testSuite’ iniparser-4.2.2-build/iniparser-4.2.2/test/CuTest.c:8: included_from: Included from here. iniparser-4.2.2-build/iniparser-4.2.2/test/CuTest.c: scope_hint: In function ‘CuSuiteNew’ iniparser-4.2.2-build/iniparser-4.2.2/test/CuTest.c:288:30: note: in expansion of macro ‘CU_ALLOC’ # 279| void CuSuiteInit(CuSuite* testSuite) # 280| { # 281|-> testSuite->count = 0; # 282| testSuite->failCount = 0; # 283| memset(testSuite->list, 0, sizeof(testSuite->list)); Error: CPPCHECK_WARNING: iniparser-4.2.2-build/iniparser-4.2.2/test/test_dictionary.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): iniparser-4.2.2-build/iniparser-4.2.2/test/test_dictionary.c: scope_hint: In function ‘get_dump’ iniparser-4.2.2-build/iniparser-4.2.2/test/test_dictionary.c:127:9: warning[-Wanalyzer-malloc-leak]: leak of ‘dump_buff’ # 125| } # 126| if (fread(dump_buff, 1, dump_size, fd) != (size_t)dump_size) { # 127|-> fclose(fd); # 128| return NULL; # 129| } Error: CPPCHECK_WARNING (CWE-401): iniparser-4.2.2-build/iniparser-4.2.2/test/test_dictionary.c:128: error[memleak]: Memory leak: dump_buff # 126| if (fread(dump_buff, 1, dump_size, fd) != (size_t)dump_size) { # 127| fclose(fd); # 128|-> return NULL; # 129| } # 130| Error: CPPCHECK_WARNING: iniparser-4.2.2-build/iniparser-4.2.2/test/test_iniparser.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: iniparser-4.2.2-build/iniparser-4.2.2/test/test_iniparser.c:763:17: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 761| dir = opendir(GOOD_INI_PATH); # 762| CuAssertPtrNotNullMsg(tc, "Cannot open good .ini conf directory", dir); # 763|-> for (curr = readdir(dir); curr != NULL; curr = readdir(dir)) { # 764| sprintf(ini_path, "%s/%s", GOOD_INI_PATH, curr->d_name); # 765| stat(ini_path, &curr_stat); Error: CLANG_WARNING: iniparser-4.2.2-build/iniparser-4.2.2/test/test_iniparser.c:777:17: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 775| dir = opendir(BAD_INI_PATH); # 776| CuAssertPtrNotNullMsg(tc, "Cannot open bad .ini conf directory", dir); # 777|-> for (curr = readdir(dir); curr != NULL; curr = readdir(dir)) { # 778| sprintf(ini_path, "%s/%s", BAD_INI_PATH, curr->d_name); # 779| stat(ini_path, &curr_stat); Error: CLANG_WARNING: iniparser-4.2.2-build/iniparser-4.2.2/test/test_iniparser.c:1014:60: warning[core.NullDereference]: Access to field 'key' results in a dereference of a null pointer (loaded from variable 'dic') # 1012| for (i = 1; i < 8; i++) # 1013| { # 1014|-> CuAssertIntEquals(tc, 1, iniparser_find_entry(dic, dic->key[i])); # 1015| } # 1016| CuAssertIntEquals(tc, 0, iniparser_find_entry(dic, "dummy"));