Task #649 - dotconf-1.3-35.fc40/scan-results.err
back to task #649download
Error: CPPCHECK_WARNING: dotconf-1.3-build/dotconf-1.3/src/dotconf.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: dotconf-1.3-build/dotconf-1.3/src/dotconf.c:114:15: warning[core.NullDereference]: Dereference of null pointer # 112| int i; # 113| # 114|-> for (i = 0; (options[i].name && options[i].name[0]); i++) ; # 115| if (options[i].type == ARG_NAME && options[i].callback) # 116| return &options[i]; Error: GCC_ANALYZER_WARNING (CWE-688): dotconf-1.3-build/dotconf-1.3/src/dotconf.c: scope_hint: In function ‘dotconf_get_here_document’ dotconf-1.3-build/dotconf-1.3/src/dotconf.c:343:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘here_doc’ where non-null expected dotconf-1.3-build/dotconf-1.3/src/dotconf.c:67: included_from: Included from here. dotconf-1.3-build/dotconf-1.3/src/dotconf.h:45:44: note: in definition of macro ‘DOTCONF_CB’ <built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null # 341| */ # 342| here_doc = malloc(configfile->size); /* allocate buffer memory */ # 343|-> memset(here_doc, 0, configfile->size); # 344| # 345| here_string = 1; Error: COMPILER_WARNING (CWE-681): dotconf-1.3-build/dotconf-1.3/src/dotconf.c: scope_hint: In function ‘dotconf_set_command’ dotconf-1.3-build/dotconf-1.3/src/dotconf.c:499:42: warning[-Wpointer-sign]: pointer targets in passing argument 1 of ‘strlen’ differ in signedness # 499 | signed char *eob = args + strlen(args); # | ^~~~ # | | # | signed char * dotconf-1.3-build/dotconf-1.3/src/dotconf.c:26: included_from: Included from here. /usr/include/string.h:407:35: note: expected ‘const char *’ but argument is of type ‘signed char *’ # 407 | extern size_t strlen (const char *__s) # | ~~~~~~~~~~~~^~~ # 497| command_t * cmd) # 498| { # 499|-> signed char *eob = args + strlen(args); # 500| # 501| /* fill in the command_t structure with values we already know */ Error: COMPILER_WARNING (CWE-681): dotconf-1.3-build/dotconf-1.3/src/dotconf.c:512:40: warning[-Wpointer-sign]: pointer targets in passing argument 1 of ‘strdup’ differ in signedness # 512 | cmd->data.str = strdup(args); # | ^~~~ # | | # | signed char * /usr/include/string.h:187:34: note: expected ‘const char *’ but argument is of type ‘signed char *’ # 187 | extern char *strdup (const char *__s) # | ~~~~~~~~~~~~^~~ # 510| /* if it is an ARG_RAW type, save some time and call the # 511| callback now */ # 512|-> cmd->data.str = strdup(args); # 513| } else if (option->type == ARG_STR) { # 514| signed char *cp = args; Error: COMPILER_WARNING (CWE-681): dotconf-1.3-build/dotconf-1.3/src/dotconf.c:519:36: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘strncmp’ differ in signedness # 519 | if (!strncmp("<<", cp, 2)) { # | ^~ # | | # | signed char * /usr/include/string.h:159:51: note: expected ‘const char *’ but argument is of type ‘signed char *’ # 159 | extern int strncmp (const char *__s1, const char *__s2, size_t __n) # | ~~~~~~~~~~~~^~~~ # 517| skip_whitespace(&cp, eob - cp, 0); # 518| # 519|-> if (!strncmp("<<", cp, 2)) { # 520| cmd->data.str = # 521| dotconf_get_here_document(configfile, cp + 2); Error: COMPILER_WARNING (CWE-681): dotconf-1.3-build/dotconf-1.3/src/dotconf.c:521:70: warning[-Wpointer-sign]: pointer targets in passing argument 2 of ‘dotconf_get_here_document’ differ in signedness # 521 | dotconf_get_here_document(configfile, cp + 2); # | ~~~^~~ # | | # | signed char * dotconf-1.3-build/dotconf-1.3/src/dotconf.c:317:72: note: expected ‘const char *’ but argument is of type ‘signed char *’ # 317 | char *dotconf_get_here_document(configfile_t * configfile, const char *delimit) # | ~~~~~~~~~~~~^~~~~~~ # 519| if (!strncmp("<<", cp, 2)) { # 520| cmd->data.str = # 521|-> dotconf_get_here_document(configfile, cp + 2); # 522| cmd->arg_count = 1; # 523| } Error: COMPILER_WARNING (CWE-681): dotconf-1.3-build/dotconf-1.3/src/dotconf.c:542:67: warning[-Wpointer-sign]: pointer targets in passing argument 1 of ‘strdup’ differ in signedness # 542 | cmd->data.list[cmd->arg_count++] = strdup(args); # | ^~~~ # | | # | signed char * /usr/include/string.h:187:34: note: expected ‘const char *’ but argument is of type ‘signed char *’ # 187 | extern char *strdup (const char *__s) # | ~~~~~~~~~~~~^~~ # 540| if (cmd->arg_count && cmd->data.list[cmd->arg_count - 1] # 541| && *args) # 542|-> cmd->data.list[cmd->arg_count++] = strdup(args); # 543| # 544| /* has an option entry been found before or do we have to use a fallback? */ Error: COMPILER_WARNING (CWE-681): dotconf-1.3-build/dotconf-1.3/src/dotconf.c: scope_hint: In function ‘dotconf_handle_command’ dotconf-1.3-build/dotconf-1.3/src/dotconf.c:642:13: warning[-Wpointer-sign]: pointer targets in assignment from ‘char *’ to ‘signed char *’ differ in signedness # 642 | cp1 = buffer; # | ^ # 640| context_error = 0; # 641| # 642|-> cp1 = buffer; # 643| eob = cp1 + strlen(cp1); # 644| Error: COMPILER_WARNING (CWE-681): dotconf-1.3-build/dotconf-1.3/src/dotconf.c:643:28: warning[-Wpointer-sign]: pointer targets in passing argument 1 of ‘strlen’ differ in signedness # 643 | eob = cp1 + strlen(cp1); # | ^~~ # | | # | signed char * /usr/include/string.h:407:35: note: expected ‘const char *’ but argument is of type ‘signed char *’ # 407 | extern size_t strlen (const char *__s) # | ~~~~~~~~~~~~^~~ # 641| # 642| cp1 = buffer; # 643|-> eob = cp1 + strlen(cp1); # 644| # 645| skip_whitespace(&cp1, eob - cp1, 0); Error: COMPILER_WARNING (CWE-681): dotconf-1.3-build/dotconf-1.3/src/dotconf.c:656:13: warning[-Wpointer-sign]: pointer targets in assignment from ‘char *’ to ‘signed char *’ differ in signedness # 656 | cp2 = name; # | ^ # 654| # 655| /* get first token: read the name of a possible option */ # 656|-> cp2 = name; # 657| copy_word(&cp2, &cp1, MIN(eob - cp1, CFG_MAX_OPTION), 0); # 658| Error: GCC_ANALYZER_WARNING (CWE-688): dotconf-1.3-build/dotconf-1.3/src/dotconf.c: scope_hint: In function ‘dotconf_find_wild_card’ dotconf-1.3-build/dotconf-1.3/src/dotconf.c:927:19: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘filename’ where non-null expected dotconf-1.3-build/dotconf-1.3/src/dotconf.h:45:44: note: in definition of macro ‘DOTCONF_CB’ <built-in>: note: argument 1 of ‘__builtin_strlen’ must be non-null # 925| int found_path = 0; # 926| # 927|-> int len = strlen(filename); # 928| # 929| if (wildcard != NULL && len > 0 && path != NULL && pre != NULL Error: CLANG_WARNING: dotconf-1.3-build/dotconf-1.3/src/dotconf.c:964:43: warning[unix.Malloc]: Use of memory allocated with size zero # 962| (tmp_count - (found_path ? 0 : 1)))); # 963| (*pre)[(prefix_len - # 964|-> (tmp_count - (found_path ? 0 : 1)))] = # 965| '\0'; # 966| Error: CPPCHECK_WARNING (CWE-457): dotconf-1.3-build/dotconf-1.3/src/dotconf.c:1135: error[legacyUninitvar]: Uninitialized variable: already_matched # 1133| new_pre, ext); # 1134| # 1135|-> if (strcmp(new_path, already_matched) == # 1136| 0) { # 1137| continue; /* Already searched this expression */ Error: CLANG_WARNING: dotconf-1.3-build/dotconf-1.3/src/dotconf.c:1378:6: warning[unix.Malloc]: Potential leak of memory pointed to by 'wc_path' # 1376| # 1377| if (access(new_path, R_OK)) { # 1378|-> dotconf_warning(cmd->configfile, # 1379| DCLOG_WARNING, # 1380| ERR_INCLUDE_ERROR, Error: CLANG_WARNING: dotconf-1.3-build/dotconf-1.3/src/dotconf.c:1378:6: warning[unix.Malloc]: Potential leak of memory pointed to by 'wc_pre' # 1376| # 1377| if (access(new_path, R_OK)) { # 1378|-> dotconf_warning(cmd->configfile, # 1379| DCLOG_WARNING, # 1380| ERR_INCLUDE_ERROR, Error: COMPILER_WARNING (CWE-252): dotconf-1.3-build/dotconf-1.3/src/dotconf.c: scope_hint: In function ‘get_cwd’ dotconf-1.3-build/dotconf-1.3/src/dotconf.c:1422:9: warning[-Wunused-result]: ignoring return value of ‘getcwd’ declared with attribute ‘warn_unused_result’ # 1422 | getcwd(buf, CFG_MAX_FILENAME); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 1420| if (buf == NULL) # 1421| return NULL; # 1422|-> getcwd(buf, CFG_MAX_FILENAME); # 1423| return buf; # 1424| } Error: CLANG_WARNING: dotconf-1.3-build/dotconf-1.3/src/dotconf.c:1508:6: warning[unix.Malloc]: Potential leak of memory pointed to by 'path' # 1506| } # 1507| # 1508|-> if (access(filename, R_OK)) { # 1509| dotconf_warning(cmd->configfile, DCLOG_WARNING, # 1510| ERR_INCLUDE_ERROR, Error: CLANG_WARNING: dotconf-1.3-build/dotconf-1.3/src/dotconf.c:1508:6: warning[unix.Malloc]: Potential leak of memory pointed to by 'pre' # 1506| } # 1507| # 1508|-> if (access(filename, R_OK)) { # 1509| dotconf_warning(cmd->configfile, DCLOG_WARNING, # 1510| ERR_INCLUDE_ERROR,