Task #858 - findutils-4.9.0-8.fc40/scan-results.err
back to task #858download
Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/exec.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/find/fstype.c: scope_hint: In function 'file_system_type_uncached' findutils-4.9.0-build/findutils-4.9.0/find/fstype.c:270:22: warning[-Wanalyzer-malloc-leak]: leak of 'type' findutils-4.9.0-build/findutils-4.9.0/gl/lib/gettext.h:26: included_from: Included from here. findutils-4.9.0-build/findutils-4.9.0/lib/system.h:25: included_from: Included from here. findutils-4.9.0-build/findutils-4.9.0/find/fstype.c:59: included_from: Included from here. findutils-4.9.0-build/findutils-4.9.0/find/fstype.c:270:33: note: in expansion of macro '_' # 268| *fstype_known = (type != NULL); # 269| # 270|-> return type ? type : xstrdup (_("unknown")); # 271| } # 272| Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/ftsfind.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): findutils-4.9.0-build/findutils-4.9.0/find/ftsfind.c: scope_hint: In function 'process_all_startpoints' findutils-4.9.0-build/findutils-4.9.0/find/ftsfind.c:624:22: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(options.files0_from, "r")' findutils-4.9.0-build/findutils-4.9.0/find/ftsfind.c:33: included_from: Included from here. findutils-4.9.0-build/findutils-4.9.0/find/ftsfind.c:49: included_from: Included from here. findutils-4.9.0-build/findutils-4.9.0/find/ftsfind.c:635:24: note: in expansion of macro 'SAME_INODE' findutils-4.9.0-build/findutils-4.9.0/find/ftsfind.c:635:24: note: in expansion of macro 'SAME_INODE' # 622| const int fd = fileno (stream); # 623| assert (fd >= 0); # 624|-> if (options.ok_prompt_stdin) # 625| { # 626| /* Check if the given file is associated to the same stream as Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/find/ftsfind.c:624:22: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(options.files0_from, "r")' findutils-4.9.0-build/findutils-4.9.0/find/ftsfind.c:635:24: note: in expansion of macro 'SAME_INODE' findutils-4.9.0-build/findutils-4.9.0/find/ftsfind.c:635:24: note: in expansion of macro 'SAME_INODE' # 622| const int fd = fileno (stream); # 623| assert (fd >= 0); # 624|-> if (options.ok_prompt_stdin) # 625| { # 626| /* Check if the given file is associated to the same stream as Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/ftsfind.c:731:37: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull' # 729| argv_iter_free (ai); # 730| # 731|-> if (ok && options.files0_from && (ferror (stream) || fclose (stream) != 0)) # 732| die (EXIT_FAILURE, 0, _("error reading %s"), files0_filename_quoted); # 733| Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/parser.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/parser.c:1144:13: warning[deadcode.DeadStores]: Value stored to 'saved_argc' during its initialization is never read # 1142| { # 1143| const char *groupname; # 1144|-> const int saved_argc = *arg_ptr; # 1145| # 1146| if (collect_arg (argv, arg_ptr, &groupname)) Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/find/parser.c: scope_hint: In function 'parse_perm' findutils-4.9.0-build/findutils-4.9.0/find/parser.c:1879:20: warning[-Wanalyzer-malloc-leak]: leak of 'mode_compile(*<unknown> + (sizetype)mode_start)' findutils-4.9.0-build/findutils-4.9.0/find/parser.c: scope_hint: In function 'parse_perm' # 1877| and it would be confusing if 'find' continued to support it. */ # 1878| if (NULL == change # 1879|-> || (perm_expr[0] == '+' && '0' <= perm_expr[1] && perm_expr[1] < '8')) # 1880| die (EXIT_FAILURE, 0, _("invalid mode %s"), # 1881| quotearg_n_style (0, options.err_quoting_style, perm_expr)); Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/find/parser.c: scope_hint: In function 'parse_printf' findutils-4.9.0-build/findutils-4.9.0/find/parser.c:1968:1: warning[-Wanalyzer-malloc-leak]: leak of 'fmt.quote_opts' findutils-4.9.0-build/findutils-4.9.0/find/parser.c: scope_hint: In function 'parse_printf' findutils-4.9.0-build/findutils-4.9.0/find/parser.c: scope_hint: In function 'parse_printf' findutils-4.9.0-build/findutils-4.9.0/find/parser.c: scope_hint: In function 'parse_printf' # 1966| } # 1967| return false; # 1968|-> } # 1969| # 1970| static bool Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/find/parser.c: scope_hint: In function 'parse_fprintf' findutils-4.9.0-build/findutils-4.9.0/find/parser.c:1991:1: warning[-Wanalyzer-malloc-leak]: leak of 'fmt.quote_opts' findutils-4.9.0-build/findutils-4.9.0/find/parser.c: scope_hint: In function 'parse_fprintf' findutils-4.9.0-build/findutils-4.9.0/find/parser.c: scope_hint: In function 'parse_fprintf' # 1989| *arg_ptr = saved_argc; /* don't consume the invalid argument. */ # 1990| return false; # 1991|-> } # 1992| # 1993| static bool Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/parser.c:2204:3: warning[deadcode.DeadStores]: Value stored to 'fd' is never read # 2202| * the file. # 2203| */ # 2204|-> fd = -3; /* -3 means uninitialized */ # 2205| openflags = O_RDONLY; # 2206| Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/parser.c:2537:3: warning[deadcode.DeadStores]: Value stored to 'has_features' is never read # 2535| #if defined HAVE_STRUCT_DIRENT_D_TYPE # 2536| printf ("D_TYPE "); # 2537|-> has_features = true; # 2538| #endif # 2539| #if defined O_NOFOLLOW Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/parser.c:2542:3: warning[deadcode.DeadStores]: Value stored to 'has_features' is never read # 2540| printf ("O_NOFOLLOW(%s) ", # 2541| (options.open_nofollow_available ? "enabled" : "disabled")); # 2542|-> has_features = true; # 2543| #endif # 2544| #if defined LEAF_OPTIMISATION Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/parser.c:2546:3: warning[deadcode.DeadStores]: Value stored to 'has_features' is never read # 2544| #if defined LEAF_OPTIMISATION # 2545| printf ("LEAF_OPTIMISATION "); # 2546|-> has_features = true; # 2547| #endif # 2548| if (0 < is_selinux_enabled ()) Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/parser.c:2551:7: warning[deadcode.DeadStores]: Value stored to 'has_features' is never read # 2549| { # 2550| printf ("SELINUX "); # 2551|-> has_features = true; # 2552| } # 2553| Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/parser.c:2558:7: warning[deadcode.DeadStores]: Value stored to 'has_features' is never read # 2556| { # 2557| printf ("FTS("); # 2558|-> has_features = true; # 2559| # 2560| if (flags & FTS_CWDFD) Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/parser.c:2764:2: warning[deadcode.DeadStores]: Value stored to 'type_cell' is never read # 2762| rate = 1.0e-5f; # 2763| #else # 2764|-> type_cell = 0; # 2765| die (EXIT_FAILURE, 0, # 2766| _("%s %c is not supported because Solaris doors " Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/parser.c:2772:2: warning[deadcode.DeadStores]: Value stored to 'type_cell' is never read # 2770| break; # 2771| default: /* None of the above ... nuke 'em. */ # 2772|-> type_cell = 0; # 2773| die (EXIT_FAILURE, 0, # 2774| _("Unknown argument to %s: %c"), pred_string, (*typeletter)); Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/pred.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/print.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/print.c:622:3: warning[deadcode.DeadStores]: Value stored to 'charsprinted' is never read # 620| verify (sizeof (buf) >= LONGEST_HUMAN_READABLE); # 621| # 622|-> charsprinted = 0; # 623| need_ns_suffix = 0; # 624| Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/print.c:623:3: warning[deadcode.DeadStores]: Value stored to 'need_ns_suffix' is never read # 621| # 622| charsprinted = 0; # 623|-> need_ns_suffix = 0; # 624| # 625| /* Format the main part of the time. */ Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/sharefile.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/sharefile.c:191:5: warning[unix.Malloc]: Potential leak of memory pointed to by 'new_entry' # 189| if (hash_insert (p->table, new_entry)) # 190| { # 191|-> return new_entry->fp; # 192| } # 193| else /* failed to insert in hashtable. */ Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/tree.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-457): findutils-4.9.0-build/findutils-4.9.0/find/tree.c:1095: warning[uninitvar]: Uninitialized variable: &key.cost # 1093| } # 1094| key.fn = p->pred_func; # 1095|-> entry = bsearch (&key, costlookup, # 1096| sizeof(costlookup)/sizeof(costlookup[0]), # 1097| sizeof(costlookup[0]), Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/find/tree.c:1182:36: warning[core.NullDereference]: Access to field 'est_success_rate' results in a dereference of a null pointer (loaded from field 'pred_right') # 1180| assert (pred_is (p, pred_negate)); # 1181| assert (NULL == p->pred_left); # 1182|-> p->est_success_rate = (1.0 - p->pred_right->est_success_rate); # 1183| return p->est_success_rate; # 1184| Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/argmatch.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/c-strcasestr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/canonicalize.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING (CWE-457): findutils-4.9.0-build/findutils-4.9.0/gl/lib/canonicalize.c:401:33: warning[-Wmaybe-uninitialized]: 'end_idx' may be used uninitialized # 401 | end = extra_buf + end_idx; # | ~~~~~~~~~~^~~~~~~~~ findutils-4.9.0-build/findutils-4.9.0/gl/lib/canonicalize.c: scope_hint: In function 'canonicalize_filename_mode' findutils-4.9.0-build/findutils-4.9.0/gl/lib/canonicalize.c:388:21: note: 'end_idx' was declared here # 388 | idx_t end_idx IF_LINT (= 0); # | ^~~~~~~ # 399| } # 400| if (end_in_extra_buffer) # 401|-> end = extra_buf + end_idx; # 402| # 403| /* Careful here, end may be a pointer into extra_buf... */ Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/canonicalize.c:405:15: warning[deadcode.DeadStores]: Value stored to 'name' is never read # 403| /* Careful here, end may be a pointer into extra_buf... */ # 404| memmove (&extra_buf[n], end, len + 1); # 405|-> name = end = memcpy (extra_buf, buf, n); # 406| end_in_extra_buffer = true; # 407| Error: COMPILER_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/canonicalize.c: scope_hint: In function 'canonicalize_filename_mode' findutils-4.9.0-build/findutils-4.9.0/gl/lib/canonicalize.c:484:5: warning[-Wcpp]: #warning "GCC might issue a bogus -Wreturn-local-addr warning here." # 484 | #warning "GCC might issue a bogus -Wreturn-local-addr warning here." # | ^~~~~~~ # 482| { # 483| #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR # 484|-> #warning "GCC might issue a bogus -Wreturn-local-addr warning here." # 485| #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>." # 486| #endif Error: COMPILER_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/canonicalize.c:485:5: warning[-Wcpp]: #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>." # 485 | #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>." # | ^~~~~~~ # 483| #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR # 484| #warning "GCC might issue a bogus -Wreturn-local-addr warning here." # 485|-> #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>." # 486| #endif # 487| struct scratch_buffer rname_buffer; Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/careadlinkat.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: COMPILER_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/careadlinkat.c: scope_hint: In function 'careadlinkat' findutils-4.9.0-build/findutils-4.9.0/gl/lib/careadlinkat.c:178:5: warning[-Wcpp]: #warning "GCC might issue a bogus -Wreturn-local-addr warning here." # 178 | #warning "GCC might issue a bogus -Wreturn-local-addr warning here." # | ^~~~~~~ # 176| shrinking realloc. */ # 177| #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR # 178|-> #warning "GCC might issue a bogus -Wreturn-local-addr warning here." # 179| #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>." # 180| #endif Error: COMPILER_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/careadlinkat.c:179:5: warning[-Wcpp]: #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>." # 179 | #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>." # | ^~~~~~~ # 177| #ifdef GCC_BOGUS_WRETURN_LOCAL_ADDR # 178| #warning "GCC might issue a bogus -Wreturn-local-addr warning here." # 179|-> #warning "See <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93644>." # 180| #endif # 181| char stack_buf[STACK_BUF_SIZE]; Error: COMPILER_WARNING (CWE-562): findutils-4.9.0-build/findutils-4.9.0/gl/lib/careadlinkat.c:182:10: warning[-Wreturn-local-addr]: function may return address of local variable # 182 | return readlink_stk (fd, filename, buffer, buffer_size, alloc, # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 183 | preadlinkat, stack_buf); # | ~~~~~~~~~~~~~~~~~~~~~~~ findutils-4.9.0-build/findutils-4.9.0/gl/lib/careadlinkat.c:181:8: note: declared here # 181 | char stack_buf[STACK_BUF_SIZE]; # | ^~~~~~~~~ # 180| #endif # 181| char stack_buf[STACK_BUF_SIZE]; # 182|-> return readlink_stk (fd, filename, buffer, buffer_size, alloc, # 183| preadlinkat, stack_buf); # 184| } Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/file-set.c: scope_hint: In function 'record_file' findutils-4.9.0-build/findutils-4.9.0/gl/lib/file-set.c:43:8: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(24)' # 41| { # 42| struct F_triple *ent_from_table = hash_insert (ht, ent); # 43|-> if (ent_from_table == NULL) # 44| { # 45| /* Insertion failed due to lack of memory. */ Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/file-set.c:49:8: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(24)' # 47| } # 48| # 49|-> if (ent_from_table != ent) # 50| { # 51| /* There was already a matching entry in the table, so ENT was Error: GCC_ANALYZER_WARNING (CWE-775): findutils-4.9.0-build/findutils-4.9.0/gl/lib/fopen-safer.c: scope_hint: In function 'fopen_safer' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fopen-safer.c:47:21: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(file, mode)' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fopen-safer.c:24: included_from: Included from here. # 45| int e = errno; # 46| fclose (fp); # 47|-> errno = e; # 48| return NULL; # 49| } Error: GCC_ANALYZER_WARNING (CWE-775): findutils-4.9.0-build/findutils-4.9.0/gl/lib/fopen-safer.c:51:14: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(file, mode)' findutils-4.9.0-build/findutils-4.9.0/gl/lib/stdio-safer.h:20: included_from: Included from here. findutils-4.9.0-build/findutils-4.9.0/gl/lib/fopen-safer.c:22: included_from: Included from here. # 49| } # 50| # 51|-> if (fclose (fp) != 0 # 52| || ! (fp = fdopen (f, mode))) # 53| { Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:223: included_from: Included from here. findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts-cycle.c: scope_hint: In function 'enter_dir' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts-cycle.c:94:10: warning[-Wanalyzer-malloc-leak]: leak of 'ad' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:1247:22: note: in expansion of macro 'ISSET' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:1309:34: note: in expansion of macro 'fts_opendir' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:1330:17: note: in expansion of macro 'LEAVE_DIR' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:1330:17: note: in expansion of macro 'LEAVE_DIR' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:1330:17: note: in expansion of macro 'LEAVE_DIR' # 92| ad_from_table = hash_insert (fts->fts_cycle.ht, ad); # 93| # 94|-> if (ad_from_table != ad) # 95| { # 96| free (ad); Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c: scope_hint: In function 'filesystem_type' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:711:12: warning[-Wanalyzer-malloc-leak]: leak of 't2' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:715:8: note: in expansion of macro 'ISSET' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:745:13: note: in expansion of macro 'fts_assert' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:745:13: note: in expansion of macro 'fts_assert' # 709| if (ISSET(FTS_NOLEAF)) # 710| /* leaf optimization explicitly disabled by the FTS_NOLEAF flag */ # 711|-> return 0; # 712| # 713| /* If we're not in CWDFD mode, don't bother with this optimization, Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c: scope_hint: In function 'fts_build' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:1309:16: warning[-Wanalyzer-malloc-leak]: leak of '**sp.fts_cur.fts_dirp' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:1247:22: note: in expansion of macro 'ISSET' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:1309:34: note: in expansion of macro 'fts_opendir' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:1309:34: note: in expansion of macro 'fts_opendir' # 1307| /* Open the directory for reading. If this fails, we're done. # 1308| If being called from fts_read, set the fts_info field. */ # 1309|-> if ((cur->fts_dirp = fts_opendir(cur->fts_accpath, &dir_fd)) == NULL) # 1310| { # 1311| if (type == BREAD) Error: GCC_ANALYZER_WARNING (CWE-688): findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:1501:25: warning[-Wanalyzer-null-argument]: use of NULL 'cp' where non-null expected findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:64: included_from: Included from here. findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:1428:17: note: in expansion of macro '__set_errno' findutils-4.9.0-build/findutils-4.9.0/gl/lib/fts.c:1440:22: note: in expansion of macro 'ISSET' <built-in>: note: argument 1 of '__builtin_memmove' must be non-null # 1499| if (ISSET(FTS_NOCHDIR)) { # 1500| p->fts_accpath = p->fts_path; # 1501|-> memmove(cp, p->fts_name, p->fts_namelen + 1); # 1502| } else # 1503| p->fts_accpath = p->fts_name; Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/hash.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/human.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/human.c:175:15: warning[deadcode.DeadStores]: Value stored to 'grouping' during its initialization is never read # 173| char const *decimal_point = "."; # 174| size_t decimal_pointlen = 1; # 175|-> char const *grouping = ""; # 176| char const *thousands_sep = ""; # 177| struct lconv const *l = localeconv (); Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/ialloc.h:51:37: warning[-Wanalyzer-malloc-leak]: leak of 'ximalloc(s + 1)' findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c: scope_hint: In function 'ximalloc' findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c: scope_hint: In function 'ximalloc' # 49| imalloc (idx_t s) # 50| { # 51|-> return s <= SIZE_MAX ? malloc (s) : _gl_alloc_nomem (); # 52| } # 53| Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/ialloc.h:51:37: warning[-Wanalyzer-malloc-leak]: leak of 'ximalloc(s)' findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c: scope_hint: In function 'ximalloc' findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c: scope_hint: In function 'ximalloc' # 49| imalloc (idx_t s) # 50| { # 51|-> return s <= SIZE_MAX ? malloc (s) : _gl_alloc_nomem (); # 52| } # 53| Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/ialloc.h:81:10: warning[-Wanalyzer-malloc-leak]: leak of 'xicalloc(s, 1)' findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c: scope_hint: In function 'xicalloc' findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c: scope_hint: In function 'xicalloc' # 79| s = 0; # 80| } # 81|-> return calloc (n, s); # 82| } # 83| Error: CPPCHECK_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/malloc/scratch_buffer_dupfree.c:38: error[memleak]: Memory leak: copy # 36| { # 37| void *copy = realloc (data, size); # 38|-> return copy != NULL ? copy : data; # 39| } # 40| } Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/mbscasestr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/mbsstr.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/mktime.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING (CWE-562): findutils-4.9.0-build/findutils-4.9.0/gl/lib/mktime.c:261: error[returnDanglingLifetime]: Returning pointer to local variable 'x' that will be invalid when returning. # 259| { # 260| __time64_t x = t; # 261|-> return convert (&x, tm); # 262| } # 263| Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/nstrftime.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/parse-datetime.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/printf-parse.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/quotearg.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-688): findutils-4.9.0-build/findutils-4.9.0/gl/lib/savedir.c: scope_hint: In function 'streamsavedir' findutils-4.9.0-build/findutils-4.9.0/gl/lib/savedir.c:137:15: warning[-Wanalyzer-null-argument]: use of NULL 'name_space' where non-null expected <built-in>: note: argument 1 of '__builtin_memcpy' must be non-null # 135| entry_size - (allocated - used), # 136| IDX_MAX - 1, sizeof *name_space); # 137|-> memcpy (name_space + used, entry, entry_size); # 138| } # 139| used += entry_size; Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/strerror_r.c:165:7: warning[deadcode.DeadStores]: Value stored to 'ret' is never read # 163| # 164| { # 165|-> ret = 0; # 166| # 167| # if HAVE___XPG_STRERROR_R Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/time_rz.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/time_rz.c: scope_hint: In function 'set_tz' findutils-4.9.0-build/findutils-4.9.0/gl/lib/time_rz.c:68:47: warning[-Wanalyzer-malloc-leak]: leak of 'tzalloc(getenv("TZ"))' findutils-4.9.0-build/findutils-4.9.0/gl/lib/time_rz.c:27: included_from: Included from here. findutils-4.9.0-build/findutils-4.9.0/gl/lib/time_rz.c:29: included_from: Included from here. # 66| tzalloc (char const *name) # 67| { # 68|-> size_t name_size = name ? strlen (name) + 1 : 0; # 69| size_t abbr_size = name_size < ABBR_SIZE_MIN ? ABBR_SIZE_MIN : name_size + 1; # 70| timezone_t tz = malloc (FLEXSIZEOF (struct tm_zone, abbrs, abbr_size)); Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/time_rz.c:69:64: warning[-Wanalyzer-malloc-leak]: leak of 'tzalloc(getenv("TZ"))' # 67| { # 68| size_t name_size = name ? strlen (name) + 1 : 0; # 69|-> size_t abbr_size = name_size < ABBR_SIZE_MIN ? ABBR_SIZE_MIN : name_size + 1; # 70| timezone_t tz = malloc (FLEXSIZEOF (struct tm_zone, abbrs, abbr_size)); # 71| if (tz) Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/time_rz.c: scope_hint: In function 'mktime_z' findutils-4.9.0-build/findutils-4.9.0/gl/lib/time_rz.c:211:11: warning[-Wanalyzer-malloc-leak]: leak of 'set_tz(tz)' # 209| char *env_tz = getenv_TZ (); # 210| if (env_tz # 211|-> ? tz->tz_is_set && strcmp (tz->abbrs, env_tz) == 0 # 212| : !tz->tz_is_set) # 213| return local_tz; Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/time_rz.c:212:12: warning[-Wanalyzer-malloc-leak]: leak of 'set_tz(tz)' # 210| if (env_tz # 211| ? tz->tz_is_set && strcmp (tz->abbrs, env_tz) == 0 # 212|-> : !tz->tz_is_set) # 213| return local_tz; # 214| else Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/time_rz.c:223:11: warning[unix.Malloc]: Potential leak of memory pointed to by 'old_tz' # 221| int saved_errno = errno; # 222| tzfree (old_tz); # 223|-> errno = saved_errno; # 224| return NULL; # 225| } Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/time_rz.c:277:37: warning[unix.Malloc]: Potential leak of memory pointed to by 'old_tz' # 275| { # 276| bool abbr_saved = localtime_r (t, tm) && save_abbr (tz, tm); # 277|-> if (revert_tz (old_tz) && abbr_saved) # 278| return tm; # 279| } Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/time_rz.c:309:37: warning[unix.Malloc]: Potential leak of memory pointed to by 'old_tz' # 307| ok = ok && save_abbr (tz, &tm_1); # 308| #endif # 309|-> if (revert_tz (old_tz) && ok) # 310| { # 311| *tm = tm_1; Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/vasnprintf.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c: scope_hint: In function 'xmalloc' findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c:44:10: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(n)' findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c:22: included_from: Included from here. findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c:56:10: note: in expansion of macro 'XNMALLOC' findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c:56:10: note: in expansion of macro 'XNMALLOC' findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c: scope_hint: In function 'xmalloc' # 42| xmalloc (size_t s) # 43| { # 44|-> return nonnull (malloc (s)); # 45| } # 46| Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c:44:10: warning[-Wanalyzer-malloc-leak]: leak of 'xmalloc(s)' findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c: scope_hint: In function 'xmalloc' # 42| xmalloc (size_t s) # 43| { # 44|-> return nonnull (malloc (s)); # 45| } # 46| Error: CPPCHECK_WARNING (CWE-758): findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c:254: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour # 252| #endif # 253| idx_t adjusted_nbytes # 254|-> = (INT_MULTIPLY_WRAPV (n, s, &nbytes) # 255| ? MIN (IDX_MAX, SIZE_MAX) # 256| : nbytes < DEFAULT_MXFAST ? DEFAULT_MXFAST : 0); Error: CPPCHECK_WARNING (CWE-758): findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c:268: error[shiftTooManyBitsSigned]: Shifting signed 64-bit value by 63 bits is undefined behaviour # 266| && (INT_ADD_WRAPV (n0, n_incr_min, &n) # 267| || (0 <= n_max && n_max < n) # 268|-> || INT_MULTIPLY_WRAPV (n, s, &nbytes))) # 269| xalloc_die (); # 270| pa = xrealloc (pa, nbytes); Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c: scope_hint: In function 'xcalloc' findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c:297:10: warning[-Wanalyzer-malloc-leak]: leak of 'xcalloc(s, 1)' findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c: scope_hint: In function 'xcalloc' # 295| xcalloc (size_t n, size_t s) # 296| { # 297|-> return nonnull (calloc (n, s)); # 298| } # 299| Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c: scope_hint: In function 'xmemdup' findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c:313:10: warning[-Wanalyzer-malloc-leak]: leak of 'xmemdup(string, strlen(string) + 1)' findutils-4.9.0-build/findutils-4.9.0/gl/lib/xmalloc.c: scope_hint: In function 'xmemdup' # 311| xmemdup (void const *p, size_t s) # 312| { # 313|-> return memcpy (xmalloc (s), p, s); # 314| } # 315| Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/xstrtol.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/xstrtoul.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gl/lib/xstrtoumax.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gnulib-tests/localename.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-401): findutils-4.9.0-build/findutils-4.9.0/gnulib-tests/localename.c: scope_hint: In function 'struniq' findutils-4.9.0-build/findutils-4.9.0/gnulib-tests/localename.c:2708:10: warning[-Wanalyzer-malloc-leak]: leak of 'new_node' # 2706| if (mt) gl_lock_unlock (struniq_lock); # 2707| } # 2708|-> return new_node->contents; # 2709| } # 2710| Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gnulib-tests/tempname.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/gnulib-tests/tmpdir.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/lib/buildcmd.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/lib/fdleak.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/lib/listfile.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: CLANG_WARNING: findutils-4.9.0-build/findutils-4.9.0/lib/listfile.c:204:11: warning[deadcode.DeadStores]: Value stored to 'output_good' is never read # 202| if (EOF == putc(' ', stream)) # 203| { # 204|-> output_good = false; # 205| failed_at = 250; # 206| } Error: CPPCHECK_WARNING: findutils-4.9.0-build/findutils-4.9.0/xargs/xargs.c: information[normalCheckLevelMaxBranches]: Limiting analysis of branches. Use --check-level=exhaustive to analyze all branches. Error: GCC_ANALYZER_WARNING (CWE-775): findutils-4.9.0-build/findutils-4.9.0/xargs/xargs.c: scope_hint: In function 'prep_child_for_exec' findutils-4.9.0-build/findutils-4.9.0/xargs/xargs.c:1257:14: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'dup2(open_safer(<unknown>, 0), 0)' findutils-4.9.0-build/findutils-4.9.0/xargs/xargs.c:37: included_from: Included from here. # 1255| if (STDIN_FILENO < fd) # 1256| { # 1257|-> if (dup2(fd, STDIN_FILENO) != 0) # 1258| die (EXIT_FAILURE, errno, # 1259| _("failed to redirect standard input of the child process"));