Error: SHELLCHECK_WARNING (CWE-480): [#def1] /usr/bin/bashbug-64:57:9: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ). # 55| VERSTR="GNU bashbug, version ${RELEASE}.${PATCHLEVEL}-${RELSTATUS}" # 56| # 57|-> do_help= do_version= # 58| # 59| while [ $# -gt 0 ]; do Error: SHELLCHECK_WARNING (CWE-480): [#def2] /usr/bin/bashbug-64:99:6: warning[SC1007]: Remove space after = if trying to assign a value (for empty string, use var='' ... ). # 97| case "$N" in # 98| *c) n=-n c= ;; # 99|-> *) n= c='\c' ;; # 100| esac # 101| Error: SHELLCHECK_WARNING (CWE-456): [#def3] /usr/bin/bashbug-64:146:3: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string). # 144| DEFEDITOR=jove # 145| elif [ -x /usr/bin/vi ]; then # 146|-> DEFEDITOR=vi # 147| else # 148| echo "$0: No default editor found: attempting to use vi" >&2 Error: SHELLCHECK_WARNING (CWE-456): [#def4] /usr/bin/bashbug-64:149:3: warning[SC2209]: Use var=$(command) to assign output (or quote to assign string). # 147| else # 148| echo "$0: No default editor found: attempting to use vi" >&2 # 149|-> DEFEDITOR=vi # 150| fi # 151| fi Error: SHELLCHECK_WARNING (CWE-398): [#def5] /usr/bin/bashbug-64:158:40: warning[SC2172]: Trapping signals by number is not well defined. Prefer signal names. # 156| : ${USER=${LOGNAME-`whoami`}} # 157| # 158|-> trap 'rm -rf "$TEMPDIR"; exit 1' 1 2 3 13 15 # 159| trap 'rm -rf "$TEMPDIR"' 0 # 160| Error: SHELLCHECK_WARNING (CWE-252): [#def6] /usr/bin/cd:2:1: warning[SC2164]: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. # 1| #!/usr/bin/sh # 2|-> builtin cd "$@" Error: COMPILER_WARNING (CWE-563): [#def7] bash-5.3/array.c:66:14: warning[-Wunused-variable]: ‘spacesep’ defined but not used # 66 | static char *spacesep = " "; # | ^~~~~~~~ # 64| static char *array_to_string_internal (ARRAY_ELEMENT *, ARRAY_ELEMENT *, char *, int); # 65| # 66|-> static char *spacesep = " "; # 67| # 68| #define IS_LASTREF(a) (a->lastref) Error: COMPILER_WARNING (CWE-563): [#def8] bash-5.3/arrayfunc.c: scope_hint: In function ‘assign_array_element_internal’ bash-5.3/arrayfunc.c:388:9: warning[-Wunused-variable]: unused variable ‘newval’ # 388 | char *newval; # | ^~~~~~ # 386| char *akey, *nkey; # 387| arrayind_t ind; # 388|-> char *newval; # 389| # 390| /* rely on the caller to initialize estatep */ Error: GCC_ANALYZER_WARNING (CWE-688): [#def9] bash-5.3/arrayfunc.c:652:41: warning[-Wanalyzer-null-argument]: use of NULL ‘v’ where non-null expected bash-5.3/arrayfunc.c:636:24: branch_true: following ‘true’ branch (when ‘list’ is non-NULL)... bash-5.3/arrayfunc.c:638:11: branch_true: ...to here bash-5.3/arrayfunc.c:652:14: branch_true: following ‘true’ branch... bash-5.3/arrayfunc.c:652:41: branch_true: ...to here bash-5.3/arrayfunc.c:652:41: danger: argument 1 (‘v’) NULL where non-null expected # 650| } # 651| # 652|-> aval = split_kvpair_assignments ? savestring (v) : expand_assignment_string_to_string (v, 0); # 653| if (aval == 0) # 654| { Error: COMPILER_WARNING: [#def10] bash-5.3/arrayfunc.c: scope_hint: In function ‘array_value_internal’ bash-5.3/arrayfunc.c:1485:21: warning[-Wunused-but-set-variable=]: variable ‘subtype’ set but not used # 1485 | int len, isassoc, subtype; # | ^~~~~~~ # 1483| array_value_internal (const char *s, int quoted, int flags, array_eltstate_t *estatep) # 1484| { # 1485|-> int len, isassoc, subtype; # 1486| arrayind_t ind; # 1487| char *akey; Error: COMPILER_WARNING (CWE-457): [#def11] bash-5.3/arrayfunc.c: scope_hint: In function ‘array_value_internal’ bash-5.3/arrayfunc.c:1635:18: warning[-Wmaybe-uninitialized]: ‘ind’ may be used uninitialized # 1635 | retval = array_reference (array_cell (var), ind); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bash-5.3/arrayfunc.c:1486:14: note: ‘ind’ was declared here # 1486 | arrayind_t ind; # | ^~~ # 1633| } # 1634| else # 1635|-> retval = array_reference (array_cell (var), ind); # 1636| # 1637| if (estatep) Error: COMPILER_WARNING (CWE-563): [#def12] bash-5.3/arrayfunc.c: scope_hint: In function ‘array_keys’ bash-5.3/arrayfunc.c:1672:22: warning[-Wunused-variable]: unused variable ‘temp’ # 1672 | char *retval, *t, *temp; # | ^~~~ # 1670| { # 1671| int len; # 1672|-> char *retval, *t, *temp; # 1673| WORD_LIST *l; # 1674| SHELL_VAR *var; Error: COMPILER_WARNING (CWE-457): [#def13] bash-5.3/assoc.h:31:37: warning[-Wmaybe-uninitialized]: ‘h’ may be used uninitialized # 31 | #define assoc_num_elements(h) ((h)->nentries) # | ~~~~^~~~~~~~~~~ bash-5.3/subst.c: scope_hint: In function ‘parameter_brace_substring’ bash-5.3/subst.c:8403:14: note: ‘h’ was declared here # 8403 | HASH_TABLE *h; # | ^ # 29| # 30| #define assoc_empty(h) ((h)->nentries == 0) # 31|-> #define assoc_num_elements(h) ((h)->nentries) # 32| # 33| #define assoc_create(n) (hash_create((n))) Error: COMPILER_WARNING (CWE-569): [#def14] bash-5.3/bashhist.c: scope_hint: In function ‘hc_erasedups’ bash-5.3/bashhist.c:732:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 732 | while (temp = previous_history ()) # | ^~~~ # 730| # 731| using_history (); # 732|-> while (temp = previous_history ()) # 733| { # 734| if (STREQ (temp->line, line)) Error: COMPILER_WARNING (CWE-704): [#def15] bash-5.3/bashhist.c: scope_hint: In function ‘bash_syslog_history’ bash-5.3/bashhist.c:848:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 848 | for (msg = line, i = 0; i < chunks; i++) # | ^ # 846| { # 847| chunks = ((msglen + hdrlen) / SYSLOG_MAXLEN) + 1; # 848|-> for (msg = line, i = 0; i < chunks; i++) # 849| { # 850| seqnum = inttostr (i + 1, seqbuf, sizeof (seqbuf)); Error: COMPILER_WARNING (CWE-704): [#def16] bash-5.3/bashhist.c:848:16: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 846| { # 847| chunks = ((msglen + hdrlen) / SYSLOG_MAXLEN) + 1; # 848|-> for (msg = line, i = 0; i < chunks; i++) # 849| { # 850| seqnum = inttostr (i + 1, seqbuf, sizeof (seqbuf)); Error: COMPILER_WARNING (CWE-1164): [#def17] bash-5.3/bashline.c: scope_hint: At top level bash-5.3/bashline.c:215:12: warning[-Wunused-function]: ‘set_saved_history’ declared ‘static’ but never defined # 215 | static int set_saved_history (void); # | ^~~~~~~~~~~~~~~~~ # 213| static int isolate_sequence (char *, int, int, int *); # 214| # 215|-> static int set_saved_history (void); # 216| # 217| #if defined (ALIAS) Error: COMPILER_WARNING (CWE-569): [#def18] bash-5.3/bashline.c: scope_hint: In function ‘snarf_hosts_from_file’ bash-5.3/bashline.c:809:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 809 | while (temp = fgets (buffer, 255, file)) # | ^~~~ # 807| return; # 808| # 809|-> while (temp = fgets (buffer, 255, file)) # 810| { # 811| /* Skip to first character. */ Error: GCC_ANALYZER_WARNING (CWE-674): [#def19] bash-5.3/bashline.c:1238:12: warning[-Wanalyzer-infinite-recursion]: infinite recursion bash-5.3/bashline.c:1233:1: enter_function: entry to ‘bash_kill_shellword’ bash-5.3/bashline.c:1238:12: call_function: calling ‘bash_backward_kill_shellword’ from ‘bash_kill_shellword’ # 1236| # 1237| if (count < 0) # 1238|-> return (bash_backward_kill_shellword (-count, key)); # 1239| # 1240| p = rl_point; Error: GCC_ANALYZER_WARNING (CWE-674): [#def20] bash-5.3/bashline.c:1259:12: warning[-Wanalyzer-infinite-recursion]: infinite recursion bash-5.3/bashline.c:1254:1: enter_function: entry to ‘bash_backward_kill_shellword’ bash-5.3/bashline.c:1259:12: call_function: calling ‘bash_kill_shellword’ from ‘bash_backward_kill_shellword’ # 1257| # 1258| if (count < 0) # 1259|-> return (bash_kill_shellword (-count, key)); # 1260| # 1261| p = rl_point; Error: CPPCHECK_WARNING (CWE-457): [#def21] bash-5.3/bashline.c:1705: error[uninitvar]: Uninitialized variable: e1 # 1703| if (s > rl_end) # 1704| { # 1705|-> s1 = s = e1; # 1706| break; # 1707| } Error: GCC_ANALYZER_WARNING (CWE-457): [#def22] bash-5.3/bashline.c:1705:20: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘e1’ bash-5.3/bashline.c:1683:6: branch_true: following ‘true’ branch (when ‘matches’ is NULL)... bash-5.3/bashline.c:1683:7: branch_true: ...to here bash-5.3/bashline.c:1683:7: branch_true: following ‘true’ branch... bash-5.3/bashline.c:1691:11: branch_true: ...to here bash-5.3/bashline.c:1703:14: branch_true: following ‘true’ branch... bash-5.3/bashline.c:1705:20: branch_true: ...to here bash-5.3/bashline.c:1705:20: danger: use of uninitialized value ‘e1’ here # 1703| if (s > rl_end) # 1704| { # 1705|-> s1 = s = e1; # 1706| break; # 1707| } Error: COMPILER_WARNING (CWE-569): [#def23] bash-5.3/bashline.c: scope_hint: In function ‘attempt_shell_completion’ bash-5.3/bashline.c:1726:14: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 1726 | while (was_assignment = assignment (n, 0)); # | ^~~~~~~~~~~~~~ # 1724| s = e1 + 1; # 1725| } # 1726|-> while (was_assignment = assignment (n, 0)); # 1727| s = s1; /* reset to index where name begins */ # 1728| Error: COMPILER_WARNING (CWE-457): [#def24] bash-5.3/bashline.c: scope_hint: In function ‘attempt_shell_completion’ bash-5.3/bashline.c:1743:28: warning[-Wmaybe-uninitialized]: ‘e1’ may be used uninitialized # 1743 | else if (e == 0 && e == s && text[0] == '\0' && have_progcomps) /* beginning of empty line */ # | ~~^~~~ bash-5.3/bashline.c:1687:21: note: ‘e1’ was declared here # 1687 | int s, e, s1, e1, os, foundcs; # | ^~ # 1741| else if (start == 0 && start == end && start < s1 && e != 0 && e1 > end && text[0] == '\0' && have_progcomps) /* no command name, leading whitespace only */ # 1742| prog_complete_matches = programmable_completions (EMPTYCMD, text, s, e, &foundcs); # 1743|-> else if (e == 0 && e == s && text[0] == '\0' && have_progcomps) /* beginning of empty line */ # 1744| prog_complete_matches = programmable_completions (EMPTYCMD, text, s, e, &foundcs); # 1745| else if (start == end && text[0] == '\0' && s1 > start && whitespace (rl_line_buffer[start])) Error: COMPILER_WARNING (CWE-569): [#def25] bash-5.3/bashline.c: scope_hint: In function ‘command_word_completion_function’ bash-5.3/bashline.c:2262:14: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 2262 | while (val = glob_matches[local_index++]) # | ^~~ # 2260| } # 2261| # 2262|-> while (val = glob_matches[local_index++]) # 2263| { # 2264| if (executable_or_directory (val)) Error: COMPILER_WARNING (CWE-569): [#def26] bash-5.3/bashline.c: scope_hint: In function ‘bash_servicename_completion_function’ bash-5.3/bashline.c:2688:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 2688 | while (srvent = getservent ()) # | ^~~~~~ # 2686| } # 2687| # 2688|-> while (srvent = getservent ()) # 2689| { # 2690| afound = 0; Error: COMPILER_WARNING (CWE-569): [#def27] bash-5.3/bashline.c: scope_hint: In function ‘bash_groupname_completion_function’ bash-5.3/bashline.c:2742:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 2742 | while (grent = getgrent ()) # | ^~~~~ # 2740| } # 2741| # 2742|-> while (grent = getgrent ()) # 2743| { # 2744| if (gnamelen == 0 || (STREQN (gname, grent->gr_name, gnamelen))) Error: COMPILER_WARNING (CWE-563): [#def28] bash-5.3/bashline.c:2830:9: warning[-Wunused-variable]: unused variable ‘s’ # 2830 | char *s, *t; # | ^ # 2828| # 2829| int old_point, old_end, dist, nb; # 2830|-> char *s, *t; # 2831| # 2832| /* If we didn't expand anything, don't change anything. */ Error: COMPILER_WARNING (CWE-563): [#def29] bash-5.3/bashline.c: scope_hint: In function ‘set_up_new_line’ bash-5.3/bashline.c:2830:13: warning[-Wunused-variable]: unused variable ‘t’ # 2830 | char *s, *t; # | ^ # 2828| # 2829| int old_point, old_end, dist, nb; # 2830|-> char *s, *t; # 2831| # 2832| /* If we didn't expand anything, don't change anything. */ Error: COMPILER_WARNING (CWE-457): [#def30] bash-5.3/bashline.c: scope_hint: In function ‘_ignore_completion_names’ bash-5.3/bashline.c:3127:17: warning[-Wmaybe-uninitialized]: ‘oldnames’ may be used uninitialized # 3127 | oldnames[oidx++] = names[idx]; # | ^ bash-5.3/bashline.c:3087:10: note: ‘oldnames’ was declared here # 3087 | char **oldnames; # | ^~~~~~~~ # 3125| newnames[nidx++] = names[idx]; # 3126| else if (allow_empty == 0) # 3127|-> oldnames[oidx++] = names[idx]; # 3128| else # 3129| free (names[idx]); Error: GCC_ANALYZER_WARNING (CWE-457): [#def31] bash-5.3/bashline.c:3143:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘oldnames’ bash-5.3/bashline.c:3198:1: enter_function: entry to ‘filename_completion_ignore’ bash-5.3/bashline.c:3207:6: branch_false: following ‘false’ branch... bash-5.3/bashline.c:3210:3: branch_false: ...to here bash-5.3/bashline.c:3210:3: call_function: calling ‘_ignore_completion_names’ from ‘filename_completion_ignore’ # 3141| } # 3142| else # 3143|-> free (oldnames); # 3144| # 3145| free (newnames); Error: GCC_ANALYZER_WARNING (CWE-688): [#def32] bash-5.3/bashline.c:3364:7: warning[-Wanalyzer-null-argument]: use of NULL ‘dh2’ where non-null expected bash-5.3/bashline.c:3288:1: enter_function: entry to ‘restore_tilde’ bash-5.3/bashline.c:3297:9: branch_false: following ‘false’ branch (when ‘directory_part’ is NULL)... bash-5.3/bashline.c:3297:3: branch_false: ...to here bash-5.3/bashline.c:3298:3: call_function: calling ‘bash_directory_expansion’ from ‘restore_tilde’ # 3362| char *d, *nd; # 3363| # 3364|-> d = savestring (*dirname); # 3365| # 3366| if ((rl_directory_rewrite_hook) && (*rl_directory_rewrite_hook) (&d)) Error: COMPILER_WARNING (CWE-569): [#def33] bash-5.3/bashline.c: scope_hint: In function ‘bash_filename_stat_hook’ bash-5.3/bashline.c:3525:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 3525 | if (t = mbschr (local_dirname, '$')) # | ^ # 3523| local_dirname = *dirname; # 3524| should_expand_dirname = return_value = 0; # 3525|-> if (t = mbschr (local_dirname, '$')) # 3526| should_expand_dirname = '$'; # 3527| else if (t = mbschr (local_dirname, '`')) /* XXX */ Error: COMPILER_WARNING (CWE-569): [#def34] bash-5.3/bashline.c:3527:12: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 3527 | else if (t = mbschr (local_dirname, '`')) /* XXX */ # | ^ # 3525| if (t = mbschr (local_dirname, '$')) # 3526| should_expand_dirname = '$'; # 3527|-> else if (t = mbschr (local_dirname, '`')) /* XXX */ # 3528| should_expand_dirname = '`'; # 3529| Error: COMPILER_WARNING (CWE-563): [#def35] bash-5.3/bashline.c: scope_hint: In function ‘bash_directory_completion_hook’ bash-5.3/bashline.c:3679:18: warning[-Wunused-variable]: unused variable ‘l1’ # 3679 | size_t l1, l2; # | ^~ # 3677| if (temp2 == 0 && dircomplete_spelling && dircomplete_expand) # 3678| { # 3679|-> size_t l1, l2; # 3680| # 3681| temp2 = dirspell (temp1); Error: COMPILER_WARNING (CWE-569): [#def36] bash-5.3/bashline.c: scope_hint: In function ‘bash_check_expchar’ bash-5.3/bashline.c:4303:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 4303 | if (t = mbschr (dirname, '$')) # | ^ # 4301| # 4302| ret = n = c = 0; # 4303|-> if (t = mbschr (dirname, '$')) # 4304| { # 4305| ret = '$'; Error: COMPILER_WARNING (CWE-569): [#def37] bash-5.3/bashline.c: scope_hint: In function ‘set_filename_quote_chars’ bash-5.3/bashline.c:4362:23: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 4362 | for (i = j = 0; c = default_filename_quote_characters[i]; i++) # | ^ # 4360| i = strlen (default_filename_quote_characters); # 4361| custom_filename_quote_characters = xrealloc (custom_filename_quote_characters, i+1); # 4362|-> for (i = j = 0; c = default_filename_quote_characters[i]; i++) # 4363| { # 4364| if (c == expchar || c == nextch || c == closer) Error: COMPILER_WARNING (CWE-1164): [#def38] bash-5.3/bashline.c:4532:1: warning[-Wunused-function]: ‘putx’ defined but not used # 4532 | putx(int c) # | ^~~~ # 4530| static int # 4531| #endif # 4532|-> putx(int c) # 4533| { # 4534| int x; Error: COMPILER_WARNING (CWE-1164): [#def39] bash-5.3/bashline.c:4762:1: warning[-Wunused-function]: ‘get_cmd_xmap_from_edit_mode’ defined but not used # 4762 | get_cmd_xmap_from_edit_mode (void) # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ # 4760| # 4761| static Keymap # 4762|-> get_cmd_xmap_from_edit_mode (void) # 4763| { # 4764| if (emacs_std_cmd_xmap == 0) Error: COMPILER_WARNING (CWE-569): [#def40] bash-5.3/bashline.c: scope_hint: In function ‘isolate_sequence’ bash-5.3/bashline.c:4824:19: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 4824 | for (passc = 0; c = string[i]; i++) # | ^ # 4822| *startp = delim ? ++i : i; # 4823| # 4824|-> for (passc = 0; c = string[i]; i++) # 4825| { # 4826| if (passc) Error: COMPILER_WARNING (CWE-457): [#def41] bash-5.3/braces.c:388:6: warning[-Wmaybe-uninitialized]: ‘tr’ may be used uninitialized # 388 | if ((start < end) == (incr < 0) && ckd_sub (&incr, 0, incr)) # | ^ bash-5.3/braces.c: scope_hint: In function ‘brace_expand’ bash-5.3/braces.c:523:16: note: ‘tr’ was declared here # 523 | intmax_t tl, tr; # | ^~ # 386| # 387| /* Make sure incr agrees with start and end */ # 388|-> if ((start < end) == (incr < 0) && ckd_sub (&incr, 0, incr)) # 389| return ((char **)NULL); # 390| Error: COMPILER_WARNING (CWE-569): [#def42] bash-5.3/braces.c: scope_hint: In function ‘mkseq’ bash-5.3/braces.c:445:15: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 445 | if (t = (char *)malloc (2)) # | ^ # 443| else # 444| { # 445|-> if (t = (char *)malloc (2)) # 446| { # 447| t[0] = n; Error: GCC_ANALYZER_WARNING (CWE-476): [#def43] bash-5.3/braces.c:452:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘result’ bash-5.3/braces.c:392:6: branch_false: following ‘false’ branch... bash-5.3/braces.c:397:7: branch_false: ...to here bash-5.3/braces.c:397:6: branch_false: following ‘false’ branch... bash-5.3/braces.c:400:12: branch_false: ...to here bash-5.3/braces.c:401:6: branch_false: following ‘false’ branch... bash-5.3/braces.c:401:6: branch_false: ...to here bash-5.3/braces.c:413:10: branch_true: following ‘true’ branch... bash-5.3/braces.c:415:17: branch_true: ...to here bash-5.3/braces.c:421:10: branch_true: following ‘true’ branch (when ‘type == 1’)... bash-5.3/braces.c:422:13: branch_true: ...to here bash-5.3/braces.c:452:7: danger: dereference of NULL ‘result + i * 8’ # 450| } # 451| # 452|-> result[i++] = t; # 453| # 454| /* We failed to allocate memory for this number, so we bail. */ Error: COMPILER_WARNING: [#def44] bash-5.3/braces.c:643:9: warning[-Wunused-but-set-variable=]: variable ‘t’ set but not used # 643 | char *t; # | ^ # 641| #if defined (SHELL) # 642| size_t si; # 643|-> char *t; # 644| #endif # 645| DECLARE_MBSTATE; Error: COMPILER_WARNING (CWE-569): [#def45] bash-5.3/braces.c: scope_hint: In function ‘brace_gobbler’ bash-5.3/braces.c:656:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 656 | while (c = text[i]) # | ^ # 654| # 655| i = *indx; # 656|-> while (c = text[i]) # 657| { # 658| if (pass_next) Error: COMPILER_WARNING (CWE-1164): [#def46] bash-5.3/braces.c:687:1: warning[-Wunused-label]: label ‘funsub’ defined but not used # 687 | funsub: # | ^~~~~~ # 685| { # 686| int o, f; # 687|-> funsub: # 688| o = no_longjmp_on_fatal_error; # 689| no_longjmp_on_fatal_error = 1; Error: GCC_ANALYZER_WARNING (CWE-401): [#def47] bash-5.3/braces.c:855:15: warning[-Wanalyzer-malloc-leak]: leak of ‘result’ bash-5.3/braces.c:840:21: acquire_memory: allocated here bash-5.3/braces.c:841:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/braces.c:841:6: branch_false: ...to here bash-5.3/braces.c:845:15: branch_true: following ‘true’ branch... bash-5.3/braces.c:847:34: branch_true: ...to here bash-5.3/braces.c:849:19: branch_true: following ‘true’ branch... bash-5.3/braces.c:852:15: branch_true: ...to here bash-5.3/braces.c:852:14: branch_true: following ‘true’ branch... bash-5.3/braces.c:854:21: branch_true: ...to here bash-5.3/braces.c:855:15: throw: if ‘strvec_dispose’ throws an exception... bash-5.3/braces.c:855:15: danger: ‘result’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) # 853| { # 854| result[len] = (char *)NULL; # 855|-> strvec_dispose (result); # 856| result = (char **)NULL; # 857| strvec_dispose (arr1); /* caller expects us to free arr1 */ Error: GCC_ANALYZER_WARNING (CWE-401): [#def48] bash-5.3/braces.c:859:11: warning[-Wanalyzer-malloc-leak]: leak of ‘result’ bash-5.3/braces.c:840:21: acquire_memory: allocated here bash-5.3/braces.c:841:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/braces.c:841:6: branch_false: ...to here bash-5.3/braces.c:845:15: branch_true: following ‘true’ branch... bash-5.3/braces.c:847:34: branch_true: ...to here bash-5.3/braces.c:849:19: branch_true: following ‘true’ branch... bash-5.3/braces.c:852:15: branch_true: ...to here bash-5.3/braces.c:852:14: branch_false: following ‘false’ branch... bash-5.3/braces.c:859:11: branch_false: ...to here bash-5.3/braces.c:859:11: branch_true: following ‘true’ branch... bash-5.3/braces.c:859:11: branch_true: ...to here bash-5.3/braces.c:859:11: throw: if ‘termsig_handler’ throws an exception... bash-5.3/braces.c:859:11: danger: ‘result’ leaks here; was allocated at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0) # 857| strvec_dispose (arr1); /* caller expects us to free arr1 */ # 858| } # 859|-> QUIT; # 860| #endif # 861| Error: GCC_ANALYZER_WARNING (CWE-476): [#def49] bash-5.3/braces.c:862:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘result’ bash-5.3/braces.c:841:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/braces.c:841:6: branch_false: ...to here bash-5.3/braces.c:845:15: branch_true: following ‘true’ branch... bash-5.3/braces.c:847:34: branch_true: ...to here bash-5.3/braces.c:849:19: branch_true: following ‘true’ branch... bash-5.3/braces.c:852:15: branch_true: ...to here bash-5.3/braces.c:852:14: branch_true: following ‘true’ branch... bash-5.3/braces.c:854:21: branch_true: ...to here bash-5.3/braces.c:862:11: danger: dereference of NULL ‘result + (long unsigned int)len * 8’ # 860| #endif # 861| # 862|-> result[len] = (char *)xmalloc (1 + strlen_1 + strlen (arr2[j])); # 863| strcpy (result[len], arr1[i]); # 864| strcpy (result[len] + strlen_1, arr2[j]); Error: GCC_ANALYZER_WARNING (CWE-401): [#def50] bash-5.3/braces.c:862:33: warning[-Wanalyzer-malloc-leak]: leak of ‘result’ bash-5.3/braces.c:840:21: acquire_memory: allocated here bash-5.3/braces.c:841:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/braces.c:841:6: branch_false: ...to here bash-5.3/braces.c:845:15: branch_true: following ‘true’ branch... bash-5.3/braces.c:847:34: branch_true: ...to here bash-5.3/braces.c:849:19: branch_true: following ‘true’ branch... bash-5.3/braces.c:852:15: branch_true: ...to here bash-5.3/braces.c:852:14: branch_false: following ‘false’ branch... bash-5.3/braces.c:859:11: branch_false: ...to here bash-5.3/braces.c:862:33: throw: if ‘xmalloc’ throws an exception... bash-5.3/braces.c:862:33: danger: ‘result’ leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0) # 860| #endif # 861| # 862|-> result[len] = (char *)xmalloc (1 + strlen_1 + strlen (arr2[j])); # 863| strcpy (result[len], arr1[i]); # 864| strcpy (result[len] + strlen_1, arr2[j]); Error: COMPILER_WARNING (CWE-569): [#def51] bash-5.3/builtins/alias.def: scope_hint: In function ‘alias_builtin’ bash-5.3/builtins/alias.def:108:13: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 108 | if (any_failed = print_alias (alias_list[offset], dflags) != EXECUTION_SUCCESS) # | ^~~~~~~~~~ # 106| any_failed = EXECUTION_SUCCESS; # 107| for (offset = 0; alias_list[offset]; offset++) # 108|-> if (any_failed = print_alias (alias_list[offset], dflags) != EXECUTION_SUCCESS) # 109| break; # 110| Error: COMPILER_WARNING (CWE-563): [#def52] bash-5.3/builtins/alias.def: scope_hint: In function ‘unalias_builtin’ bash-5.3/builtins/alias.def:175:12: warning[-Wunused-variable]: unused variable ‘alias’ # 175 | alias_t *alias; # | ^~~~~ # 173| unalias_builtin (WORD_LIST *list) # 174| { # 175|-> alias_t *alias; # 176| int opt, aflag; # 177| Error: GCC_ANALYZER_WARNING (CWE-476): [#def53] bash-5.3/builtins/break.def:80:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘list’ bash-5.3/builtins/break.def:69:6: branch_false: following ‘false’ branch... bash-5.3/builtins/break.def:73:50: branch_false: ...to here bash-5.3/builtins/break.def:75:6: branch_true: following ‘true’ branch... bash-5.3/builtins/break.def:78:10: branch_true: ...to here bash-5.3/builtins/break.def:78:10: branch_false: following ‘false’ branch (when ‘list’ is NULL)... bash-5.3/builtins/break.def:80:36: branch_false: ...to here bash-5.3/builtins/break.def:80:18: danger: dereference of NULL ‘list’ # 78| if (list && list->word && ISOPTION (list->word->word, '-')) # 79| list = list->next; # 80|-> sh_erange (list->word->word, _("loop count")); # 81| breaking = loop_level; # 82| return (EXECUTION_FAILURE); Error: GCC_ANALYZER_WARNING (CWE-476): [#def54] bash-5.3/builtins/break.def:125:18: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘list’ bash-5.3/builtins/break.def:114:6: branch_false: following ‘false’ branch... bash-5.3/builtins/break.def:118:50: branch_false: ...to here bash-5.3/builtins/break.def:120:6: branch_true: following ‘true’ branch... bash-5.3/builtins/break.def:123:10: branch_true: ...to here bash-5.3/builtins/break.def:123:10: branch_false: following ‘false’ branch (when ‘list’ is NULL)... bash-5.3/builtins/break.def:125:36: branch_false: ...to here bash-5.3/builtins/break.def:125:18: danger: dereference of NULL ‘list’ # 123| if (list && list->word && ISOPTION (list->word->word, '-')) # 124| list = list->next; # 125|-> sh_erange (list->word->word, _("loop count")); # 126| breaking = loop_level; # 127| return (EXECUTION_FAILURE); Error: COMPILER_WARNING (CWE-1164): [#def55] bash-5.3/builtins/cd.def: scope_hint: At top level bash-5.3/builtins/cd.def:195:1: warning[-Wunused-function]: ‘cdxattr’ defined but not used # 195 | cdxattr (char *dir, char **ndirp) # | ^~~~~~~ # 193| /* return new constructed directory name in *NDIRP */ # 194| static int # 195|-> cdxattr (char *dir, char **ndirp) # 196| { # 197| #if defined (O_XATTR) Error: COMPILER_WARNING (CWE-569): [#def56] bash-5.3/builtins/cd.def: scope_hint: In function ‘cd_builtin’ bash-5.3/builtins/cd.def:357:14: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 357 | while (path = extract_colon_unit (cdpath, &path_index)) # | ^~~~ # 355| /* Find directory in $CDPATH, POSIX cd step 5. */ # 356| path_index = 0; # 357|-> while (path = extract_colon_unit (cdpath, &path_index)) # 358| { # 359| /* OPT is 1 if the path element is non-empty */ Error: COMPILER_WARNING (CWE-563): [#def57] bash-5.3/builtins/cd.def: scope_hint: In function ‘change_to_directory’ bash-5.3/builtins/cd.def:524:20: warning[-Wunused-variable]: unused variable ‘ndir’ # 524 | char *t, *tdir, *ndir; # | ^~~~ # 522| change_to_directory (char *newdir, int nolinks, int xattr) # 523| { # 524|-> char *t, *tdir, *ndir; # 525| int err, canon_failed, r, ndlen; # 526| Error: COMPILER_WARNING (CWE-563): [#def58] bash-5.3/builtins/declare.def: scope_hint: In function ‘declare_find_variable’ bash-5.3/builtins/declare.def:153:14: warning[-Wunused-variable]: unused variable ‘var’ # 153 | SHELL_VAR *var; # | ^~~ # 151| declare_find_variable (const char *name, int mkglobal, int chklocal) # 152| { # 153|-> SHELL_VAR *var; # 154| # 155| if (mkglobal == 0) Error: GCC_ANALYZER_WARNING (CWE-457): [#def59] bash-5.3/builtins/declare.def:237:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘optchar’ bash-5.3/builtins/declare.def:224:6: branch_true: following ‘true’ branch... bash-5.3/builtins/declare.def:228:10: branch_false: following ‘false’ branch... bash-5.3/builtins/declare.def:230:16: branch_false: ...to here bash-5.3/builtins/declare.def:230:15: branch_false: following ‘false’ branch... bash-5.3/builtins/declare.def:232:16: branch_false: ...to here bash-5.3/builtins/declare.def:232:15: branch_false: following ‘false’ branch... bash-5.3/builtins/declare.def:234:16: branch_false: ...to here bash-5.3/builtins/declare.def:234:15: branch_false: following ‘false’ branch... bash-5.3/builtins/declare.def:237:7: branch_false: ...to here bash-5.3/builtins/declare.def:237:7: danger: use of uninitialized value ‘optchar’ here # 235| optchar = "-a"; # 236| # 237|-> sh_invalidopt (optchar); # 238| return (EXECUTION_FAILURE); # 239| } Error: COMPILER_WARNING (CWE-457): [#def60] bash-5.3/builtins/declare.def:237:7: warning[-Wmaybe-uninitialized]: ‘optchar’ may be used uninitialized # 237 | sh_invalidopt (optchar); # | ^~~~~~~~~~~~~~~~~~~~~~~ bash-5.3/builtins/declare.def: scope_hint: In function ‘declare_internal’ bash-5.3/builtins/declare.def:226:13: note: ‘optchar’ was declared here # 226 | char *optchar; # | ^~~~~~~ # 235| optchar = "-a"; # 236| # 237|-> sh_invalidopt (optchar); # 238| return (EXECUTION_FAILURE); # 239| } Error: COMPILER_WARNING: [#def61] bash-5.3/builtins/declare.def:423:11: warning[-Wunused-but-set-variable=]: variable ‘var_exists’ set but not used # 423 | int var_exists, array_exists, creating_array, array_subscript_assignment; # | ^~~~~~~~~~ # 421| #if defined (ARRAY_VARS) # 422| int making_array_special, compound_array_assign, simple_array_assign; # 423|-> int var_exists, array_exists, creating_array, array_subscript_assignment; # 424| #endif # 425| Error: COMPILER_WARNING (CWE-569): [#def62] bash-5.3/builtins/declare.def: scope_hint: In function ‘declare_internal’ bash-5.3/builtins/declare.def:467:15: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 467 | if (var = find_function (name)) # | ^~~ # 465| if (offset && (flags_on & att_function)) /* declare -f [-rix] foo=bar */ # 466| { # 467|-> if (var = find_function (name)) # 468| offset = 0; # 469| else Error: COMPILER_WARNING (CWE-569): [#def63] bash-5.3/builtins/declare.def:593:11: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 593 | if (t = strchr (name, '[')) /* ] */ # | ^ # 591| compound_array_assign = simple_array_assign = 0; # 592| array_subscript_assignment = 0; # 593|-> if (t = strchr (name, '[')) /* ] */ # 594| { # 595| /* If offset != 0 we have already validated any array reference Error: COMPILER_WARNING (CWE-569): [#def64] bash-5.3/builtins/echo.def: scope_hint: In function ‘echo_builtin’ bash-5.3/builtins/echo.def:141:14: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 141 | while (i = *temp++) # | ^ # 139| /* All of the options in TEMP are valid options to ECHO. # 140| Handle them. */ # 141|-> while (i = *temp++) # 142| { # 143| switch (i) Error: COMPILER_WARNING (CWE-457): [#def65] bash-5.3/builtins/enable.def: scope_hint: In function ‘enable_builtin’ bash-5.3/builtins/enable.def:120:9: warning[-Wmaybe-uninitialized]: ‘filename’ may be used uninitialized # 120 | char *filename; # | ^~~~~~~~ # 118| WORD_LIST *next; # 119| #if defined (HAVE_DLOPEN) && defined (HAVE_DLSYM) # 120|-> char *filename; # 121| #endif # 122| Error: COMPILER_WARNING (CWE-569): [#def66] bash-5.3/builtins/enable.def: scope_hint: In function ‘dyn_load_builtin’ bash-5.3/builtins/enable.def:363:12: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 363 | else if (loadables_path = path_value ("BASH_LOADABLES_PATH", 1)) # | ^~~~~~~~~~~~~~ # 361| if (absolute_program (filename)) # 362| handle = dlopen (filename, DLFLAGS); # 363|-> else if (loadables_path = path_value ("BASH_LOADABLES_PATH", 1)) # 364| { # 365| /* If we have a loadables path, don't fall back to the current directory. */ Error: COMPILER_WARNING (CWE-569): [#def67] bash-5.3/builtins/evalstring.c: scope_hint: In function ‘parse_and_execute’ bash-5.3/builtins/evalstring.c:461:20: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 461 | else if (command = global_command) # | ^~~~~~~ # 459| global_command = (COMMAND *)NULL; # 460| } # 461|-> else if (command = global_command) # 462| { # 463| struct fd_bitmap *bitmap; Error: COMPILER_WARNING (CWE-1164): [#def68] bash-5.3/builtins/evalstring.c: scope_hint: At top level bash-5.3/builtins/evalstring.c:802:1: warning[-Wunused-function]: ‘cat_file’ defined but not used # 802 | cat_file (REDIRECT *r) # | ^~~~~~~~ # 800| output. */ # 801| static int # 802|-> cat_file (REDIRECT *r) # 803| { # 804| char *fn; Error: COMPILER_WARNING (CWE-704): [#def69] bash-5.3/builtins/getopt.c: scope_hint: In function ‘sh_getopt’ bash-5.3/builtins/getopt.c:168:8: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 168 | temp = strchr (optstring, c); # | ^ # 166| # 167| c = *nextchar++; sh_charindex++; # 168|-> temp = strchr (optstring, c); # 169| # 170| sh_optopt = c; Error: COMPILER_WARNING (CWE-704): [#def70] bash-5.3/builtins/getopt.c:168:8: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 166| # 167| c = *nextchar++; sh_charindex++; # 168|-> temp = strchr (optstring, c); # 169| # 170| sh_optopt = c; Error: COMPILER_WARNING (CWE-569): [#def71] bash-5.3/builtins/getopt.c:179:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 179 | if (sh_badopt = (temp == NULL || c == ':')) # | ^~~~~~~~~ # 177| } # 178| # 179|-> if (sh_badopt = (temp == NULL || c == ':')) # 180| { # 181| if (sh_opterr) Error: COMPILER_WARNING (CWE-569): [#def72] bash-5.3/builtins/help.def: scope_hint: In function ‘help_builtin’ bash-5.3/builtins/help.def:145:23: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 145 | for (i = 0; name = shell_builtins[i].name; i++) # | ^~~~ # 143| for (pass = 1, this_found = 0; pass < 3; pass++) # 144| { # 145|-> for (i = 0; name = shell_builtins[i].name; i++) # 146| { # 147| QUIT; Error: GCC_ANALYZER_WARNING (CWE-775): [#def73] bash-5.3/builtins/help.def:235:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open_helpfile(*doc)’ bash-5.3/builtins/help.def:224:1: enter_function: entry to ‘show_longdoc’ bash-5.3/builtins/help.def:232:6: branch_true: following ‘true’ branch... bash-5.3/builtins/help.def:234:12: call_function: calling ‘open_helpfile’ from ‘show_longdoc’ bash-5.3/builtins/help.def:234:12: return_function: returning to ‘show_longdoc’ from ‘open_helpfile’ bash-5.3/builtins/help.def:235:10: danger: ‘open_helpfile(*doc)’ leaks here; was opened at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5) # 233| { # 234| fd = open_helpfile (doc[0]); # 235|-> if (fd < 0) # 236| return; # 237| zcatfd (fd, 1, doc[0]); Error: GCC_ANALYZER_WARNING (CWE-775): [#def74] bash-5.3/builtins/help.def:237:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open_helpfile(*doc)’ bash-5.3/builtins/help.def:224:1: enter_function: entry to ‘show_longdoc’ bash-5.3/builtins/help.def:232:6: branch_true: following ‘true’ branch... bash-5.3/builtins/help.def:234:12: call_function: calling ‘open_helpfile’ from ‘show_longdoc’ bash-5.3/builtins/help.def:234:12: return_function: returning to ‘show_longdoc’ from ‘open_helpfile’ bash-5.3/builtins/help.def:235:10: branch_false: following ‘false’ branch... bash-5.3/builtins/help.def:237:7: branch_false: ...to here bash-5.3/builtins/help.def:237:7: throw: if ‘zcatfd’ throws an exception... bash-5.3/builtins/help.def:237:7: danger: ‘open_helpfile(*doc)’ leaks here; was opened at [(6)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/5) # 235| if (fd < 0) # 236| return; # 237|-> zcatfd (fd, 1, doc[0]); # 238| close (fd); # 239| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def75] bash-5.3/builtins/help.def:259:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open_helpfile(*doc)’ bash-5.3/builtins/help.def:246:1: enter_function: entry to ‘show_desc’ bash-5.3/builtins/help.def:255:13: branch_true: following ‘true’ branch... bash-5.3/builtins/help.def:258:12: call_function: calling ‘open_helpfile’ from ‘show_desc’ bash-5.3/builtins/help.def:258:12: return_function: returning to ‘show_desc’ from ‘open_helpfile’ bash-5.3/builtins/help.def:259:10: danger: ‘open_helpfile(*doc)’ leaks here; was opened at [(6)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/5) # 257| { # 258| fd = open_helpfile (doc[0]); # 259|-> if (fd < 0) # 260| return; # 261| r = zmapfd (fd, &line, doc[0]); Error: GCC_ANALYZER_WARNING (CWE-775): [#def76] bash-5.3/builtins/help.def:261:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open_helpfile(*doc)’ bash-5.3/builtins/help.def:246:1: enter_function: entry to ‘show_desc’ bash-5.3/builtins/help.def:255:13: branch_true: following ‘true’ branch... bash-5.3/builtins/help.def:258:12: call_function: calling ‘open_helpfile’ from ‘show_desc’ bash-5.3/builtins/help.def:258:12: return_function: returning to ‘show_desc’ from ‘open_helpfile’ bash-5.3/builtins/help.def:259:10: branch_false: following ‘false’ branch... bash-5.3/builtins/help.def:261:11: branch_false: ...to here bash-5.3/builtins/help.def:261:11: throw: if ‘zmapfd’ throws an exception... bash-5.3/builtins/help.def:261:11: danger: ‘open_helpfile(*doc)’ leaks here; was opened at [(6)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/5) # 259| if (fd < 0) # 260| return; # 261|-> r = zmapfd (fd, &line, doc[0]); # 262| if (r < 0) # 263| { Error: GCC_ANALYZER_WARNING (CWE-775): [#def77] bash-5.3/builtins/help.def:301:10: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open_helpfile(*doc)’ bash-5.3/builtins/help.def:287:1: enter_function: entry to ‘show_manpage’ bash-5.3/builtins/help.def:297:13: branch_true: following ‘true’ branch... bash-5.3/builtins/help.def:300:12: call_function: calling ‘open_helpfile’ from ‘show_manpage’ bash-5.3/builtins/help.def:300:12: return_function: returning to ‘show_manpage’ from ‘open_helpfile’ bash-5.3/builtins/help.def:301:10: danger: ‘open_helpfile(*doc)’ leaks here; was opened at [(6)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/5) # 299| { # 300| fd = open_helpfile (doc[0]); # 301|-> if (fd < 0) # 302| return; # 303| r = zmapfd (fd, &line, doc[0]); Error: GCC_ANALYZER_WARNING (CWE-775): [#def78] bash-5.3/builtins/help.def:303:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open_helpfile(*doc)’ bash-5.3/builtins/help.def:287:1: enter_function: entry to ‘show_manpage’ bash-5.3/builtins/help.def:297:13: branch_true: following ‘true’ branch... bash-5.3/builtins/help.def:300:12: call_function: calling ‘open_helpfile’ from ‘show_manpage’ bash-5.3/builtins/help.def:300:12: return_function: returning to ‘show_manpage’ from ‘open_helpfile’ bash-5.3/builtins/help.def:301:10: branch_false: following ‘false’ branch... bash-5.3/builtins/help.def:303:11: branch_false: ...to here bash-5.3/builtins/help.def:303:11: throw: if ‘zmapfd’ throws an exception... bash-5.3/builtins/help.def:303:11: danger: ‘open_helpfile(*doc)’ leaks here; was opened at [(6)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/5) # 301| if (fd < 0) # 302| return; # 303|-> r = zmapfd (fd, &line, doc[0]); # 304| if (r < 0) # 305| { Error: CPPCHECK_WARNING (CWE-476): [#def79] bash-5.3/builtins/help.def:326: warning[nullPointer]: Possible null pointer dereference: line # 324| /* If the line doesn't end with a newline, e.g., if it's a loadable builtin, # 325| add one. */ # 326|-> if (line[j] != '\n') # 327| putchar ('\n'); # 328| printf ("\n"); Error: GCC_ANALYZER_WARNING (CWE-476): [#def80] bash-5.3/builtins/help.def:326:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘line’ bash-5.3/builtins/help.def:313:12: branch_false: following ‘false’ branch (when ‘doc’ is NULL)... bash-5.3/builtins/help.def:313:5: branch_false: ...to here bash-5.3/builtins/help.def:318:15: release_memory: ‘line’ is NULL bash-5.3/builtins/help.def:318:15: branch_false: following ‘false’ branch... bash-5.3/builtins/help.def:326:11: branch_false: ...to here bash-5.3/builtins/help.def:326:11: release_memory: ‘line’ is NULL bash-5.3/builtins/help.def:326:7: danger: dereference of NULL ‘line + (sizetype)j’ # 324| /* If the line doesn't end with a newline, e.g., if it's a loadable builtin, # 325| add one. */ # 326|-> if (line[j] != '\n') # 327| putchar ('\n'); # 328| printf ("\n"); Error: COMPILER_WARNING (CWE-563): [#def81] bash-5.3/builtins/help.def: scope_hint: In function ‘show_builtin_command_help’ bash-5.3/builtins/help.def:514:9: warning[-Wunused-variable]: unused variable ‘t’ # 514 | char *t, blurb[128]; # | ^ # 512| int i; # 513| int height, width; # 514|-> char *t, blurb[128]; # 515| # 516| printf ( Error: COMPILER_WARNING (CWE-457): [#def82] /usr/include/features.h:540: included_from: Included from here. /usr/include/bits/libc-header-start.h:33: included_from: Included from here. /usr/include/wchar.h:27: included_from: Included from here. bash-5.3/config-bot.h:137: included_from: Included from here. bash-5.3/config.h:1384: included_from: Included from here. bash-5.3/builtins/history.def:65: included_from: Included from here. bash-5.3/builtins/history.def:190:59: warning[-Wmaybe-uninitialized]: ‘delete_arg’ may be used uninitialized # 190 | else if ((flags & DFLAG) && (range = strchr ((delete_arg[0] == '-') ? delete_arg + 1 : delete_arg, '-'))) # | ~~~~~~~~~~^~~ bash-5.3/builtins/history.def:117:20: note: ‘delete_arg’ was declared here # 117 | char *filename, *delete_arg, *range; # | ^~~~~~~~~~ # 188| } # 189| #endif # 190|-> else if ((flags & DFLAG) && (range = strchr ((delete_arg[0] == '-') ? delete_arg + 1 : delete_arg, '-'))) # 191| { # 192| intmax_t delete_start, delete_end; Error: COMPILER_WARNING (CWE-691): [#def83] bash-5.3/builtins/history.def: scope_hint: In function ‘history_builtin’ bash-5.3/builtins/history.def:278:10: warning[-Wdangling-else]: suggest explicit braces to avoid ambiguous ‘else’ # 278 | if (interactive_shell == 0 || interactive) # | ^ # 276| if (filename == 0 || *filename == 0) # 277| { # 278|-> if (interactive_shell == 0 || interactive) # 279| if (list && filename == list->word->word) # 280| builtin_error (_("empty filename")); Error: CPPCHECK_WARNING (CWE-457): [#def84] bash-5.3/builtins/let.def:107: warning[uninitvar]: Uninitialized variable: ret # 105| } # 106| # 107|-> return ((ret == 0) ? EXECUTION_FAILURE : EXECUTION_SUCCESS); # 108| } # 109| Error: COMPILER_WARNING (CWE-569): [#def85] bash-5.3/builtins/mkbuiltins.c: scope_hint: In function ‘extract_info’ bash-5.3/builtins/mkbuiltins.c:588:15: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 588 | for (i = 0; line = defs->lines->array[i]; i++) # | ^~~~ # 586| # 587| /* Process each line in the array. */ # 588|-> for (i = 0; line = defs->lines->array[i]; i++) # 589| { # 590| defs->line_number = i; Error: COMPILER_WARNING (CWE-569): [#def86] bash-5.3/builtins/mkbuiltins.c: scope_hint: In function ‘free_defs’ bash-5.3/builtins/mkbuiltins.c:702:19: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 702 | for (i = 0; builtin = (BUILTIN_DESC *)defs->builtins->array[i]; i++) # | ^~~~~~~ # 700| if (defs->builtins) # 701| { # 702|-> for (i = 0; builtin = (BUILTIN_DESC *)defs->builtins->array[i]; i++) # 703| { # 704| free_builtin (builtin); Error: GCC_ANALYZER_WARNING (CWE-688): [#def87] bash-5.3/builtins/mkbuiltins.c:1389:3: warning[-Wanalyzer-null-argument]: use of NULL ‘stream’ where non-null expected bash-5.3/builtins/mkbuiltins.c:1292:1: enter_function: entry to ‘write_longdocs’ bash-5.3/builtins/mkbuiltins.c:1299:15: branch_true: following ‘true’ branch... bash-5.3/builtins/mkbuiltins.c:1301:33: branch_true: ...to here bash-5.3/builtins/mkbuiltins.c:1303:10: branch_true: following ‘true’ branch... bash-5.3/builtins/mkbuiltins.c:1304:9: branch_true: ...to here bash-5.3/builtins/mkbuiltins.c:1304:9: call_function: inlined call to ‘write_ifdefs’ from ‘write_longdocs’ bash-5.3/builtins/mkbuiltins.c:1307:15: branch_true: ...to here bash-5.3/builtins/mkbuiltins.c:1307:15: branch_true: following ‘true’ branch... bash-5.3/builtins/mkbuiltins.c:1308:7: branch_true: ...to here bash-5.3/builtins/mkbuiltins.c:1310:10: branch_true: following ‘true’ branch... bash-5.3/builtins/mkbuiltins.c:1312:19: branch_true: ...to here bash-5.3/builtins/mkbuiltins.c:1313:31: call_function: calling ‘xmalloc’ from ‘write_longdocs’ bash-5.3/builtins/mkbuiltins.c:1313:31: return_function: returning to ‘write_longdocs’ from ‘xmalloc’ bash-5.3/builtins/mkbuiltins.c:1315:11: release_memory: ‘stream’ is NULL bash-5.3/builtins/mkbuiltins.c:1316:11: call_function: calling ‘write_documentation’ from ‘write_longdocs’ bash-5.3/builtins/mkbuiltins.c:1316:11: return_function: returning to ‘write_longdocs’ from ‘write_documentation’ bash-5.3/builtins/mkbuiltins.c:1322:10: branch_true: following ‘true’ branch... bash-5.3/builtins/mkbuiltins.c:1323:9: branch_true: ...to here bash-5.3/builtins/mkbuiltins.c:1323:9: call_function: inlined call to ‘write_endifs’ from ‘write_longdocs’ #argument 4 of ‘__builtin_fwrite’ must be non-null # 1387| return; # 1388| # 1389|-> fprintf (stream, "#endif /* "); # 1390| # 1391| for (i = 0; defines[i]; i++) Error: GCC_ANALYZER_WARNING (CWE-775): [#def88] bash-5.3/builtins/mkbuiltins.c:1566:36: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(xmalloc(strlen(bname) + 11), "w")’ bash-5.3/builtins/mkbuiltins.c:1535:1: enter_function: entry to ‘write_helpfiles’ bash-5.3/builtins/mkbuiltins.c:1550:15: branch_true: following ‘true’ branch... bash-5.3/builtins/mkbuiltins.c:1552:33: branch_true: ...to here bash-5.3/builtins/mkbuiltins.c:1555:26: call_function: calling ‘xmalloc’ from ‘write_helpfiles’ bash-5.3/builtins/mkbuiltins.c:1555:26: return_function: returning to ‘write_helpfiles’ from ‘xmalloc’ bash-5.3/builtins/mkbuiltins.c:1558:16: acquire_resource: opened here bash-5.3/builtins/mkbuiltins.c:1566:7: call_function: calling ‘write_documentation’ from ‘write_helpfiles’ bash-5.3/builtins/mkbuiltins.c:1566:7: return_function: returning to ‘write_helpfiles’ from ‘write_documentation’ bash-5.3/builtins/mkbuiltins.c:1568:7: throw: if ‘fflush’ throws an exception... bash-5.3/builtins/mkbuiltins.c:1566:36: danger: ‘fopen(xmalloc(strlen(bname) + 11), "w")’ leaks here; was opened at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8) # 1564| } # 1565| # 1566|-> write_documentation (helpfp, builtin->longdoc->array, 4, PLAINTEXT); # 1567| # 1568| fflush (helpfp); Error: GCC_ANALYZER_WARNING (CWE-401): [#def89] bash-5.3/builtins/mkbuiltins.c:1566:36: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(xmalloc(strlen(bname) + 11), "w")’ bash-5.3/builtins/mkbuiltins.c:1535:1: enter_function: entry to ‘write_helpfiles’ bash-5.3/builtins/mkbuiltins.c:1550:15: branch_true: following ‘true’ branch... bash-5.3/builtins/mkbuiltins.c:1552:33: branch_true: ...to here bash-5.3/builtins/mkbuiltins.c:1555:26: call_function: calling ‘xmalloc’ from ‘write_helpfiles’ bash-5.3/builtins/mkbuiltins.c:1555:26: return_function: returning to ‘write_helpfiles’ from ‘xmalloc’ bash-5.3/builtins/mkbuiltins.c:1558:16: acquire_memory: allocated here bash-5.3/builtins/mkbuiltins.c:1566:7: call_function: calling ‘write_documentation’ from ‘write_helpfiles’ bash-5.3/builtins/mkbuiltins.c:1566:7: return_function: returning to ‘write_helpfiles’ from ‘write_documentation’ bash-5.3/builtins/mkbuiltins.c:1568:7: throw: if ‘fflush’ throws an exception... bash-5.3/builtins/mkbuiltins.c:1566:36: danger: ‘fopen(xmalloc(strlen(bname) + 11), "w")’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8) # 1564| } # 1565| # 1566|-> write_documentation (helpfp, builtin->longdoc->array, 4, PLAINTEXT); # 1567| # 1568| fflush (helpfp); Error: GCC_ANALYZER_WARNING (CWE-401): [#def90] bash-5.3/builtins/mkbuiltins.c:1566:36: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(strlen(bname) + 11)’ bash-5.3/builtins/mkbuiltins.c:1535:1: enter_function: entry to ‘write_helpfiles’ bash-5.3/builtins/mkbuiltins.c:1550:15: branch_true: following ‘true’ branch... bash-5.3/builtins/mkbuiltins.c:1552:33: branch_true: ...to here bash-5.3/builtins/mkbuiltins.c:1555:26: call_function: calling ‘xmalloc’ from ‘write_helpfiles’ bash-5.3/builtins/mkbuiltins.c:1555:26: return_function: returning to ‘write_helpfiles’ from ‘xmalloc’ bash-5.3/builtins/mkbuiltins.c:1566:7: call_function: calling ‘write_documentation’ from ‘write_helpfiles’ bash-5.3/builtins/mkbuiltins.c:1566:7: return_function: returning to ‘write_helpfiles’ from ‘write_documentation’ bash-5.3/builtins/mkbuiltins.c:1568:7: throw: if ‘fflush’ throws an exception... bash-5.3/builtins/mkbuiltins.c:1566:36: danger: ‘xmalloc(strlen(bname) + 11)’ leaks here; was allocated at [(6)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/5) # 1564| } # 1565| # 1566|-> write_documentation (helpfp, builtin->longdoc->array, 4, PLAINTEXT); # 1567| # 1568| fflush (helpfp); Error: COMPILER_WARNING (CWE-563): [#def91] bash-5.3/builtins/printf.def:246:15: warning[-Wunused-variable]: ‘narg_argv’ defined but not used # 246 | static char **narg_argv; # | ^~~~~~~~~ # 244| # 245| /* printf format numbered argument support */ # 246|-> static char **narg_argv; # 247| static int narg_argc; # 248| static int narg_maxind; Error: COMPILER_WARNING (CWE-563): [#def92] bash-5.3/builtins/printf.def:247:12: warning[-Wunused-variable]: ‘narg_argc’ defined but not used # 247 | static int narg_argc; # | ^~~~~~~~~ # 245| /* printf format numbered argument support */ # 246| static char **narg_argv; # 247|-> static int narg_argc; # 248| static int narg_maxind; # 249| static int narg_curind; Error: COMPILER_WARNING (CWE-563): [#def93] bash-5.3/builtins/printf.def:248:12: warning[-Wunused-variable]: ‘narg_maxind’ defined but not used # 248 | static int narg_maxind; # | ^~~~~~~~~~~ # 246| static char **narg_argv; # 247| static int narg_argc; # 248|-> static int narg_maxind; # 249| static int narg_curind; # 250| Error: COMPILER_WARNING (CWE-563): [#def94] bash-5.3/builtins/printf.def:249:12: warning[-Wunused-variable]: ‘narg_curind’ defined but not used # 249 | static int narg_curind; # | ^~~~~~~~~~~ # 247| static int narg_argc; # 248| static int narg_maxind; # 249|-> static int narg_curind; # 250| # 251| static intmax_t tw; Error: COMPILER_WARNING (CWE-563): [#def95] bash-5.3/builtins/printf.def: scope_hint: In function ‘printwidestr’ bash-5.3/builtins/printf.def:962:9: warning[-Wunused-variable]: unused variable ‘s’ # 962 | char *s; # | ^ # 960| printwidestr (char *fmt, wchar_t *wstring, size_t len, int fieldwidth, int precision) # 961| { # 962|-> char *s; # 963| char *string; # 964| int padlen, nc, ljust, i; Error: COMPILER_WARNING (CWE-563): [#def96] bash-5.3/builtins/printf.def: scope_hint: In function ‘bexpand’ bash-5.3/builtins/printf.def:1178:13: warning[-Wunused-variable]: unused variable ‘c’ # 1178 | int temp, c; # | ^ # 1176| bexpand (char *string, size_t len, int *sawc, size_t *lenp) # 1177| { # 1178|-> int temp, c; # 1179| char *ret, *r, *s, *send; # 1180| #if defined (HANDLE_MULTIBYTE) Error: COMPILER_WARNING (CWE-569): [#def97] bash-5.3/builtins/printf.def: scope_hint: In function ‘getint’ bash-5.3/builtins/printf.def:1417:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 1417 | if (overflow = (errno == ERANGE) || (ret < INT_MIN || ret > INT_MAX)) # | ^~~~~~~~ # 1415| errno = 0; # 1416| ret = strtoimax (arg, &ep, 0); # 1417|-> if (overflow = (errno == ERANGE) || (ret < INT_MIN || ret > INT_MAX)) # 1418| errno = ERANGE; /* force errno */ # 1419| Error: GCC_ANALYZER_WARNING (CWE-476): [#def98] bash-5.3/builtins/printf.def:1539:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ bash-5.3/builtins/printf.def:1520:1: enter_function: entry to ‘asciicode’ bash-5.3/builtins/printf.def:1530:9: call_function: inlined call to ‘getarg’ from ‘asciicode’ bash-5.3/builtins/printf.def:1532:18: branch_false: ...to here bash-5.3/builtins/printf.def:1535:6: branch_false: following ‘false’ branch (when ‘mblength > 18446744073709551613’)... bash-5.3/builtins/printf.def:1539:25: branch_false: ...to here bash-5.3/builtins/printf.def:1539:25: danger: dereference of NULL ‘<unknown>’ # 1537| else # 1538| #endif # 1539|-> ch = (unsigned char)arg[1]; # 1540| # 1541| advancearg (); Error: COMPILER_WARNING (CWE-563): [#def99] bash-5.3/builtins/printf.def: scope_hint: In function ‘getwidechar’ bash-5.3/builtins/printf.def:1588:10: warning[-Wunused-variable]: unused variable ‘slen’ # 1588 | size_t slen, mblength; # | ^~~~ # 1586| { # 1587| wchar_t wc; # 1588|-> size_t slen, mblength; # 1589| char *arg; # 1590| DECLARE_MBSTATE; Error: COMPILER_WARNING (CWE-563): [#def100] bash-5.3/builtins/printf.def: scope_hint: In function ‘convwidestr’ bash-5.3/builtins/printf.def:1613:11: warning[-Wunused-variable]: unused variable ‘wc’ # 1613 | wchar_t wc; # | ^~ # 1611| { # 1612| const wchar_t *ts; # 1613|-> wchar_t wc; # 1614| char *ret; # 1615| size_t rlen, rsize; Error: COMPILER_WARNING (CWE-1164): [#def101] bash-5.3/builtins/printf.def: scope_hint: At top level bash-5.3/builtins/printf.def:1653:1: warning[-Wunused-function]: ‘convwidechar’ defined but not used # 1653 | convwidechar (wint_t wi, int prec) # | ^~~~~~~~~~~~ # 1651| # 1652| static char * # 1653|-> convwidechar (wint_t wi, int prec) # 1654| { # 1655| wchar_t wc; Error: GCC_ANALYZER_WARNING (CWE-479): [#def102] bash-5.3/builtins/psize.c:53:3: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘fprintf’ from within signal handler bash-5.3/builtins/psize.c:58:1: enter_function: entry to ‘main’ bash-5.3/builtins/psize.c:63:15: branch_true: following ‘true’ branch (when ‘i != 128’)... bash-5.3/builtins/psize.c:64:5: branch_true: ...to here bash-5.3/builtins/psize.c:51:1: enter_function: entry to ‘sigpipe’ bash-5.3/builtins/psize.c:53:3: danger: call to ‘fprintf’ from within signal handler # 51| sigpipe (int sig) # 52| { # 53|-> fprintf (stderr, "%d\n", nw); # 54| exit (0); # 55| } Error: GCC_ANALYZER_WARNING (CWE-479): [#def103] bash-5.3/builtins/psize.c:54:3: warning[-Wanalyzer-unsafe-call-within-signal-handler]: call to ‘exit’ from within signal handler bash-5.3/builtins/psize.c:58:1: enter_function: entry to ‘main’ bash-5.3/builtins/psize.c:63:15: branch_true: following ‘true’ branch (when ‘i != 128’)... bash-5.3/builtins/psize.c:64:5: branch_true: ...to here bash-5.3/builtins/psize.c:51:1: enter_function: entry to ‘sigpipe’ bash-5.3/builtins/psize.c:54:3: danger: call to ‘exit’ from within signal handler # 52| { # 53| fprintf (stderr, "%d\n", nw); # 54|-> exit (0); # 55| } # 56| Error: CPPCHECK_WARNING (CWE-476): [#def104] bash-5.3/builtins/read.def:858: error[nullPointer]: Null pointer dereference # 856| { # 857| size_t clen; # 858|-> clen = mbrlen (rlbuf + rlind - 1, mb_cur_max, (mbstate_t *)NULL); # 859| /* We only deal with valid multibyte sequences longer than one # 860| byte. If we get anything else, we leave the one character Error: CPPCHECK_WARNING (CWE-457): [#def105] bash-5.3/builtins/set.def:562: warning[uninitvar]: Uninitialized variable: tflag # 560| for (i = vptr = 0; o_options[i].name; i++) # 561| { # 562|-> if (tflag[i]) # 563| { # 564| strcpy (value + vptr, o_options[i].name); Error: COMPILER_WARNING (CWE-569): [#def106] bash-5.3/builtins/set.def: scope_hint: In function ‘parse_shellopts’ bash-5.3/builtins/set.def:600:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 600 | while (vname = extract_colon_unit (value, &vptr)) # | ^~~~~ # 598| # 599| vptr = 0; # 600|-> while (vname = extract_colon_unit (value, &vptr)) # 601| { # 602| set_minus_o_option (FLAG_ON, vname); Error: COMPILER_WARNING (CWE-569): [#def107] bash-5.3/builtins/set.def: scope_hint: In function ‘set_builtin’ bash-5.3/builtins/set.def:725:18: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 725 | while (flag_name = *++arg) # | ^~~~~~~~~ # 723| if ((on_or_off = *arg) && (on_or_off == '-' || on_or_off == '+')) # 724| { # 725|-> while (flag_name = *++arg) # 726| { # 727| if (flag_name == '?') Error: COMPILER_WARNING (CWE-569): [#def108] bash-5.3/builtins/set.def: scope_hint: In function ‘unset_builtin’ bash-5.3/builtins/set.def:957:15: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 957 | if (var = find_function (name)) # | ^~~ # 955| } # 956| #endif # 957|-> if (var = find_function (name)) # 958| unset_function = 1; # 959| } Error: COMPILER_WARNING (CWE-569): [#def109] bash-5.3/builtins/set.def:1003:23: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 1003 | if (var = array_variable_part (tname, 0, &t, &len)) # | ^~~ # 1001| tname = savestring (nameref_cell (var)); # 1002| tem = 0; # 1003|-> if (var = array_variable_part (tname, 0, &t, &len)) # 1004| { # 1005| /* change to what unbind_array_element now expects */ Error: COMPILER_WARNING (CWE-569): [#def110] bash-5.3/builtins/setattr.def: scope_hint: In function ‘set_or_show_attributes’ bash-5.3/builtins/setattr.def:323:23: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 323 | for (i = 0; var = variable_list[i]; i++) # | ^~~ # 321| if (variable_list) # 322| { # 323|-> for (i = 0; var = variable_list[i]; i++) # 324| { # 325| #if defined (ARRAY_VARS) Error: COMPILER_WARNING (CWE-569): [#def111] bash-5.3/builtins/setattr.def:340:23: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 340 | if (any_failed = sh_chkwrite (any_failed)) # | ^~~~~~~~~~ # 338| { # 339| show_var_attributes (var, READONLY_OR_EXPORT, nodefs); # 340|-> if (any_failed = sh_chkwrite (any_failed)) # 341| break; # 342| } Error: COMPILER_WARNING (CWE-569): [#def112] bash-5.3/builtins/setattr.def: scope_hint: In function ‘show_all_var_attributes’ bash-5.3/builtins/setattr.def:372:28: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 372 | for (i = any_failed = 0; var = variable_list[i]; i++) # | ^~~ # 370| return (EXECUTION_SUCCESS); # 371| # 372|-> for (i = any_failed = 0; var = variable_list[i]; i++) # 373| { # 374| /* There is no equivalent `declare -'. */ Error: COMPILER_WARNING (CWE-569): [#def113] bash-5.3/builtins/setattr.def:379:11: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 379 | if (any_failed = sh_chkwrite (any_failed)) # | ^~~~~~~~~~ # 377| else # 378| show_var_attributes (var, READONLY_OR_EXPORT, nodefs); # 379|-> if (any_failed = sh_chkwrite (any_failed)) # 380| break; # 381| } Error: COMPILER_WARNING (CWE-569): [#def114] bash-5.3/builtins/setattr.def: scope_hint: In function ‘show_local_var_attributes’ bash-5.3/builtins/setattr.def:399:28: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 399 | for (i = any_failed = 0; var = variable_list[i]; i++) # | ^~~ # 397| return (EXECUTION_SUCCESS); # 398| # 399|-> for (i = any_failed = 0; var = variable_list[i]; i++) # 400| { # 401| /* There is no equivalent `declare -'. */ Error: COMPILER_WARNING (CWE-569): [#def115] bash-5.3/builtins/setattr.def:406:11: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 406 | if (any_failed = sh_chkwrite (any_failed)) # | ^~~~~~~~~~ # 404| else # 405| show_var_attributes (var, READONLY_OR_EXPORT, nodefs); # 406|-> if (any_failed = sh_chkwrite (any_failed)) # 407| break; # 408| } Error: COMPILER_WARNING (CWE-569): [#def116] bash-5.3/builtins/shopt.def: scope_hint: In function ‘toggle_shopts’ bash-5.3/builtins/shopt.def:484:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 484 | if (v = find_variable ("BASHOPTS")) # | ^ # 482| # 483| /* Don't set $BASHOPTS here if it hasn't already been initialized */ # 484|-> if (v = find_variable ("BASHOPTS")) # 485| set_bashopts (); # 486| return (rval); Error: CPPCHECK_WARNING (CWE-457): [#def117] bash-5.3/builtins/shopt.def:844: warning[uninitvar]: Uninitialized variable: tflag # 842| for (i = vptr = 0; shopt_vars[i].name; i++) # 843| { # 844|-> if (tflag[i]) # 845| { # 846| strcpy (value + vptr, shopt_vars[i].name); Error: COMPILER_WARNING (CWE-569): [#def118] bash-5.3/builtins/shopt.def: scope_hint: In function ‘parse_bashopts’ bash-5.3/builtins/shopt.def:882:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 882 | while (vname = extract_colon_unit (value, &vptr)) # | ^~~~~ # 880| # 881| vptr = 0; # 882|-> while (vname = extract_colon_unit (value, &vptr)) # 883| { # 884| ind = find_shopt (vname); Error: COMPILER_WARNING (CWE-569): [#def119] bash-5.3/builtins/type.def: scope_hint: In function ‘describe_command’ bash-5.3/builtins/type.def:353:11: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 353 | if (full_path = phash_search (command)) # | ^~~~~~~~~ # 351| if (all == 0 || (dflags & CDESC_FORCE_PATH)) # 352| { # 353|-> if (full_path = phash_search (command)) # 354| { # 355| if (dflags & CDESC_TYPE) Error: GCC_ANALYZER_WARNING (CWE-688): [#def120] bash-5.3/builtins/type.def:427:9: warning[-Wanalyzer-null-argument]: use of NULL ‘full_path’ where non-null expected bash-5.3/builtins/type.def:383:10: branch_false: following ‘false’ branch (when ‘full_path’ is non-NULL)... bash-5.3/builtins/type.def:391:11: branch_false: ...to here bash-5.3/builtins/type.def:398:18: branch_false: following ‘false’ branch (when ‘all != 0’)... bash-5.3/builtins/type.def:419:7: branch_false: ...to here bash-5.3/builtins/type.def:427:9: danger: argument 1 (‘full_path’) NULL where non-null expected #argument 1 of ‘__builtin_puts’ must be non-null # 425| printf (_("%s is %s\n"), command, full_path); # 426| else if (dflags & (CDESC_REUSABLE|CDESC_PATH_ONLY)) # 427|-> printf ("%s\n", full_path); # 428| # 429| free (full_path); Error: COMPILER_WARNING (CWE-1164): [#def121] bash-5.3/builtins/ulimit.def:224:12: warning[-Wunused-function]: ‘set_all_limits’ declared ‘static’ but never defined # 224 | static int set_all_limits (int, RLIMTYPE); # | ^~~~~~~~~~~~~~ # 222| static void print_all_limits (int); # 223| # 224|-> static int set_all_limits (int, RLIMTYPE); # 225| # 226| static int filesize (RLIMTYPE *); Error: COMPILER_WARNING (CWE-1164): [#def122] bash-5.3/builtins/umask.def: scope_hint: In function ‘parse_symbolic_mode’ bash-5.3/builtins/umask.def:344:1: warning[-Wunused-label]: label ‘spec_error’ defined but not used # 344 | spec_error: # | ^~~~~~~~~~ # 342| else # 343| { # 344|-> spec_error: # 345| builtin_error (_("`%c': invalid symbolic mode character"), *s); # 346| return (-1); Error: COMPILER_WARNING: [#def123] bash-5.3/builtins/wait.def: scope_hint: In function ‘wait_builtin’ bash-5.3/builtins/wait.def:117:14: warning[-Wunused-but-set-variable=]: variable ‘pidvar’ set but not used # 117 | SHELL_VAR *pidvar; # | ^~~~~~ # 115| volatile int wflags; # 116| char *vname; # 117|-> SHELL_VAR *pidvar; # 118| struct procstat pstat; # 119| Error: COMPILER_WARNING (CWE-569): [#def124] bash-5.3/eval.c: scope_hint: In function ‘reader_loop’ bash-5.3/eval.c:156:20: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 156 | else if (current_command = global_command) # | ^~~~~~~~~~~~~~~ # 154| global_command = (COMMAND *)NULL; # 155| } # 156|-> else if (current_command = global_command) # 157| { # 158| global_command = (COMMAND *)NULL; Error: COMPILER_WARNING (CWE-252): [#def125] bash-5.3/eval.c: scope_hint: In function ‘alrm_catcher’ bash-5.3/eval.c:262:3: warning[-Wunused-result]: ignoring return value of ‘write’ declared with attribute ‘warn_unused_result’ # 262 | write (1, msg, strlen (msg)); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ # 260| # 261| msg = _("\007timed out waiting for input: auto-logout\n"); # 262|-> write (1, msg, strlen (msg)); # 263| # 264| bash_logout (); /* run ~/.bash_logout if this is a login shell */ Error: COMPILER_WARNING (CWE-563): [#def126] bash-5.3/execute_cmd.c:291:12: warning[-Wunused-variable]: ‘connection_count’ defined but not used # 291 | static int connection_count; # | ^~~~~~~~~~~~~~~~ # 289| static int showing_function_line; # 290| # 291|-> static int connection_count; # 292| # 293| /* $LINENO ($BASH_LINENO) for use by an ERR trap. Global so parse_and_execute Error: COMPILER_WARNING (CWE-457): [#def127] bash-5.3/execute_cmd.c: scope_hint: In function ‘execute_command_internal’ bash-5.3/execute_cmd.c:1209:9: warning[-Wmaybe-uninitialized]: ‘ofifo_list’ may be used uninitialized # 1209 | close_new_fifos (ofifo_list, osize); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bash-5.3/execute_cmd.c:638:9: note: ‘ofifo_list’ was declared here # 638 | void *ofifo_list; /* void * volatile ofifo_list; */ # | ^~~~~~~~~~ # 1207| nfifo = num_fifos (); # 1208| if (nfifo > ofifo) # 1209|-> close_new_fifos (ofifo_list, osize); # 1210| free (ofifo_list); # 1211| discard_unwind_frame ("internal_fifos"); Error: CPPCHECK_WARNING (CWE-457): [#def128] bash-5.3/execute_cmd.c:1498: error[uninitvar]: Uninitialized variable: save_top_level # 1496| rv = EXECUTION_SUCCESS; /* suppress uninitialized use warnings */ # 1497| old_flags = command->flags; # 1498|-> COPY_PROCENV (top_level, save_top_level); # 1499| command->flags &= ~(CMD_TIME_PIPELINE|CMD_TIME_POSIX); # 1500| code = setjmp_nosigs (top_level); Error: COMPILER_WARNING (CWE-1164): [#def129] bash-5.3/execute_cmd.c: scope_hint: At top level bash-5.3/execute_cmd.c:1894:13: warning[-Wunused-function]: ‘cpl_prune’ declared ‘static’ but never defined # 1894 | static void cpl_prune (void); # | ^~~~~~~~~ # 1892| static struct cpelement *cpl_search (pid_t); # 1893| static struct cpelement *cpl_searchbyname (const char *); # 1894|-> static void cpl_prune (void); # 1895| # 1896| static void coproc_free (struct coproc *); Error: COMPILER_WARNING (CWE-1164): [#def130] bash-5.3/execute_cmd.c:1945:1: warning[-Wunused-function]: ‘cpl_delete’ defined but not used # 1945 | cpl_delete (pid_t pid) # | ^~~~~~~~~~ # 1943| # 1944| static struct cpelement * # 1945|-> cpl_delete (pid_t pid) # 1946| { # 1947| struct cpelement *prev, *p; Error: COMPILER_WARNING (CWE-563): [#def131] bash-5.3/execute_cmd.c:3316:12: warning[-Wunused-variable]: ‘LINES’ defined but not used # 3316 | static int LINES, COLS, tabsize; # | ^~~~~ # 3314| # 3315| #if defined (SELECT_COMMAND) # 3316|-> static int LINES, COLS, tabsize; # 3317| # 3318| #define RP_SPACE ") " Error: COMPILER_WARNING (CWE-563): [#def132] bash-5.3/execute_cmd.c: scope_hint: In function ‘select_query’ bash-5.3/execute_cmd.c:3443:23: warning[-Wunused-variable]: unused variable ‘t’ # 3443 | char *repl_string, *t; # | ^ # 3441| intmax_t reply; # 3442| WORD_LIST *l; # 3443|-> char *repl_string, *t; # 3444| # 3445| COLS = default_columns (); Error: GCC_ANALYZER_WARNING (CWE-476): [#def133] bash-5.3/expr.c:371:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cp’ bash-5.3/expr.c:1319:1: enter_function: entry to ‘readtok’ bash-5.3/expr.c:1329:10: branch_true: following ‘true’ branch... bash-5.3/expr.c:1332:6: branch_true: following ‘true’ branch (when ‘c != 0’)... bash-5.3/expr.c:1333:5: branch_true: ...to here bash-5.3/expr.c:1342:12: release_memory: ‘cp’ is NULL bash-5.3/expr.c:1342:3: release_memory: ‘cp’ is NULL bash-5.3/expr.c:1351:14: branch_false: following ‘false’ branch... bash-5.3/expr.c:1354:7: release_memory: ‘cp’ is NULL bash-5.3/expr.c:1357:10: branch_true: following ‘true’ branch (when ‘c == 91’)... bash-5.3/expr.c:1359:15: branch_true: ...to here bash-5.3/expr.c:1359:15: call_function: calling ‘expr_skipsubscript’ from ‘readtok’ # 369| if (noexp) # 370| { # 371|-> *cp = '\0'; # 372| isassoc = valid_identifier (vp) && (entry = find_variable (vp)) && assoc_p (entry); # 373| *cp = '['; /* ] */ Error: COMPILER_WARNING (CWE-1164): [#def134] bash-5.3/expr.c:1134:1: warning[-Wunused-function]: ‘alloc_lvalue’ defined but not used # 1134 | alloc_lvalue (void) # | ^~~~~~~~~~~~ # 1132| # 1133| static struct lvalue * # 1134|-> alloc_lvalue (void) # 1135| { # 1136| struct lvalue *lv; Error: COMPILER_WARNING (CWE-1164): [#def135] bash-5.3/expr.c: scope_hint: At top level bash-5.3/expr.c:1144:1: warning[-Wunused-function]: ‘free_lvalue’ defined but not used # 1144 | free_lvalue (struct lvalue *lv) # | ^~~~~~~~~~~ # 1142| # 1143| static void # 1144|-> free_lvalue (struct lvalue *lv) # 1145| { # 1146| free (lv); /* should be inlined */ Error: GCC_ANALYZER_WARNING (CWE-476): [#def136] bash-5.3/expr.c:1371:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘cp’ bash-5.3/expr.c:1329:10: branch_true: following ‘true’ branch... bash-5.3/expr.c:1332:6: branch_true: following ‘true’ branch (when ‘c != 0’)... bash-5.3/expr.c:1333:5: branch_true: ...to here bash-5.3/expr.c:1342:12: release_memory: ‘cp’ is NULL bash-5.3/expr.c:1342:3: release_memory: ‘cp’ is NULL bash-5.3/expr.c:1351:14: branch_false: following ‘false’ branch... bash-5.3/expr.c:1354:7: release_memory: ‘cp’ is NULL bash-5.3/expr.c:1357:10: branch_false: following ‘false’ branch (when ‘c != 91’)... bash-5.3/expr.c:1371:7: branch_false: ...to here bash-5.3/expr.c:1371:7: danger: dereference of NULL ‘cp’ # 1369| #endif /* ARRAY_VARS */ # 1370| # 1371|-> *cp = '\0'; # 1372| /* XXX - watch out for pointer aliasing issues here */ # 1373| if (curlval.tokstr && curlval.tokstr == tokstr) Error: GCC_ANALYZER_WARNING (CWE-688): [#def137] bash-5.3/expr.c:1377:16: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected bash-5.3/expr.c:1329:10: branch_true: following ‘true’ branch... bash-5.3/expr.c:1332:6: branch_true: following ‘true’ branch (when ‘c != 0’)... bash-5.3/expr.c:1333:5: branch_true: ...to here bash-5.3/expr.c:1342:12: release_memory: ‘cp’ is NULL bash-5.3/expr.c:1342:3: release_memory: ‘cp’ is NULL bash-5.3/expr.c:1357:10: branch_false: following ‘false’ branch (when ‘c != 91’)... bash-5.3/expr.c:1371:7: branch_false: ...to here bash-5.3/expr.c:1376:7: branch_false: following ‘false’ branch... bash-5.3/expr.c:1377:16: branch_false: ...to here bash-5.3/expr.c:1377:16: release_memory: using NULL here bash-5.3/expr.c:1377:16: danger: argument 1 (‘tp’) NULL where non-null expected # 1375| # 1376| FREE (tokstr); # 1377|-> tokstr = savestring (tp); # 1378| *cp = c; # 1379| Error: COMPILER_WARNING (CWE-563): [#def138] bash-5.3/expr.c: scope_hint: In function ‘strlong’ bash-5.3/expr.c:1557:17: warning[-Wunused-variable]: unused variable ‘pval’ # 1557 | intmax_t val, pval; # | ^~~~ # 1555| register unsigned char c; # 1556| int base, foundbase; # 1557|-> intmax_t val, pval; # 1558| # 1559| s = num; Error: COMPILER_WARNING (CWE-563): [#def139] bash-5.3/findcmd.c: scope_hint: In function ‘_find_user_command_internal’ bash-5.3/findcmd.c:284:14: warning[-Wunused-variable]: unused variable ‘var’ # 284 | SHELL_VAR *var; # | ^~~ # 282| { # 283| char *path_list, *cmd; # 284|-> SHELL_VAR *var; # 285| # 286| /* Search for the value of PATH in both the temporary environments and Error: CPPCHECK_WARNING (CWE-476): [#def140] bash-5.3/findcmd.c:510: warning[nullPointer]: Possible null pointer dereference: match_list # 508| } # 509| # 510|-> match = match_list[match_index]; # 511| # 512| if (match) Error: COMPILER_WARNING (CWE-665): [#def141] bash-5.3/general.c:91:1: warning[-Wmissing-braces]: missing braces around initializer # 91 | { # | ^ # 92 | &interactive_comments, # | { } # 93 | &source_uses_path, # | { } # 94 | &expaliases_flag, # | { } # 95 | &inherit_errexit, # | { } # 96 | &print_shift_error, # | { } # 97 | 0 # | { # 98 | }; # | } # 89| int *posix_mode_var; # 90| } posix_vars[] = # 91|-> { # 92| &interactive_comments, # 93| &source_uses_path, Error: COMPILER_WARNING (CWE-569): [#def142] bash-5.3/general.c: scope_hint: In function ‘assignment’ bash-5.3/general.c:504:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 504 | while (c = string[indx]) # | ^ # 502| return (0); # 503| # 504|-> while (c = string[indx]) # 505| { # 506| /* The following is safe. Note that '=' at the start of a word Error: GCC_ANALYZER_WARNING (CWE-775): [#def143] bash-5.3/general.c:645:5: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘tty_fd’ bash-5.3/general.c:635:12: acquire_resource: opened here bash-5.3/general.c:637:6: branch_false: following ‘false’ branch... bash-5.3/general.c:645:5: branch_false: ...to here bash-5.3/general.c:645:5: throw: if ‘close’ throws an exception... bash-5.3/general.c:645:5: danger: ‘tty_fd’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 643| } # 644| if (tty_fd >= 0) # 645|-> close (tty_fd); # 646| } # 647| Error: GCC_ANALYZER_WARNING (CWE-775): [#def144] bash-5.3/general.c:703:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘script_fd’ bash-5.3/general.c:700:6: branch_true: following ‘true’ branch... bash-5.3/general.c:700:46: branch_true: ...to here bash-5.3/general.c:700:46: acquire_resource: opened here bash-5.3/general.c:700:7: branch_true: following ‘true’ branch (when ‘script_fd != -1’)... bash-5.3/general.c:702:10: branch_true: ...to here bash-5.3/general.c:703:9: throw: if ‘close’ throws an exception... bash-5.3/general.c:703:9: danger: ‘script_fd’ leaks here; was opened at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2) # 701| { # 702| if (check_new == 0 || fd != fileno (stderr)) /* don't close stderr */ # 703|-> close (fd); # 704| return (script_fd); # 705| } Error: COMPILER_WARNING (CWE-457): [#def145] bash-5.3/shell.h:29: included_from: Included from here. bash-5.3/subst.c:50: included_from: Included from here. bash-5.3/subst.c: scope_hint: In function ‘parameter_brace_expand_length’ bash-5.3/general.h:169:78: warning[-Wmaybe-uninitialized]: ‘t’ may be used uninitialized # 169 | #define STRLEN(s) (((s) && (s)[0]) ? ((s)[1] ? ((s)[2] ? strlen(s) : 2) : 1) : 0) # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ bash-5.3/subst.c:8260:9: note: ‘t’ was declared here # 8260 | char *t, *newname; # | ^ # 167| # 168| /* More convenience definitions that possibly save system or libc calls. */ # 169|-> #define STRLEN(s) (((s) && (s)[0]) ? ((s)[1] ? ((s)[2] ? strlen(s) : 2) : 1) : 0) # 170| #define FREE(s) do { if (s) free (s); } while (0) # 171| #define MEMBER(c, s) (((c) && c == (s)[0] && !(s)[1]) || (member(c, s))) Error: COMPILER_WARNING (CWE-1164): [#def146] bash-5.3/hashlib.c:164:1: warning[-Wunused-function]: ‘hash_shrink’ defined but not used # 164 | hash_shrink (HASH_TABLE *table) # | ^~~~~~~~~~~ # 162| # 163| static void # 164|-> hash_shrink (HASH_TABLE *table) # 165| { # 166| int nsize; Error: COMPILER_WARNING: [#def147] bash-5.3/jobs.c: scope_hint: In function ‘procsub_waitall’ bash-5.3/jobs.c:1149:7: warning[-Wunused-but-set-variable=]: variable ‘r’ set but not used # 1149 | int r; # | ^ # 1147| { # 1148| PROCESS *p; # 1149|-> int r; # 1150| # 1151| for (p = procsubs.head; p; p = p->next) Error: COMPILER_WARNING: [#def148] bash-5.3/jobs.c:1183:20: warning[-Wunused-but-set-variable=]: variable ‘oend’ set but not used # 1183 | PROCESS *ohead, *oend, *ps, *p; # | ^~~~ # 1181| procsub_prune (void) # 1182| { # 1183|-> PROCESS *ohead, *oend, *ps, *p; # 1184| int onproc; # 1185| Error: COMPILER_WARNING: [#def149] bash-5.3/jobs.c: scope_hint: In function ‘procsub_prune’ bash-5.3/jobs.c:1184:7: warning[-Wunused-but-set-variable=]: variable ‘onproc’ set but not used # 1184 | int onproc; # | ^~~~~~ # 1182| { # 1183| PROCESS *ohead, *oend, *ps, *p; # 1184|-> int onproc; # 1185| # 1186| if (procsubs.nproc == 0) Error: COMPILER_WARNING (CWE-569): [#def150] bash-5.3/jobs.c: scope_hint: In function ‘nohup_job’ bash-5.3/jobs.c:1555:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 1555 | if (temp = jobs[job_index]) # | ^~~~ # 1553| return; # 1554| # 1555|-> if (temp = jobs[job_index]) # 1556| temp->flags |= J_NOHUP; # 1557| } Error: COMPILER_WARNING (CWE-457): [#def151] bash-5.3/jobs.c: scope_hint: In function ‘make_child’ bash-5.3/jobs.c:2327:7: warning[-Wmaybe-uninitialized]: ‘oterm’ may be used uninitialized # 2327 | set_signal_handler (SIGTERM, oterm); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bash-5.3/jobs.c:2272:15: note: ‘oterm’ was declared here # 2272 | SigHandler *oterm; # | ^~~~~ # 2325| if (pid != 0) # 2326| if (interactive_shell) # 2327|-> set_signal_handler (SIGTERM, oterm); # 2328| # 2329| if (pid < 0) Error: GCC_ANALYZER_WARNING (CWE-476): [#def152] bash-5.3/jobs.c:2718:10: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ bash-5.3/jobs.c:4543:1: enter_function: entry to ‘notify_of_job_status’ bash-5.3/jobs.c:4565:29: branch_true: following ‘true’ branch... bash-5.3/jobs.c:4567:11: branch_true: ...to here bash-5.3/jobs.c:4570:10: branch_true: following ‘true’ branch... bash-5.3/jobs.c:4619:18: branch_true: following ‘true’ branch... bash-5.3/jobs.c:4619:37: branch_true: ...to here bash-5.3/jobs.c:4619:19: branch_false: following ‘false’ branch... bash-5.3/jobs.c:4619:59: call_function: inlined call to ‘find_last_pid’ from ‘notify_of_job_status’ bash-5.3/jobs.c:4619:59: call_function: inlined call to ‘find_last_pid’ from ‘notify_of_job_status’ # 2716| p = find_last_proc (job, block); # 2717| /* Possible race condition here. */ # 2718|-> return p->pid; # 2719| } # 2720| Error: COMPILER_WARNING: [#def153] bash-5.3/jobs.c: scope_hint: In function ‘wait_for_background_pids’ bash-5.3/jobs.c:2799:20: warning[-Wunused-but-set-variable=]: variable ‘check_async’ set but not used # 2799 | int any_stopped, check_async, njobs; # | ^~~~~~~~~~~ # 2797| { # 2798| register int i, r; # 2799|-> int any_stopped, check_async, njobs; # 2800| sigset_t set, oset; # 2801| pid_t pid; Error: COMPILER_WARNING: [#def154] bash-5.3/jobs.c: scope_hint: In function ‘sigchld_handler’ bash-5.3/jobs.c:4037:7: warning[-Wunused-but-set-variable=]: variable ‘n’ set but not used # 4037 | int n, oerrno; # | ^ # 4035| sigchld_handler (int sig) # 4036| { # 4037|-> int n, oerrno; # 4038| # 4039| oerrno = errno; Error: COMPILER_WARNING (CWE-1164): [#def155] bash-5.3/jobs.c: scope_hint: At top level bash-5.3/jobs.c:5038:1: warning[-Wunused-function]: ‘maybe_give_terminal_to’ defined but not used # 5038 | maybe_give_terminal_to (pid_t opgrp, pid_t npgrp, int flags) # | ^~~~~~~~~~~~~~~~~~~~~~ # 5036| flags to pass to give_terminal_to(). */ # 5037| static int # 5038|-> maybe_give_terminal_to (pid_t opgrp, pid_t npgrp, int flags) # 5039| { # 5040| int tpgrp; Error: COMPILER_WARNING: [#def156] bash-5.3/jobs.c: scope_hint: In function ‘unfreeze_jobs_list’ bash-5.3/jobs.c:5296:7: warning[-Wunused-but-set-variable=]: variable ‘o’ set but not used # 5296 | int o; # | ^ # 5294| unfreeze_jobs_list (void) # 5295| { # 5296|-> int o; # 5297| # 5298| o = jobs_list_frozen; Error: GCC_ANALYZER_WARNING (CWE-401): [#def157] bash-5.3/lib/glob/glob.c:160:26: warning[-Wanalyzer-malloc-leak]: leak of ‘directory_name’ bash-5.3/lib/glob/glob.c:1118:1: enter_function: entry to ‘glob_filename’ bash-5.3/lib/glob/glob.c:1129:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/lib/glob/glob.c:1132:3: branch_false: ...to here bash-5.3/lib/glob/glob.c:1139:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1139:16: branch_true: ...to here bash-5.3/lib/glob/glob.c:1150:6: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1159:23: branch_false: ...to here bash-5.3/lib/glob/glob.c:1160:33: acquire_memory: allocated here bash-5.3/lib/glob/glob.c:1162:10: branch_false: following ‘false’ branch (when ‘directory_name’ is non-NULL)... bash-5.3/lib/glob/glob.c:1168:7: branch_false: ...to here bash-5.3/lib/glob/glob.c:1179:6: branch_true: following ‘true’ branch (when ‘directory_len != 0’)... bash-5.3/lib/glob/glob.c:1179:39: branch_true: ...to here bash-5.3/lib/glob/glob.c:1179:39: call_function: calling ‘glob_pattern_p’ from ‘glob_filename’ # 158| int r; # 159| # 160|-> if (MB_CUR_MAX == 1 || mbsmbchar (pattern) == 0) # 161| return (internal_glob_pattern_p ((unsigned char *)pattern)); # 162| Error: GCC_ANALYZER_WARNING (CWE-401): [#def158] bash-5.3/lib/glob/glob.c:160:26: warning[-Wanalyzer-malloc-leak]: leak of ‘result’ bash-5.3/lib/glob/glob.c:1118:1: enter_function: entry to ‘glob_filename’ bash-5.3/lib/glob/glob.c:1127:22: acquire_memory: allocated here bash-5.3/lib/glob/glob.c:1129:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/lib/glob/glob.c:1132:3: branch_false: ...to here bash-5.3/lib/glob/glob.c:1139:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1139:16: branch_true: ...to here bash-5.3/lib/glob/glob.c:1150:6: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1159:23: branch_false: ...to here bash-5.3/lib/glob/glob.c:1162:10: branch_false: following ‘false’ branch (when ‘directory_name’ is non-NULL)... bash-5.3/lib/glob/glob.c:1168:7: branch_false: ...to here bash-5.3/lib/glob/glob.c:1179:6: branch_true: following ‘true’ branch (when ‘directory_len != 0’)... bash-5.3/lib/glob/glob.c:1179:39: branch_true: ...to here bash-5.3/lib/glob/glob.c:1179:39: call_function: calling ‘glob_pattern_p’ from ‘glob_filename’ # 158| int r; # 159| # 160|-> if (MB_CUR_MAX == 1 || mbsmbchar (pattern) == 0) # 161| return (internal_glob_pattern_p ((unsigned char *)pattern)); # 162| Error: GCC_ANALYZER_WARNING (CWE-401): [#def159] bash-5.3/lib/glob/glob.c:164:7: warning[-Wanalyzer-malloc-leak]: leak of ‘directory_name’ bash-5.3/lib/glob/glob.c:1118:1: enter_function: entry to ‘glob_filename’ bash-5.3/lib/glob/glob.c:1129:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/lib/glob/glob.c:1132:3: branch_false: ...to here bash-5.3/lib/glob/glob.c:1139:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1139:16: branch_true: ...to here bash-5.3/lib/glob/glob.c:1150:6: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1159:23: branch_false: ...to here bash-5.3/lib/glob/glob.c:1160:33: acquire_memory: allocated here bash-5.3/lib/glob/glob.c:1162:10: branch_false: following ‘false’ branch (when ‘directory_name’ is non-NULL)... bash-5.3/lib/glob/glob.c:1168:7: branch_false: ...to here bash-5.3/lib/glob/glob.c:1179:6: branch_true: following ‘true’ branch (when ‘directory_len != 0’)... bash-5.3/lib/glob/glob.c:1179:39: branch_true: ...to here bash-5.3/lib/glob/glob.c:1179:39: call_function: calling ‘glob_pattern_p’ from ‘glob_filename’ # 162| # 163| /* Convert strings to wide chars, and call the multibyte version. */ # 164|-> n = xdupmbstowcs (&wpattern, NULL, pattern); # 165| if (n == (size_t)-1) # 166| /* Oops. Invalid multibyte sequence. Try it as single-byte sequence. */ Error: GCC_ANALYZER_WARNING (CWE-401): [#def160] bash-5.3/lib/glob/glob.c:164:7: warning[-Wanalyzer-malloc-leak]: leak of ‘result’ bash-5.3/lib/glob/glob.c:1118:1: enter_function: entry to ‘glob_filename’ bash-5.3/lib/glob/glob.c:1127:22: acquire_memory: allocated here bash-5.3/lib/glob/glob.c:1129:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/lib/glob/glob.c:1132:3: branch_false: ...to here bash-5.3/lib/glob/glob.c:1139:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1139:16: branch_true: ...to here bash-5.3/lib/glob/glob.c:1150:6: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1159:23: branch_false: ...to here bash-5.3/lib/glob/glob.c:1162:10: branch_false: following ‘false’ branch (when ‘directory_name’ is non-NULL)... bash-5.3/lib/glob/glob.c:1168:7: branch_false: ...to here bash-5.3/lib/glob/glob.c:1179:6: branch_true: following ‘true’ branch (when ‘directory_len != 0’)... bash-5.3/lib/glob/glob.c:1179:39: branch_true: ...to here bash-5.3/lib/glob/glob.c:1179:39: call_function: calling ‘glob_pattern_p’ from ‘glob_filename’ # 162| # 163| /* Convert strings to wide chars, and call the multibyte version. */ # 164|-> n = xdupmbstowcs (&wpattern, NULL, pattern); # 165| if (n == (size_t)-1) # 166| /* Oops. Invalid multibyte sequence. Try it as single-byte sequence. */ Error: COMPILER_WARNING: [#def161] bash-5.3/lib/glob/glob.c:193:27: warning[-Wunused-but-set-variable=]: variable ‘nullpat’ set but not used # 193 | int n, r, negate, wild, nullpat, xflags; # | ^~~~~~~ # 191| { # 192| char *pp, *pe, *t, *se; # 193|-> int n, r, negate, wild, nullpat, xflags; # 194| # 195| negate = *pat == '!'; Error: COMPILER_WARNING (CWE-569): [#def162] bash-5.3/lib/glob/glob.c: scope_hint: In function ‘extglob_skipname’ bash-5.3/lib/glob/glob.c:226:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 226 | while (t = glob_patscan (pp, pe, '|', 0)) # | ^ # 224| # 225| /* check every subpattern */ # 226|-> while (t = glob_patscan (pp, pe, '|', 0)) # 227| { # 228| /* If T == PE and *T == 0 (&& PE[-1] == RPAREN), we have hit the end Error: COMPILER_WARNING (CWE-457): [#def163] bash-5.3/lib/glob/glob.c:246:12: warning[-Wmaybe-uninitialized]: ‘r’ may be used uninitialized # 246 | return r; # | ^ bash-5.3/lib/glob/glob.c: scope_hint: In function ‘skipname.isra.0’ bash-5.3/lib/glob/glob.c:193:10: note: ‘r’ was declared here # 193 | int n, r, negate, wild, nullpat, xflags; # | ^ # 244| /* glob_patscan might find end of string */ # 245| if (pp == se) # 246|-> return r; # 247| # 248| /* but if it doesn't then we didn't match a leading dot */ Error: COMPILER_WARNING: [#def164] bash-5.3/lib/glob/glob.c:333:24: warning[-Wunused-but-set-variable=]: variable ‘nullpat’ set but not used # 333 | int r, negate, wild, nullpat, xflags; # | ^~~~~~~ # 331| #if EXTENDED_GLOB # 332| wchar_t *pp, *pe, *t, *se, n; # 333|-> int r, negate, wild, nullpat, xflags; # 334| # 335| negate = *pat == L'!'; Error: COMPILER_WARNING (CWE-569): [#def165] bash-5.3/lib/glob/glob.c: scope_hint: In function ‘wextglob_skipname’ bash-5.3/lib/glob/glob.c:363:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 363 | while (t = glob_patscan_wc (pp, pe, '|', 0)) # | ^ # 361| # 362| /* check every subpattern */ # 363|-> while (t = glob_patscan_wc (pp, pe, '|', 0)) # 364| { # 365| n = t[-1]; /* ( */ Error: GCC_ANALYZER_WARNING (CWE-401): [#def166] bash-5.3/lib/glob/glob.c:478:7: warning[-Wanalyzer-malloc-leak]: leak of ‘result’ bash-5.3/lib/glob/glob.c:1118:1: enter_function: entry to ‘glob_filename’ bash-5.3/lib/glob/glob.c:1129:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/lib/glob/glob.c:1132:3: branch_false: ...to here bash-5.3/lib/glob/glob.c:1139:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1139:16: branch_true: ...to here bash-5.3/lib/glob/glob.c:1150:6: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1159:23: branch_false: ...to here bash-5.3/lib/glob/glob.c:1162:10: branch_false: following ‘false’ branch (when ‘directory_name’ is non-NULL)... bash-5.3/lib/glob/glob.c:1168:7: branch_false: ...to here bash-5.3/lib/glob/glob.c:1179:6: branch_true: following ‘true’ branch... bash-5.3/lib/glob/glob.c:1242:21: call_function: calling ‘glob_filename’ from ‘glob_filename’ # 476| wchar_t *orig_wpathname; # 477| # 478|-> if (mbsmbchar (pathname) == 0) # 479| { # 480| udequote_pathname (pathname); Error: GCC_ANALYZER_WARNING (CWE-401): [#def167] bash-5.3/lib/glob/glob.c:486:7: warning[-Wanalyzer-malloc-leak]: leak of ‘result’ bash-5.3/lib/glob/glob.c:1118:1: enter_function: entry to ‘glob_filename’ bash-5.3/lib/glob/glob.c:1129:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/lib/glob/glob.c:1132:3: branch_false: ...to here bash-5.3/lib/glob/glob.c:1139:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1139:16: branch_true: ...to here bash-5.3/lib/glob/glob.c:1150:6: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1159:23: branch_false: ...to here bash-5.3/lib/glob/glob.c:1162:10: branch_false: following ‘false’ branch (when ‘directory_name’ is non-NULL)... bash-5.3/lib/glob/glob.c:1168:7: branch_false: ...to here bash-5.3/lib/glob/glob.c:1179:6: branch_true: following ‘true’ branch... bash-5.3/lib/glob/glob.c:1242:21: call_function: calling ‘glob_filename’ from ‘glob_filename’ # 484| len = strlen (pathname); # 485| /* Convert the strings into wide characters. */ # 486|-> n = xdupmbstowcs (&wpathname, NULL, pathname); # 487| if (n == (size_t) -1) # 488| { Error: GCC_ANALYZER_WARNING (CWE-401): [#def168] bash-5.3/lib/glob/glob.c:504:11: warning[-Wanalyzer-malloc-leak]: leak of ‘result’ bash-5.3/lib/glob/glob.c:1118:1: enter_function: entry to ‘glob_filename’ bash-5.3/lib/glob/glob.c:1129:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/lib/glob/glob.c:1132:3: branch_false: ...to here bash-5.3/lib/glob/glob.c:1139:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1139:16: branch_true: ...to here bash-5.3/lib/glob/glob.c:1150:6: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1159:23: branch_false: ...to here bash-5.3/lib/glob/glob.c:1162:10: branch_false: following ‘false’ branch (when ‘directory_name’ is non-NULL)... bash-5.3/lib/glob/glob.c:1168:7: branch_false: ...to here bash-5.3/lib/glob/glob.c:1179:6: branch_true: following ‘true’ branch... bash-5.3/lib/glob/glob.c:1242:21: call_function: calling ‘glob_filename’ from ‘glob_filename’ # 502| wpathname = orig_wpathname; # 503| memset (&ps, '\0', sizeof(mbstate_t)); # 504|-> n = xwcsrtombs (pathname, (const wchar_t **)&wpathname, len, &ps); # 505| } # 506| pathname[len] = '\0'; Error: GCC_ANALYZER_WARNING (CWE-401): [#def169] bash-5.3/lib/glob/glob.c:1141:12: warning[-Wanalyzer-malloc-leak]: leak of ‘result’ bash-5.3/lib/glob/glob.c:1127:22: acquire_memory: allocated here bash-5.3/lib/glob/glob.c:1129:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/lib/glob/glob.c:1132:3: branch_false: ...to here bash-5.3/lib/glob/glob.c:1139:6: branch_true: following ‘true’ branch... bash-5.3/lib/glob/glob.c:1141:12: throw: if ‘glob_dirscan’ throws an exception... bash-5.3/lib/glob/glob.c:1141:12: danger: ‘result’ leaks here; was allocated at [(1)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/0) # 1139| if (filename && extended_glob) # 1140| { # 1141|-> fn = glob_dirscan (pathname, '/'); # 1142| #if DEBUG_MATCHING # 1143| if (fn != filename) Error: GCC_ANALYZER_WARNING (CWE-122): [#def170] bash-5.3/lib/glob/glob.c:1220:29: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read bash-5.3/lib/glob/glob.c:1118:1: enter_function: entry to ‘glob_filename’ bash-5.3/lib/glob/glob.c:1129:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/lib/glob/glob.c:1132:3: branch_false: ...to here bash-5.3/lib/glob/glob.c:1139:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1139:16: branch_true: ...to here bash-5.3/lib/glob/glob.c:1150:6: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1159:23: branch_false: ...to here bash-5.3/lib/glob/glob.c:1162:10: branch_false: following ‘false’ branch (when ‘directory_name’ is non-NULL)... bash-5.3/lib/glob/glob.c:1168:7: branch_false: ...to here bash-5.3/lib/glob/glob.c:1179:6: branch_true: following ‘true’ branch... bash-5.3/lib/glob/glob.c:1242:21: call_function: calling ‘glob_filename’ from ‘glob_filename’ # 1218| size_t dl, prev; # 1219| prev = dl = directory_len; # 1220|-> while (dl >= 4 && d[dl - 1] == '/' && # 1221| d[dl - 2] == '*' && # 1222| d[dl - 3] == '*' && Error: GCC_ANALYZER_WARNING (CWE-122): [#def171] bash-5.3/lib/glob/glob.c:1221:28: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read bash-5.3/lib/glob/glob.c:1118:1: enter_function: entry to ‘glob_filename’ bash-5.3/lib/glob/glob.c:1129:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/lib/glob/glob.c:1132:3: branch_false: ...to here bash-5.3/lib/glob/glob.c:1139:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1139:16: branch_true: ...to here bash-5.3/lib/glob/glob.c:1150:6: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1159:23: branch_false: ...to here bash-5.3/lib/glob/glob.c:1162:10: branch_false: following ‘false’ branch (when ‘directory_name’ is non-NULL)... bash-5.3/lib/glob/glob.c:1168:7: branch_false: ...to here bash-5.3/lib/glob/glob.c:1179:6: branch_true: following ‘true’ branch... bash-5.3/lib/glob/glob.c:1242:21: call_function: calling ‘glob_filename’ from ‘glob_filename’ # 1219| prev = dl = directory_len; # 1220| while (dl >= 4 && d[dl - 1] == '/' && # 1221|-> d[dl - 2] == '*' && # 1222| d[dl - 3] == '*' && # 1223| d[dl - 4] == '/') Error: GCC_ANALYZER_WARNING (CWE-122): [#def172] bash-5.3/lib/glob/glob.c:1222:28: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read bash-5.3/lib/glob/glob.c:1118:1: enter_function: entry to ‘glob_filename’ bash-5.3/lib/glob/glob.c:1129:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/lib/glob/glob.c:1132:3: branch_false: ...to here bash-5.3/lib/glob/glob.c:1139:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1139:16: branch_true: ...to here bash-5.3/lib/glob/glob.c:1150:6: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1159:23: branch_false: ...to here bash-5.3/lib/glob/glob.c:1162:10: branch_false: following ‘false’ branch (when ‘directory_name’ is non-NULL)... bash-5.3/lib/glob/glob.c:1168:7: branch_false: ...to here bash-5.3/lib/glob/glob.c:1179:6: branch_true: following ‘true’ branch... bash-5.3/lib/glob/glob.c:1242:21: call_function: calling ‘glob_filename’ from ‘glob_filename’ # 1220| while (dl >= 4 && d[dl - 1] == '/' && # 1221| d[dl - 2] == '*' && # 1222|-> d[dl - 3] == '*' && # 1223| d[dl - 4] == '/') # 1224| prev = dl, dl -= 3; Error: GCC_ANALYZER_WARNING (CWE-122): [#def173] bash-5.3/lib/glob/glob.c:1223:28: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read bash-5.3/lib/glob/glob.c:1118:1: enter_function: entry to ‘glob_filename’ bash-5.3/lib/glob/glob.c:1129:6: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)... bash-5.3/lib/glob/glob.c:1132:3: branch_false: ...to here bash-5.3/lib/glob/glob.c:1139:6: branch_true: following ‘true’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1139:16: branch_true: ...to here bash-5.3/lib/glob/glob.c:1150:6: branch_false: following ‘false’ branch (when ‘filename’ is non-NULL)... bash-5.3/lib/glob/glob.c:1159:23: branch_false: ...to here bash-5.3/lib/glob/glob.c:1162:10: branch_false: following ‘false’ branch (when ‘directory_name’ is non-NULL)... bash-5.3/lib/glob/glob.c:1168:7: branch_false: ...to here bash-5.3/lib/glob/glob.c:1179:6: branch_true: following ‘true’ branch... bash-5.3/lib/glob/glob.c:1242:21: call_function: calling ‘glob_filename’ from ‘glob_filename’ # 1221| d[dl - 2] == '*' && # 1222| d[dl - 3] == '*' && # 1223|-> d[dl - 4] == '/') # 1224| prev = dl, dl -= 3; # 1225| if (dl != directory_len) Error: CPPCHECK_WARNING (CWE-758): [#def174] bash-5.3/lib/glob/glob.c:1388: warning[objectIndex]: The address of variable 'glob_error_return' might be accessed at non-zero index. # 1386| array = glob_dir_to_array (directories[i], temp_results, flags); # 1387| l = 0; # 1388|-> while (array[l] != NULL) # 1389| ++l; # 1390| Error: CPPCHECK_WARNING (CWE-758): [#def175] bash-5.3/lib/glob/glob.c:1395: warning[objectIndex]: The address of variable 'glob_error_return' might be accessed at non-zero index. # 1393| if (new_result == NULL) # 1394| { # 1395|-> for (l = 0; array[l]; ++l) # 1396| free (array[l]); # 1397| free ((char *)array); Error: CPPCHECK_WARNING (CWE-758): [#def176] bash-5.3/lib/glob/glob.c:1396: warning[objectIndex]: The address of variable 'glob_error_return' might be accessed at non-zero index. # 1394| { # 1395| for (l = 0; array[l]; ++l) # 1396|-> free (array[l]); # 1397| free ((char *)array); # 1398| goto memory_error; Error: COMPILER_WARNING (CWE-569): [#def177] bash-5.3/lib/glob/gmisc.c:57: included_from: Included from here. bash-5.3/lib/glob/gm_loop.c: scope_hint: In function ‘umatchlen’ bash-5.3/lib/glob/gm_loop.c:80:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 80 | while (c = *pat++) # | ^ # 78| # 79| matlen = in_cclass = in_collsym = in_equiv = 0; # 80|-> while (c = *pat++) # 81| { # 82| switch (c) Error: COMPILER_WARNING (CWE-569): [#def178] bash-5.3/lib/glob/smatch.c:335: included_from: Included from here. bash-5.3/lib/glob/sm_loop.c: scope_hint: In function ‘brackmatch’ bash-5.3/lib/glob/sm_loop.c:417:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 417 | if (not = (*p == L('!') || *p == L('^'))) # | ^~~ # 415| expression starting with an unquoted circumflex character produces # 416| unspecified results. This implementation treats the two identically. */ # 417|-> if (not = (*p == L('!') || *p == L('^'))) # 418| ++p; # 419| Error: COMPILER_WARNING (CWE-569): [#def179] bash-5.3/lib/glob/sm_loop.c: scope_hint: In function ‘glob_patscan’ bash-5.3/lib/glob/sm_loop.c:687:20: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 687 | for (s = string; c = *s; s++) # | ^ # 685| return (NULL); # 686| # 687|-> for (s = string; c = *s; s++) # 688| { # 689| if (s >= end) Error: COMPILER_WARNING (CWE-569): [#def180] bash-5.3/lib/glob/sm_loop.c: scope_hint: In function ‘extmatch’ bash-5.3/lib/glob/sm_loop.c:898:19: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 898 | if (m1 = (GMATCH (s, srest, psub, pnext - 1, NULL, flags) == 0)) # | ^~ # 896| pnext = PATSCAN (psub, pe, L('|'), flags); # 897| /* If one of the patterns matches, just bail immediately. */ # 898|-> if (m1 = (GMATCH (s, srest, psub, pnext - 1, NULL, flags) == 0)) # 899| break; # 900| if (pnext == prest) Error: COMPILER_WARNING (CWE-569): [#def181] bash-5.3/lib/glob/smatch.c: scope_hint: In function ‘posix_cclass_only’ bash-5.3/lib/glob/smatch.c:519:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 519 | while (p = strchr (p, '[')) # | ^ # 517| # 518| p = pattern; # 519|-> while (p = strchr (p, '[')) # 520| { # 521| if (p[1] != ':') Error: CPPCHECK_WARNING (CWE-456): [#def182] bash-5.3/lib/glob/xmbsrtowcs.c:90: error[uninitdata]: Memory is allocated but not initialized: wsbuf # 88| psbuf = *ps; # 89| # 90|-> wclength = mbsrtowcs (wsbuf, &mbs, n, &psbuf); # 91| # 92| if (wsbuf) Error: GCC_ANALYZER_WARNING (CWE-476): [#def183] bash-5.3/lib/glob/xmbsrtowcs.c:221:11: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘wsbuf’ bash-5.3/lib/glob/xmbsrtowcs.c:182:10: branch_false: following ‘false’ branch (when ‘wcslength != 0’)... bash-5.3/lib/glob/xmbsrtowcs.c:190:10: branch_false: ...to here bash-5.3/lib/glob/xmbsrtowcs.c:190:10: branch_false: following ‘false’ branch (when ‘wcslength != 18446744073709551615’)... bash-5.3/lib/glob/xmbsrtowcs.c:198:24: branch_false: ...to here bash-5.3/lib/glob/xmbsrtowcs.c:198:10: branch_false: following ‘false’ branch... bash-5.3/lib/glob/xmbsrtowcs.c:217:11: branch_false: ...to here bash-5.3/lib/glob/xmbsrtowcs.c:219:10: branch_true: following ‘true’ branch... bash-5.3/lib/glob/xmbsrtowcs.c:221:11: danger: dereference of NULL ‘wsbuf + wcnum * 4’ # 219| if (n == 0 && p == 0) # 220| { # 221|-> wsbuf[wcnum] = L'\0'; # 222| break; # 223| } Error: COMPILER_WARNING (CWE-1164): [#def184] bash-5.3/lib/glob/xmbsrtowcs.c: scope_hint: In function ‘xwcsrtombs’ bash-5.3/lib/glob/xmbsrtowcs.c:448:1: warning[-Wunused-label]: label ‘handle_byte’ defined but not used # 448 | handle_byte: # | ^~~~~~~~~~~ # 446| treat invalid wide character sequences as bytes. This is # 447| intended to be symmetric with xdupmbstowcs2. */ # 448|-> handle_byte: # 449| destptr = tmp_dest; /* in case wcrtomb modified it */ # 450| uc = wc; Error: GCC_ANALYZER_WARNING (CWE-404): [#def185] bash-5.3/lib/readline/bind.c:1145:3: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ bash-5.3/lib/readline/bind.c:2059:1: enter_function: entry to ‘rl_variable_bind’ bash-5.3/lib/readline/bind.c:2074:7: call_function: calling ‘find_string_var’ from ‘rl_variable_bind’ bash-5.3/lib/readline/bind.c:2074:7: return_function: returning to ‘rl_variable_bind’ from ‘find_string_var’ bash-5.3/lib/readline/bind.c:2078:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/bind.c:2086:6: branch_true: following ‘true’ branch... bash-5.3/lib/readline/bind.c:2087:5: branch_true: ...to here bash-5.3/lib/readline/bind.c:2087:5: call_function: calling ‘_rl_init_file_error’ from ‘rl_variable_bind’ # 1143| vfprintf (stderr, format, args); # 1144| fprintf (stderr, "\n"); # 1145|-> fflush (stderr); # 1146| # 1147| va_end (args); Error: COMPILER_WARNING (CWE-569): [#def186] bash-5.3/lib/readline/bind.c: scope_hint: In function ‘_rl_skip_to_delim’ bash-5.3/lib/readline/bind.c:1566:29: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 1566 | for (i = start,passc = 0; c = string[i]; i++) # | ^ # 1564| int i, c, passc; # 1565| # 1566|-> for (i = start,passc = 0; c = string[i]; i++) # 1567| { # 1568| if (passc) Error: COMPILER_WARNING (CWE-569): [#def187] bash-5.3/lib/readline/bind.c: scope_hint: In function ‘rl_function_dumper’ bash-5.3/lib/readline/bind.c:2810:15: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 2810 | for (i = 0; name = names[i]; i++) # | ^~~~ # 2808| fprintf (rl_outstream, "\n"); # 2809| # 2810|-> for (i = 0; name = names[i]; i++) # 2811| rl_print_keybinding (name, _rl_keymap, print_readably); # 2812| Error: COMPILER_WARNING (CWE-457): [#def188] bash-5.3/lib/readline/complete.c: scope_hint: In function ‘print_filename’ bash-5.3/lib/readline/complete.c:1101:22: warning[-Wmaybe-uninitialized]: ‘printed_len’ may be used uninitialized # 1101 | printed_len++; # | ~~~~~~~~~~~^~ bash-5.3/lib/readline/complete.c:994:7: note: ‘printed_len’ was declared here # 994 | int printed_len, extension_char, slen, tlen; # | ^~~~~~~~~~~ # 1099| { # 1100| putc (extension_char, rl_outstream); # 1101|-> printed_len++; # 1102| } # 1103| } Error: GCC_ANALYZER_WARNING (CWE-457): [#def189] bash-5.3/lib/readline/complete.c:1105:10: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘printed_len’ bash-5.3/lib/readline/complete.c:3057:1: enter_function: entry to ‘_rl_export_completions’ bash-5.3/lib/readline/complete.c:3061:9: call_function: calling ‘vector_len’ from ‘_rl_export_completions’ bash-5.3/lib/readline/complete.c:3061:9: return_function: returning to ‘_rl_export_completions’ from ‘vector_len’ bash-5.3/lib/readline/complete.c:3068:15: branch_true: following ‘true’ branch... bash-5.3/lib/readline/complete.c:3070:42: branch_true: ...to here bash-5.3/lib/readline/complete.c:3070:7: call_function: calling ‘print_filename’ from ‘_rl_export_completions’ # 1103| } # 1104| # 1105|-> return printed_len; # 1106| } # 1107| Error: COMPILER_WARNING (CWE-569): [#def190] bash-5.3/lib/readline/complete.c: scope_hint: In function ‘_rl_find_completion_word’ bash-5.3/lib/readline/complete.c:1209:14: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 1209 | while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)) # | ^~~~~~~~ # 1207| completion, so use the word break characters to find the # 1208| substring on which to complete. */ # 1209|-> while (rl_point = MB_PREVCHAR (rl_line_buffer, rl_point, MB_FIND_ANY)) # 1210| { # 1211| scan = rl_line_buffer[rl_point]; Error: CPPCHECK_WARNING (CWE-562): [#def191] bash-5.3/lib/readline/complete.c:1337: error[autoVariables]: Address of local auto-variable assigned to a function parameter. # 1335| { # 1336| xfree (matches[i]); # 1337|-> matches[i] = (char *)&dead_slot; # 1338| } # 1339| else Error: COMPILER_WARNING (CWE-457): [#def192] bash-5.3/lib/readline/complete.c: scope_hint: In function ‘rl_complete_internal’ bash-5.3/lib/readline/complete.c:2178:14: warning[-Wmaybe-uninitialized]: ‘tlen’ may be used uninitialized # 2178 | if (mlen >= tlen) # | ^ bash-5.3/lib/readline/complete.c:2077:7: note: ‘tlen’ was declared here # 2077 | int tlen, mlen, saved_last_completion_failed; # | ^~~~ # 2176| { # 2177| mlen = *matches[0] ? strlen (matches[0]) : 0; # 2178|-> if (mlen >= tlen) # 2179| insert_match (matches[0], start, matches[1] ? MULT_MATCH : SINGLE_MATCH, "e_char); # 2180| } Error: COMPILER_WARNING (CWE-569): [#def193] bash-5.3/lib/readline/complete.c: scope_hint: In function ‘rl_completion_matches’ bash-5.3/lib/readline/complete.c:2330:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 2330 | while (string = (*entry_function) (text, matches)) # | ^~~~~~ # 2328| match_list[1] = (char *)NULL; # 2329| # 2330|-> while (string = (*entry_function) (text, matches)) # 2331| { # 2332| if (RL_SIG_RECEIVED ()) Error: COMPILER_WARNING (CWE-569): [#def194] bash-5.3/lib/readline/complete.c: scope_hint: In function ‘rl_username_completion_function’ bash-5.3/lib/readline/complete.c:2399:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 2399 | while (entry = getpwent ()) # | ^~~~~ # 2397| } # 2398| # 2399|-> while (entry = getpwent ()) # 2400| { # 2401| /* Null usernames should result in all users as possible completions. */ Error: COMPILER_WARNING: [#def195] bash-5.3/lib/readline/display.c: scope_hint: In function ‘rl_redisplay’ bash-5.3/lib/readline/display.c:812:29: warning[-Wunused-but-set-variable=]: variable ‘num’ set but not used # 812 | int newlines, lpos, temp, num; # | ^~~ # 810| int in, out, c, linenum, cursor_linenum; # 811| int inv_botlin, lb_botlin, lb_linenum, o_cpos; # 812|-> int newlines, lpos, temp, num; # 813| char *prompt_this_line; # 814| char cur_face; Error: COMPILER_WARNING (CWE-457): [#def196] bash-5.3/lib/readline/display.c: scope_hint: In function ‘rl_redisplay’ bash-5.3/lib/readline/display.c:1489:42: warning[-Wmaybe-uninitialized]: ‘physpos’ may be used uninitialized # 1489 | _rl_last_c_pos = physpos + WRAP_OFFSET (cursor_linenum, wrap_offset); # | ^ bash-5.3/lib/readline/display.c:1474:19: note: ‘physpos’ was declared here # 1474 | int physpos; # | ^~~~~~~ # 1487| for invisible characters. */ # 1488| if ((mb_cur_max == 1 || rl_byte_oriented) && cursor_linenum == prompt_last_screen_line) # 1489|-> _rl_last_c_pos = physpos + WRAP_OFFSET (cursor_linenum, wrap_offset); # 1490| } # 1491| Error: GCC_ANALYZER_WARNING (CWE-404): [#def197] bash-5.3/lib/readline/display.c:3142:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ bash-5.3/lib/readline/display.c:3139:3: acquire_resource: ‘va_start’ called here bash-5.3/lib/readline/display.c:3141:6: branch_true: following ‘true’ branch... bash-5.3/lib/readline/display.c:3142:24: branch_true: ...to here bash-5.3/lib/readline/display.c:3142:15: throw: if ‘xmalloc’ throws an exception... bash-5.3/lib/readline/display.c:3142:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 3140| # 3141| if (msg_buf == 0) # 3142|-> msg_buf = xmalloc (msg_bufsiz = 128); # 3143| # 3144| #if defined (HAVE_VSNPRINTF) Error: COMPILER_WARNING (CWE-1164): [#def198] bash-5.3/lib/readline/display.c: scope_hint: At top level bash-5.3/lib/readline/display.c:3363:1: warning[-Wunused-function]: ‘insert_some_chars’ defined but not used # 3363 | insert_some_chars (char *string, int count, int col) # | ^~~~~~~~~~~~~~~~~ # 3361| /* Insert COUNT characters from STRING to the output stream at column COL. */ # 3362| static void # 3363|-> insert_some_chars (char *string, int count, int col) # 3364| { # 3365| open_some_spaces (col); Error: COMPILER_WARNING (CWE-569): [#def199] bash-5.3/lib/readline/histexpand.c: scope_hint: In function ‘get_history_event’ bash-5.3/lib/readline/histexpand.c:212:25: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 212 | for (local_index = i; c = string[i]; i++) # | ^ # 210| # 211| /* Only a closing `?' or a newline delimit a substring search string. */ # 212|-> for (local_index = i; c = string[i]; i++) # 213| { # 214| #if defined (HANDLE_MULTIBYTE) Error: COMPILER_WARNING (CWE-1164): [#def200] bash-5.3/lib/readline/histfile.c: scope_hint: At top level bash-5.3/lib/readline/histfile.c:142:14: warning[-Wunused-function]: ‘history_backupfile’ declared ‘static’ but never defined # 142 | static char *history_backupfile (const char *); # | ^~~~~~~~~~~~~~~~~~ # 140| #define HIST_TIMESTAMP_START(s) (*(s) == history_comment_char && isdigit ((unsigned char)(s)[1]) ) # 141| # 142|-> static char *history_backupfile (const char *); # 143| static char *history_tempfile (const char *); # 144| static int histfile_backup (const char *, const char *); Error: COMPILER_WARNING (CWE-1164): [#def201] bash-5.3/lib/readline/histfile.c:144:12: warning[-Wunused-function]: ‘histfile_backup’ declared ‘static’ but never defined # 144 | static int histfile_backup (const char *, const char *); # | ^~~~~~~~~~~~~~~ # 142| static char *history_backupfile (const char *); # 143| static char *history_tempfile (const char *); # 144|-> static int histfile_backup (const char *, const char *); # 145| static int histfile_restore (const char *, const char *); # 146| static int history_rename (const char *, const char *); Error: GCC_ANALYZER_WARNING (CWE-401): [#def202] bash-5.3/lib/readline/histfile.c:235:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’ bash-5.3/lib/readline/histfile.c:540:1: enter_function: entry to ‘history_truncate_file’ bash-5.3/lib/readline/histfile.c:551:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:554:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:560:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:572:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:583:23: branch_false: ...to here bash-5.3/lib/readline/histfile.c:586:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:599:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:599:20: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:600:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:608:6: branch_false: ...to here bash-5.3/lib/readline/histfile.c:608:6: branch_true: following ‘true’ branch (when ‘lines == 0’)... bash-5.3/lib/readline/histfile.c:610:7: branch_true: ...to here bash-5.3/lib/readline/histfile.c:670:14: call_function: calling ‘history_tempfile’ from ‘history_truncate_file’ # 233| # 234| len = strlen (fn); # 235|-> ret = xmalloc (len + 11); # 236| strcpy (ret, fn); # 237| Error: GCC_ANALYZER_WARNING (CWE-401): [#def203] bash-5.3/lib/readline/histfile.c:235:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ bash-5.3/lib/readline/histfile.c:540:1: enter_function: entry to ‘history_truncate_file’ bash-5.3/lib/readline/histfile.c:551:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:554:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:560:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:572:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:583:23: branch_false: ...to here bash-5.3/lib/readline/histfile.c:586:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:599:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:599:20: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:600:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:608:6: branch_false: ...to here bash-5.3/lib/readline/histfile.c:608:6: branch_false: following ‘false’ branch (when ‘lines != 0’)... bash-5.3/lib/readline/histfile.c:616:16: branch_false: ...to here bash-5.3/lib/readline/histfile.c:619:6: branch_false: following ‘false’ branch (when ‘chars_read > 0’)... bash-5.3/lib/readline/histfile.c:624:9: branch_false: ...to here bash-5.3/lib/readline/histfile.c:661:6: branch_false: following ‘false’ branch (when ‘bp > buffer’)... bash-5.3/lib/readline/histfile.c:669:1: branch_false: ...to here bash-5.3/lib/readline/histfile.c:670:14: call_function: calling ‘history_tempfile’ from ‘history_truncate_file’ # 233| # 234| len = strlen (fn); # 235|-> ret = xmalloc (len + 11); # 236| strcpy (ret, fn); # 237| Error: GCC_ANALYZER_WARNING (CWE-401): [#def204] bash-5.3/lib/readline/histfile.c:352:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ bash-5.3/lib/readline/histfile.c:287:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:289:3: branch_false: ...to here bash-5.3/lib/readline/histfile.c:292:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:295:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:307:27: branch_false: ...to here bash-5.3/lib/readline/histfile.c:310:11: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:316:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:316:10: branch_false: following ‘false’ branch (when ‘file_size != 0’)... bash-5.3/lib/readline/histfile.c:335:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:335:20: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:336:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:342:16: branch_false: ...to here bash-5.3/lib/readline/histfile.c:344:6: branch_true: following ‘true’ branch (when ‘chars_read < 0’)... bash-5.3/lib/readline/histfile.c:346:3: branch_true: ...to here bash-5.3/lib/readline/histfile.c:351:10: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:352:9: branch_true: ...to here bash-5.3/lib/readline/histfile.c:352:9: throw: if ‘close’ throws an exception... bash-5.3/lib/readline/histfile.c:352:9: danger: ‘buffer’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10) # 350| chars_read = EIO; # 351| if (file >= 0) # 352|-> close (file); # 353| # 354| FREE (input); Error: GCC_ANALYZER_WARNING (CWE-401): [#def205] bash-5.3/lib/readline/histfile.c:362:3: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ bash-5.3/lib/readline/histfile.c:287:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:289:3: branch_false: ...to here bash-5.3/lib/readline/histfile.c:292:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:295:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:307:27: branch_false: ...to here bash-5.3/lib/readline/histfile.c:310:11: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:316:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:316:10: branch_false: following ‘false’ branch (when ‘file_size != 0’)... bash-5.3/lib/readline/histfile.c:335:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:335:20: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:336:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:342:16: branch_false: ...to here bash-5.3/lib/readline/histfile.c:344:6: branch_false: following ‘false’ branch (when ‘chars_read >= 0’)... bash-5.3/lib/readline/histfile.c:362:3: branch_false: ...to here bash-5.3/lib/readline/histfile.c:362:3: throw: if ‘close’ throws an exception... bash-5.3/lib/readline/histfile.c:362:3: danger: ‘buffer’ leaks here; was allocated at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10) # 360| } # 361| # 362|-> close (file); # 363| # 364| /* Set TO to larger than end of file if negative. */ Error: GCC_ANALYZER_WARNING (CWE-401): [#def206] bash-5.3/lib/readline/histfile.c:437:19: warning[-Wanalyzer-malloc-leak]: leak of ‘line_start’ bash-5.3/lib/readline/histfile.c:287:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:289:3: branch_false: ...to here bash-5.3/lib/readline/histfile.c:292:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:295:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:307:27: branch_false: ...to here bash-5.3/lib/readline/histfile.c:310:11: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:316:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:316:10: branch_false: following ‘false’ branch (when ‘file_size != 0’)... bash-5.3/lib/readline/histfile.c:335:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:335:20: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:336:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:342:16: branch_false: ...to here bash-5.3/lib/readline/histfile.c:344:6: branch_false: following ‘false’ branch (when ‘chars_read >= 0’)... bash-5.3/lib/readline/histfile.c:362:3: branch_false: ...to here bash-5.3/lib/readline/histfile.c:365:6: branch_false: following ‘false’ branch (when ‘to >= 0’)... bash-5.3/lib/readline/histfile.c:369:12: branch_false: ...to here bash-5.3/lib/readline/histfile.c:390:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:392:3: branch_false: ...to here bash-5.3/lib/readline/histfile.c:392:40: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:392:40: branch_false: ...to here bash-5.3/lib/readline/histfile.c:417:31: branch_true: following ‘true’ branch (when ‘line_end < bufend’)... bash-5.3/lib/readline/histfile.c:418:9: branch_true: ...to here bash-5.3/lib/readline/histfile.c:418:8: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:421:12: branch_true: ...to here bash-5.3/lib/readline/histfile.c:421:12: branch_false: following ‘false’ branch (when ‘line_start >= line_end’)... bash-5.3/lib/readline/histfile.c:424:11: branch_false: ...to here bash-5.3/lib/readline/histfile.c:426:12: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:426:13: branch_false: ...to here bash-5.3/lib/readline/histfile.c:426:13: branch_true: following ‘true’ branch (when ‘skipblanks == 0’)... bash-5.3/lib/readline/histfile.c:428:17: branch_true: ...to here bash-5.3/lib/readline/histfile.c:436:20: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:437:19: throw: if ‘_hs_append_history_line’ throws an exception... bash-5.3/lib/readline/histfile.c:437:19: danger: ‘line_start’ leaks here; was allocated at [(11)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/10) # 435| skipblanks = default_skipblanks; # 436| if (last_ts == NULL && history_length > 0 && history_multiline_entries) # 437|-> _hs_append_history_line (history_length - 1, line_start); # 438| else # 439| add_history (line_start); Error: GCC_ANALYZER_WARNING (CWE-401): [#def207] bash-5.3/lib/readline/histfile.c:439:19: warning[-Wanalyzer-malloc-leak]: leak of ‘last_ts’ bash-5.3/lib/readline/histfile.c:287:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:289:3: branch_false: ...to here bash-5.3/lib/readline/histfile.c:292:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:295:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:307:27: branch_false: ...to here bash-5.3/lib/readline/histfile.c:310:11: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:316:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:316:10: branch_false: following ‘false’ branch (when ‘file_size != 0’)... bash-5.3/lib/readline/histfile.c:335:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:335:20: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:336:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:342:16: branch_false: ...to here bash-5.3/lib/readline/histfile.c:344:6: branch_false: following ‘false’ branch (when ‘chars_read >= 0’)... bash-5.3/lib/readline/histfile.c:362:3: branch_false: ...to here bash-5.3/lib/readline/histfile.c:365:6: branch_false: following ‘false’ branch (when ‘to >= 0’)... bash-5.3/lib/readline/histfile.c:369:12: branch_false: ...to here bash-5.3/lib/readline/histfile.c:390:6: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:390:6: branch_true: ...to here bash-5.3/lib/readline/histfile.c:392:40: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:393:9: branch_true: ...to here bash-5.3/lib/readline/histfile.c:393:8: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:395:9: branch_true: ...to here bash-5.3/lib/readline/histfile.c:406:12: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:406:12: branch_true: ...to here bash-5.3/lib/readline/histfile.c:408:32: branch_true: following ‘true’ branch (when ‘line_end < bufend’)... bash-5.3/lib/readline/histfile.c:408:53: branch_true: ...to here bash-5.3/lib/readline/histfile.c:408:32: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:410:27: branch_false: ...to here bash-5.3/lib/readline/histfile.c:410:26: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:410:13: branch_true: ...to here bash-5.3/lib/readline/histfile.c:392:40: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:392:40: branch_false: ...to here bash-5.3/lib/readline/histfile.c:417:31: branch_true: following ‘true’ branch (when ‘line_end < bufend’)... bash-5.3/lib/readline/histfile.c:418:9: branch_true: ...to here bash-5.3/lib/readline/histfile.c:418:8: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:421:12: branch_true: ...to here bash-5.3/lib/readline/histfile.c:421:12: branch_false: following ‘false’ branch (when ‘line_start >= line_end’)... bash-5.3/lib/readline/histfile.c:424:11: branch_false: ...to here bash-5.3/lib/readline/histfile.c:426:12: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:426:13: branch_false: ...to here bash-5.3/lib/readline/histfile.c:426:13: branch_true: following ‘true’ branch (when ‘skipblanks == 0’)... bash-5.3/lib/readline/histfile.c:428:17: branch_true: ...to here bash-5.3/lib/readline/histfile.c:436:20: branch_false: following ‘false’ branch (when ‘last_ts’ is non-NULL)... bash-5.3/lib/readline/histfile.c:439:19: branch_false: ...to here bash-5.3/lib/readline/histfile.c:439:19: throw: if ‘add_history’ throws an exception... bash-5.3/lib/readline/histfile.c:439:19: danger: ‘last_ts’ leaks here; was allocated at [(11)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/10) # 437| _hs_append_history_line (history_length - 1, line_start); # 438| else # 439|-> add_history (line_start); # 440| if (last_ts) # 441| { Error: GCC_ANALYZER_WARNING (CWE-401): [#def208] bash-5.3/lib/readline/histfile.c:439:19: warning[-Wanalyzer-malloc-leak]: leak of ‘line_start’ bash-5.3/lib/readline/histfile.c:287:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:289:3: branch_false: ...to here bash-5.3/lib/readline/histfile.c:292:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:295:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:307:27: branch_false: ...to here bash-5.3/lib/readline/histfile.c:310:11: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:316:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:316:10: branch_false: following ‘false’ branch (when ‘file_size != 0’)... bash-5.3/lib/readline/histfile.c:335:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:335:20: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:336:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:342:16: branch_false: ...to here bash-5.3/lib/readline/histfile.c:344:6: branch_false: following ‘false’ branch (when ‘chars_read >= 0’)... bash-5.3/lib/readline/histfile.c:362:3: branch_false: ...to here bash-5.3/lib/readline/histfile.c:365:6: branch_false: following ‘false’ branch (when ‘to >= 0’)... bash-5.3/lib/readline/histfile.c:369:12: branch_false: ...to here bash-5.3/lib/readline/histfile.c:390:6: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:390:6: branch_true: ...to here bash-5.3/lib/readline/histfile.c:392:40: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:392:40: branch_false: ...to here bash-5.3/lib/readline/histfile.c:417:31: branch_true: following ‘true’ branch (when ‘line_end < bufend’)... bash-5.3/lib/readline/histfile.c:418:9: branch_true: ...to here bash-5.3/lib/readline/histfile.c:418:8: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:421:12: branch_true: ...to here bash-5.3/lib/readline/histfile.c:421:12: branch_false: following ‘false’ branch (when ‘line_start >= line_end’)... bash-5.3/lib/readline/histfile.c:424:11: branch_false: ...to here bash-5.3/lib/readline/histfile.c:426:12: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:426:13: branch_false: ...to here bash-5.3/lib/readline/histfile.c:426:13: branch_true: following ‘true’ branch (when ‘skipblanks == 0’)... bash-5.3/lib/readline/histfile.c:428:17: branch_true: ...to here bash-5.3/lib/readline/histfile.c:436:20: branch_false: following ‘false’ branch (when ‘last_ts’ is non-NULL)... bash-5.3/lib/readline/histfile.c:439:19: branch_false: ...to here bash-5.3/lib/readline/histfile.c:439:19: throw: if ‘add_history’ throws an exception... bash-5.3/lib/readline/histfile.c:439:19: danger: ‘line_start’ leaks here; was allocated at [(11)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/10) # 437| _hs_append_history_line (history_length - 1, line_start); # 438| else # 439|-> add_history (line_start); # 440| if (last_ts) # 441| { Error: GCC_ANALYZER_WARNING (CWE-401): [#def209] bash-5.3/lib/readline/histfile.c:442:21: warning[-Wanalyzer-malloc-leak]: leak of ‘last_ts’ bash-5.3/lib/readline/histfile.c:287:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:289:3: branch_false: ...to here bash-5.3/lib/readline/histfile.c:292:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:295:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:307:27: branch_false: ...to here bash-5.3/lib/readline/histfile.c:310:11: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:316:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:316:10: branch_false: following ‘false’ branch (when ‘file_size != 0’)... bash-5.3/lib/readline/histfile.c:335:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:335:20: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:336:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:342:16: branch_false: ...to here bash-5.3/lib/readline/histfile.c:344:6: branch_false: following ‘false’ branch (when ‘chars_read >= 0’)... bash-5.3/lib/readline/histfile.c:362:3: branch_false: ...to here bash-5.3/lib/readline/histfile.c:365:6: branch_false: following ‘false’ branch (when ‘to >= 0’)... bash-5.3/lib/readline/histfile.c:369:12: branch_false: ...to here bash-5.3/lib/readline/histfile.c:390:6: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:390:6: branch_true: ...to here bash-5.3/lib/readline/histfile.c:392:40: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:393:9: branch_true: ...to here bash-5.3/lib/readline/histfile.c:393:8: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:395:9: branch_true: ...to here bash-5.3/lib/readline/histfile.c:406:12: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:406:12: branch_true: ...to here bash-5.3/lib/readline/histfile.c:408:32: branch_true: following ‘true’ branch (when ‘line_end < bufend’)... bash-5.3/lib/readline/histfile.c:408:53: branch_true: ...to here bash-5.3/lib/readline/histfile.c:408:32: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:410:27: branch_false: ...to here bash-5.3/lib/readline/histfile.c:410:26: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:410:13: branch_true: ...to here bash-5.3/lib/readline/histfile.c:392:40: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:392:40: branch_false: ...to here bash-5.3/lib/readline/histfile.c:417:31: branch_true: following ‘true’ branch (when ‘line_end < bufend’)... bash-5.3/lib/readline/histfile.c:418:9: branch_true: ...to here bash-5.3/lib/readline/histfile.c:418:8: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:421:12: branch_true: ...to here bash-5.3/lib/readline/histfile.c:421:12: branch_false: following ‘false’ branch (when ‘line_start >= line_end’)... bash-5.3/lib/readline/histfile.c:424:11: branch_false: ...to here bash-5.3/lib/readline/histfile.c:426:12: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:426:13: branch_false: ...to here bash-5.3/lib/readline/histfile.c:426:13: branch_true: following ‘true’ branch (when ‘skipblanks == 0’)... bash-5.3/lib/readline/histfile.c:428:17: branch_true: ...to here bash-5.3/lib/readline/histfile.c:436:20: branch_false: following ‘false’ branch (when ‘last_ts’ is non-NULL)... bash-5.3/lib/readline/histfile.c:439:19: branch_false: ...to here bash-5.3/lib/readline/histfile.c:440:20: branch_true: following ‘true’ branch (when ‘last_ts’ is non-NULL)... bash-5.3/lib/readline/histfile.c:442:21: branch_true: ...to here bash-5.3/lib/readline/histfile.c:442:21: throw: if ‘add_history_time’ throws an exception... bash-5.3/lib/readline/histfile.c:442:21: danger: ‘last_ts’ leaks here; was allocated at [(11)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/10) # 440| if (last_ts) # 441| { # 442|-> add_history_time (last_ts); # 443| last_ts = NULL; # 444| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def210] bash-5.3/lib/readline/histfile.c:442:21: warning[-Wanalyzer-malloc-leak]: leak of ‘line_start’ bash-5.3/lib/readline/histfile.c:287:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:289:3: branch_false: ...to here bash-5.3/lib/readline/histfile.c:292:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:295:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:307:27: branch_false: ...to here bash-5.3/lib/readline/histfile.c:310:11: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:316:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:316:10: branch_false: following ‘false’ branch (when ‘file_size != 0’)... bash-5.3/lib/readline/histfile.c:335:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:335:20: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:336:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:342:16: branch_false: ...to here bash-5.3/lib/readline/histfile.c:344:6: branch_false: following ‘false’ branch (when ‘chars_read >= 0’)... bash-5.3/lib/readline/histfile.c:362:3: branch_false: ...to here bash-5.3/lib/readline/histfile.c:365:6: branch_false: following ‘false’ branch (when ‘to >= 0’)... bash-5.3/lib/readline/histfile.c:369:12: branch_false: ...to here bash-5.3/lib/readline/histfile.c:390:6: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:390:6: branch_true: ...to here bash-5.3/lib/readline/histfile.c:392:40: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:392:40: branch_false: ...to here bash-5.3/lib/readline/histfile.c:417:31: branch_true: following ‘true’ branch (when ‘line_end < bufend’)... bash-5.3/lib/readline/histfile.c:418:9: branch_true: ...to here bash-5.3/lib/readline/histfile.c:418:8: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:421:12: branch_true: ...to here bash-5.3/lib/readline/histfile.c:421:12: branch_false: following ‘false’ branch (when ‘line_start >= line_end’)... bash-5.3/lib/readline/histfile.c:424:11: branch_false: ...to here bash-5.3/lib/readline/histfile.c:426:12: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:426:13: branch_false: ...to here bash-5.3/lib/readline/histfile.c:426:13: branch_true: following ‘true’ branch (when ‘skipblanks == 0’)... bash-5.3/lib/readline/histfile.c:428:17: branch_true: ...to here bash-5.3/lib/readline/histfile.c:436:20: branch_false: following ‘false’ branch (when ‘last_ts’ is non-NULL)... bash-5.3/lib/readline/histfile.c:439:19: branch_false: ...to here bash-5.3/lib/readline/histfile.c:440:20: branch_true: following ‘true’ branch (when ‘last_ts’ is non-NULL)... bash-5.3/lib/readline/histfile.c:442:21: branch_true: ...to here bash-5.3/lib/readline/histfile.c:442:21: throw: if ‘add_history_time’ throws an exception... bash-5.3/lib/readline/histfile.c:442:21: danger: ‘line_start’ leaks here; was allocated at [(11)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/10) # 440| if (last_ts) # 441| { # 442|-> add_history_time (last_ts); # 443| last_ts = NULL; # 444| } Error: COMPILER_WARNING: [#def211] bash-5.3/lib/readline/histfile.c: scope_hint: In function ‘history_truncate_file’ bash-5.3/lib/readline/histfile.c:543:49: warning[-Wunused-but-set-variable=]: variable ‘r’ set but not used # 543 | int file, chars_read, rv, orig_lines, exists, r; # | ^ # 541| { # 542| char *buffer, *filename, *tempname, *bp, *bp1; /* bp1 == bp+1 */ # 543|-> int file, chars_read, rv, orig_lines, exists, r; # 544| struct stat finfo, nfinfo; # 545| size_t file_size; Error: GCC_ANALYZER_WARNING (CWE-401): [#def212] bash-5.3/lib/readline/histfile.c:610:7: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ bash-5.3/lib/readline/histfile.c:551:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:554:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:560:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:572:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:583:23: branch_false: ...to here bash-5.3/lib/readline/histfile.c:586:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:599:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:599:20: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:600:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:608:6: branch_false: ...to here bash-5.3/lib/readline/histfile.c:608:6: branch_true: following ‘true’ branch (when ‘lines == 0’)... bash-5.3/lib/readline/histfile.c:610:7: branch_true: ...to here bash-5.3/lib/readline/histfile.c:610:7: throw: if ‘close’ throws an exception... bash-5.3/lib/readline/histfile.c:610:7: danger: ‘buffer’ leaks here; was allocated at [(9)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/8) # 608| if (lines == 0) # 609| { # 610|-> close (file); # 611| buffer[chars_read = 0] = '\0'; # 612| bp = buffer; Error: GCC_ANALYZER_WARNING (CWE-401): [#def213] bash-5.3/lib/readline/histfile.c:617:3: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ bash-5.3/lib/readline/histfile.c:551:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:554:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:560:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:572:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:583:23: branch_false: ...to here bash-5.3/lib/readline/histfile.c:586:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:599:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:599:20: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:600:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:608:6: branch_false: ...to here bash-5.3/lib/readline/histfile.c:608:6: branch_false: following ‘false’ branch (when ‘lines != 0’)... bash-5.3/lib/readline/histfile.c:616:16: branch_false: ...to here bash-5.3/lib/readline/histfile.c:617:3: throw: if ‘close’ throws an exception... bash-5.3/lib/readline/histfile.c:617:3: danger: ‘buffer’ leaks here; was allocated at [(9)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/8) # 615| # 616| chars_read = read (file, buffer, file_size); # 617|-> close (file); # 618| # 619| if (chars_read <= 0) Error: GCC_ANALYZER_WARNING (CWE-401): [#def214] bash-5.3/lib/readline/histfile.c:673:15: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’ bash-5.3/lib/readline/histfile.c:551:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:554:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:560:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:572:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:583:23: branch_false: ...to here bash-5.3/lib/readline/histfile.c:586:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:599:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:599:20: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:600:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:608:6: branch_false: ...to here bash-5.3/lib/readline/histfile.c:608:6: branch_true: following ‘true’ branch (when ‘lines == 0’)... bash-5.3/lib/readline/histfile.c:610:7: branch_true: ...to here bash-5.3/lib/readline/histfile.c:673:15: throw: if ‘open’ throws an exception... bash-5.3/lib/readline/histfile.c:673:15: danger: ‘bp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/8) # 671| # 672| rv = 0; # 673|-> if ((file = open (tempname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0600)) != -1) # 674| { # 675| if (write (file, bp, chars_read - (bp - buffer)) < 0) Error: GCC_ANALYZER_WARNING (CWE-401): [#def215] bash-5.3/lib/readline/histfile.c:673:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ bash-5.3/lib/readline/histfile.c:551:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:554:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:560:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:572:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:583:23: branch_false: ...to here bash-5.3/lib/readline/histfile.c:586:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:599:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:599:20: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:600:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:608:6: branch_false: ...to here bash-5.3/lib/readline/histfile.c:608:6: branch_false: following ‘false’ branch (when ‘lines != 0’)... bash-5.3/lib/readline/histfile.c:616:16: branch_false: ...to here bash-5.3/lib/readline/histfile.c:619:6: branch_false: following ‘false’ branch (when ‘chars_read > 0’)... bash-5.3/lib/readline/histfile.c:624:9: branch_false: ...to here bash-5.3/lib/readline/histfile.c:661:6: branch_false: following ‘false’ branch (when ‘bp > buffer’)... bash-5.3/lib/readline/histfile.c:669:1: branch_false: ...to here bash-5.3/lib/readline/histfile.c:673:15: throw: if ‘open’ throws an exception... bash-5.3/lib/readline/histfile.c:673:15: danger: ‘buffer’ leaks here; was allocated at [(9)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/8) # 671| # 672| rv = 0; # 673|-> if ((file = open (tempname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0600)) != -1) # 674| { # 675| if (write (file, bp, chars_read - (bp - buffer)) < 0) Error: GCC_ANALYZER_WARNING (CWE-401): [#def216] bash-5.3/lib/readline/histfile.c:675:11: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’ bash-5.3/lib/readline/histfile.c:551:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:554:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:560:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:572:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:583:23: branch_false: ...to here bash-5.3/lib/readline/histfile.c:586:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:599:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:599:20: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:600:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:608:6: branch_false: ...to here bash-5.3/lib/readline/histfile.c:608:6: branch_true: following ‘true’ branch (when ‘lines == 0’)... bash-5.3/lib/readline/histfile.c:610:7: branch_true: ...to here bash-5.3/lib/readline/histfile.c:673:6: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:675:28: branch_true: ...to here bash-5.3/lib/readline/histfile.c:675:11: throw: if ‘write’ throws an exception... bash-5.3/lib/readline/histfile.c:675:11: danger: ‘bp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/8) # 673| if ((file = open (tempname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0600)) != -1) # 674| { # 675|-> if (write (file, bp, chars_read - (bp - buffer)) < 0) # 676| { # 677| rv = errno; Error: GCC_ANALYZER_WARNING (CWE-401): [#def217] bash-5.3/lib/readline/histfile.c:675:11: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ bash-5.3/lib/readline/histfile.c:551:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:554:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:560:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:572:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:583:23: branch_false: ...to here bash-5.3/lib/readline/histfile.c:586:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:599:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:599:20: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:600:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:608:6: branch_false: ...to here bash-5.3/lib/readline/histfile.c:608:6: branch_false: following ‘false’ branch (when ‘lines != 0’)... bash-5.3/lib/readline/histfile.c:616:16: branch_false: ...to here bash-5.3/lib/readline/histfile.c:619:6: branch_false: following ‘false’ branch (when ‘chars_read > 0’)... bash-5.3/lib/readline/histfile.c:624:9: branch_false: ...to here bash-5.3/lib/readline/histfile.c:661:6: branch_false: following ‘false’ branch (when ‘bp > buffer’)... bash-5.3/lib/readline/histfile.c:669:1: branch_false: ...to here bash-5.3/lib/readline/histfile.c:673:6: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:675:28: branch_true: ...to here bash-5.3/lib/readline/histfile.c:675:11: throw: if ‘write’ throws an exception... bash-5.3/lib/readline/histfile.c:675:11: danger: ‘buffer’ leaks here; was allocated at [(9)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/8) # 673| if ((file = open (tempname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0600)) != -1) # 674| { # 675|-> if (write (file, bp, chars_read - (bp - buffer)) < 0) # 676| { # 677| rv = errno; Error: GCC_ANALYZER_WARNING (CWE-1341): [#def218] bash-5.3/lib/readline/histfile.c:687:22: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘open(history_tempfile(history_filename(fname)), 577, 384)’ bash-5.3/lib/readline/histfile.c:551:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:554:10: branch_false: ...to here bash-5.3/lib/readline/histfile.c:560:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:572:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:583:23: branch_false: ...to here bash-5.3/lib/readline/histfile.c:586:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... bash-5.3/lib/readline/histfile.c:599:20: branch_false: ...to here bash-5.3/lib/readline/histfile.c:600:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:608:6: branch_false: ...to here bash-5.3/lib/readline/histfile.c:673:6: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:675:28: branch_true: ...to here bash-5.3/lib/readline/histfile.c:681:11: branch_true: following ‘true’ branch... bash-5.3/lib/readline/histfile.c:683:16: branch_true: ...to here bash-5.3/lib/readline/histfile.c:684:11: release_resource: first ‘close’ here bash-5.3/lib/readline/histfile.c:687:10: branch_true: following ‘true’ branch (when ‘rv == 0’)... bash-5.3/lib/readline/histfile.c:687:22: branch_true: ...to here bash-5.3/lib/readline/histfile.c:687:22: danger: second ‘close’ here; first ‘close’ was at [(15)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/14) # 685| } # 686| # 687|-> if (rv == 0 && close (file) < 0) # 688| rv = errno; # 689| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def219] bash-5.3/lib/readline/histfile.c:743:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’ bash-5.3/lib/readline/histfile.c:732:8: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:733:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)... bash-5.3/lib/readline/histfile.c:736:12: branch_false: ...to here bash-5.3/lib/readline/histfile.c:743:7: throw: if ‘fflush’ throws an exception... bash-5.3/lib/readline/histfile.c:743:7: danger: ‘fp’ leaks here; was allocated at [(1)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/0) # 741| goto slow_write_error; # 742| } # 743|-> if (fflush (fp) < 0) # 744| { # 745| slow_write_error: Error: GCC_ANALYZER_WARNING (CWE-401): [#def220] bash-5.3/lib/readline/histfile.c:880:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ bash-5.3/lib/readline/histfile.c:785:10: branch_true: following ‘true’ branch (when ‘output’ is non-NULL)... bash-5.3/lib/readline/histfile.c:785:19: branch_true: ...to here bash-5.3/lib/readline/histfile.c:788:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:800:7: branch_false: ...to here bash-5.3/lib/readline/histfile.c:813:59: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:844:22: branch_false: ...to here bash-5.3/lib/readline/histfile.c:844:22: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:845:8: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:860:14: branch_false: ...to here bash-5.3/lib/readline/histfile.c:860:42: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:880:9: branch_false: ...to here bash-5.3/lib/readline/histfile.c:880:9: throw: if ‘write’ throws an exception... bash-5.3/lib/readline/histfile.c:880:9: danger: ‘buffer’ leaks here; was allocated at [(7)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/6) # 878| rv = errno; # 879| #else # 880|-> if (write (file, buffer, buffer_size) < 0) # 881| rv = errno; # 882| xfree (buffer); Error: GCC_ANALYZER_WARNING (CWE-401): [#def221] bash-5.3/lib/readline/histfile.c:882:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ bash-5.3/lib/readline/histfile.c:785:10: branch_true: following ‘true’ branch (when ‘output’ is non-NULL)... bash-5.3/lib/readline/histfile.c:785:19: branch_true: ...to here bash-5.3/lib/readline/histfile.c:788:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:800:7: branch_false: ...to here bash-5.3/lib/readline/histfile.c:813:59: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:844:22: branch_false: ...to here bash-5.3/lib/readline/histfile.c:844:22: acquire_memory: allocated here bash-5.3/lib/readline/histfile.c:845:8: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... bash-5.3/lib/readline/histfile.c:860:14: branch_false: ...to here bash-5.3/lib/readline/histfile.c:860:42: branch_false: following ‘false’ branch... bash-5.3/lib/readline/histfile.c:880:9: branch_false: ...to here bash-5.3/lib/readline/histfile.c:882:5: throw: if ‘xfree’ throws an exception... bash-5.3/lib/readline/histfile.c:882:5: danger: ‘buffer’ leaks here; was allocated at [(7)](sarif:/runs/0/results/18/codeFlows/0/threadFlows/0/locations/6) # 880| if (write (file, buffer, buffer_size) < 0) # 881| rv = errno; # 882|-> xfree (buffer); # 883| #endif # 884| } Error: COMPILER_WARNING (CWE-569): [#def222] bash-5.3/lib/readline/histsearch.c: scope_hint: In function ‘_hs_history_patsearch’ bash-5.3/lib/readline/histsearch.c:258:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 258 | if (unescaped_backslash = (string[ret] == '\\')) # | ^~~~~~~~~~~~~~~~~~~ # 256| /* fnmatch is required to reject a pattern that ends with an unescaped # 257| backslash */ # 258|-> if (unescaped_backslash = (string[ret] == '\\')) # 259| { # 260| while (ret > 0 && string[--ret] == '\\') Error: COMPILER_WARNING (CWE-569): [#def223] bash-5.3/lib/readline/input.c: scope_hint: In function ‘rl_read_key’ bash-5.3/lib/readline/input.c:794:11: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 794 | if (c = _rl_next_macro_key ()) # | ^ # 792| { # 793| /* If input is coming from a macro, then use that. */ # 794|-> if (c = _rl_next_macro_key ()) # 795| return ((unsigned char)c); # 796| Error: COMPILER_WARNING (CWE-563): [#def224] bash-5.3/lib/readline/input.c: scope_hint: In function ‘rl_getc’ bash-5.3/lib/readline/input.c:839:12: warning[-Wunused-variable]: unused variable ‘empty_set’ # 839 | sigset_t empty_set; # | ^~~~~~~~~ # 837| int fd; # 838| #if defined (HAVE_PSELECT) || defined (HAVE_SELECT) # 839|-> sigset_t empty_set; # 840| fd_set readfds; # 841| #endif Error: COMPILER_WARNING: [#def225] bash-5.3/lib/readline/isearch.c: scope_hint: In function ‘rl_search_history’ bash-5.3/lib/readline/isearch.c:912:7: warning[-Wunused-but-set-variable=]: variable ‘c’ set but not used # 912 | int c, r; # | ^ # 910| { # 911| _rl_search_cxt *cxt; /* local for now, but saved globally */ # 912|-> int c, r; # 913| # 914| RL_SETSTATE(RL_STATE_ISEARCH); Error: GCC_ANALYZER_WARNING (CWE-674): [#def226] bash-5.3/lib/readline/kill.c:202:12: warning[-Wanalyzer-infinite-recursion]: infinite recursion bash-5.3/lib/readline/kill.c:197:1: enter_function: entry to ‘rl_kill_word’ bash-5.3/lib/readline/kill.c:202:12: call_function: calling ‘rl_backward_kill_word’ from ‘rl_kill_word’ # 200| # 201| if (count < 0) # 202|-> return (rl_backward_kill_word (-count, key)); # 203| else # 204| { Error: GCC_ANALYZER_WARNING (CWE-674): [#def227] bash-5.3/lib/readline/kill.c:225:12: warning[-Wanalyzer-infinite-recursion]: infinite recursion bash-5.3/lib/readline/kill.c:220:1: enter_function: entry to ‘rl_backward_kill_word’ bash-5.3/lib/readline/kill.c:225:12: call_function: calling ‘rl_kill_word’ from ‘rl_backward_kill_word’ # 223| # 224| if (count < 0) # 225|-> return (rl_kill_word (-count, key)); # 226| else # 227| { Error: GCC_ANALYZER_WARNING (CWE-674): [#def228] bash-5.3/lib/readline/kill.c:494:12: warning[-Wanalyzer-infinite-recursion]: infinite recursion bash-5.3/lib/readline/kill.c:491:1: enter_function: entry to ‘rl_copy_forward_word’ bash-5.3/lib/readline/kill.c:494:12: call_function: calling ‘rl_copy_backward_word’ from ‘rl_copy_forward_word’ # 492| { # 493| if (count < 0) # 494|-> return (rl_copy_backward_word (-count, key)); # 495| # 496| return (_rl_copy_word_as_kill (count, 1)); Error: GCC_ANALYZER_WARNING (CWE-674): [#def229] bash-5.3/lib/readline/kill.c:503:12: warning[-Wanalyzer-infinite-recursion]: infinite recursion bash-5.3/lib/readline/kill.c:500:1: enter_function: entry to ‘rl_copy_backward_word’ bash-5.3/lib/readline/kill.c:503:12: call_function: calling ‘rl_copy_forward_word’ from ‘rl_copy_backward_word’ # 501| { # 502| if (count < 0) # 503|-> return (rl_copy_forward_word (-count, key)); # 504| # 505| return (_rl_copy_word_as_kill (count, -1)); Error: COMPILER_WARNING (CWE-569): [#def230] bash-5.3/lib/readline/misc.c: scope_hint: In function ‘_rl_revert_previous_lines’ bash-5.3/lib/readline/misc.c:491:11: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 491 | if (ul = (UNDO_LIST *)entry->data) # | ^~ # 489| while (entry) # 490| { # 491|-> if (ul = (UNDO_LIST *)entry->data) # 492| { # 493| if (ul == saved_undo_list) Error: COMPILER_WARNING (CWE-569): [#def231] bash-5.3/lib/readline/misc.c: scope_hint: In function ‘rl_clear_history’ bash-5.3/lib/readline/misc.c:551:11: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 551 | if (ul = (UNDO_LIST *)hent->data) # | ^~ # 549| { # 550| hent = hlist[i]; # 551|-> if (ul = (UNDO_LIST *)hent->data) # 552| { # 553| if (ul == saved_undo_list) Error: GCC_ANALYZER_WARNING (CWE-674): [#def232] bash-5.3/lib/readline/misc.c:623:12: warning[-Wanalyzer-infinite-recursion]: infinite recursion bash-5.3/lib/readline/misc.c:618:1: enter_function: entry to ‘rl_get_next_history’ bash-5.3/lib/readline/misc.c:623:12: call_function: calling ‘rl_get_previous_history’ from ‘rl_get_next_history’ # 621| # 622| if (count < 0) # 623|-> return (rl_get_previous_history (-count, key)); # 624| # 625| if (count == 0) Error: COMPILER_WARNING (CWE-1164): [#def233] bash-5.3/lib/readline/nls.c:287:1: warning[-Wunused-function]: ‘find_codeset’ defined but not used # 287 | find_codeset (char *name, size_t *lenp) # | ^~~~~~~~~~~~ # 285| /* Isolate codeset portion of locale specification. */ # 286| static char * # 287|-> find_codeset (char *name, size_t *lenp) # 288| { # 289| char *cp, *language, *result; Error: COMPILER_WARNING: [#def234] bash-5.3/lib/readline/parens.c: scope_hint: In function ‘rl_insert_close’ bash-5.3/lib/readline/parens.c:115:36: warning[-Wunused-but-set-variable=]: variable ‘ready’ set but not used # 115 | int orig_point, match_point, ready; # | ^~~~~ # 113| { # 114| #if defined (HAVE_SELECT) # 115|-> int orig_point, match_point, ready; # 116| struct timeval timer; # 117| fd_set readfds; Error: COMPILER_WARNING (CWE-563): [#def235] bash-5.3/lib/readline/readline.c:76: included_from: Included from here. bash-5.3/lib/readline/parse-colors.h:44:14: warning[-Wunused-variable]: ‘color_buf’ defined but not used # 44 | static char *color_buf; # | ^~~~~~~~~ # 42| # 43| /* Buffer for color sequences */ # 44|-> static char *color_buf; # 45| # 46| #endif /* !_PARSE_COLORS_H_ */ Error: COMPILER_WARNING (CWE-1164): [#def236] bash-5.3/lib/readline/readline.c: scope_hint: At top level bash-5.3/lib/readline/readline.c:99:13: warning[-Wunused-function]: ‘reset_default_bindings’ declared ‘static’ but never defined # 99 | static void reset_default_bindings (void); # | ^~~~~~~~~~~~~~~~~~~~~~ # 97| # 98| static void readline_default_bindings (void); # 99|-> static void reset_default_bindings (void); # 100| # 101| static int _rl_subseq_result (int, Keymap, int, int); Error: COMPILER_WARNING (CWE-563): [#def237] bash-5.3/lib/readline/readline.c:577:21: warning[-Wunused-variable]: unused variable ‘eof_found’ # 577 | static int lastc, eof_found; # | ^~~~~~~~~ # 575| #endif # 576| { # 577|-> static int lastc, eof_found; # 578| int c, code, lk, r; # 579| static procenv_t olevel; Error: COMPILER_WARNING: [#def238] bash-5.3/lib/readline/readline.c: scope_hint: In function ‘readline_internal_char’ bash-5.3/lib/readline/readline.c:578:20: warning[-Wunused-but-set-variable=]: variable ‘r’ set but not used # 578 | int c, code, lk, r; # | ^ # 576| { # 577| static int lastc, eof_found; # 578|-> int c, code, lk, r; # 579| static procenv_t olevel; # 580| Error: COMPILER_WARNING (CWE-563): [#def239] bash-5.3/lib/readline/signals.c: scope_hint: In function ‘rl_set_signals’ bash-5.3/lib/readline/signals.c:422:25: warning[-Wunused-variable]: unused variable ‘oset’ # 422 | static sigset_t bset, oset; # | ^~~~ # 420| #if defined (HAVE_POSIX_SIGNALS) # 421| static int sigmask_set = 0; # 422|-> static sigset_t bset, oset; # 423| #endif # 424| Error: GCC_ANALYZER_WARNING (CWE-457): [#def240] bash-5.3/lib/readline/text.c:101:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘string’ bash-5.3/lib/readline/text.c:2358:1: enter_function: entry to ‘rl_execute_named_command’ bash-5.3/lib/readline/text.c:2364:13: call_function: calling ‘_rl_read_command_name’ from ‘rl_execute_named_command’ # 99| rl_line_buffer[i + l] = rl_line_buffer[i]; # 100| # 101|-> strncpy (rl_line_buffer + rl_point, string, l); # 102| # 103| /* Remember how to undo this if we aren't undoing something. */ Error: COMPILER_WARNING: [#def241] bash-5.3/lib/readline/text.c: scope_hint: In function ‘rl_insert_text’ bash-5.3/lib/readline/text.c:101:3: warning[-Wstringop-truncation]: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length # 101 | strncpy (rl_line_buffer + rl_point, string, l); # | ^ bash-5.3/lib/readline/text.c:91:29: note: length computed here # 91 | l = (string && *string) ? strlen (string) : 0; # | ^~~~~~~~~~~~~~~ # 99| rl_line_buffer[i + l] = rl_line_buffer[i]; # 100| # 101|-> strncpy (rl_line_buffer + rl_point, string, l); # 102| # 103| /* Remember how to undo this if we aren't undoing something. */ Error: GCC_ANALYZER_WARNING (CWE-674): [#def242] bash-5.3/lib/readline/text.c:397:12: warning[-Wanalyzer-infinite-recursion]: infinite recursion bash-5.3/lib/readline/text.c:394:1: enter_function: entry to ‘rl_backward_byte’ bash-5.3/lib/readline/text.c:397:12: call_function: calling ‘rl_forward_byte’ from ‘rl_backward_byte’ # 395| { # 396| if (count < 0) # 397|-> return (rl_forward_byte (-count, key)); # 398| # 399| if (count > 0) Error: COMPILER_WARNING: [#def243] bash-5.3/lib/readline/text.c: scope_hint: In function ‘rl_insert’ bash-5.3/lib/readline/text.c:987:13: warning[-Wunused-but-set-variable=]: variable ‘x’ set but not used # 987 | int r, n, x; # | ^ # 985| rl_insert (int count, int c) # 986| { # 987|-> int r, n, x; # 988| # 989| r = (rl_insert_mode == RL_IM_INSERT) ? _rl_insert_char (count, c) : _rl_overwrite_char (count, c); Error: COMPILER_WARNING (CWE-569): [#def244] bash-5.3/lib/readline/tilde.c:188:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 188 | if (result = strchr (string, '~')) # | ^~~~~~ # 186| # 187| result_index = result_size = 0; # 188|-> if (result = strchr (string, '~')) # 189| result = (char *)xmalloc (result_size = (strlen (string) + 16)); # 190| else Error: COMPILER_WARNING (CWE-704): [#def245] bash-5.3/lib/readline/tilde.c: scope_hint: In function ‘tilde_expand’ bash-5.3/lib/readline/tilde.c:188:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 188 | if (result = strchr (string, '~')) # | ^ # 186| # 187| result_index = result_size = 0; # 188|-> if (result = strchr (string, '~')) # 189| result = (char *)xmalloc (result_size = (strlen (string) + 16)); # 190| else Error: COMPILER_WARNING (CWE-704): [#def246] bash-5.3/lib/readline/tilde.c:188:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 186| # 187| result_index = result_size = 0; # 188|-> if (result = strchr (string, '~')) # 189| result = (char *)xmalloc (result_size = (strlen (string) + 16)); # 190| else Error: CPPCHECK_WARNING (CWE-457): [#def247] bash-5.3/lib/readline/undo.c:156: warning[uninitvar]: Uninitialized variable: roving # 154| else # 155| { # 156|-> roving->next = c; # 157| roving = roving->next; # 158| } Error: GCC_ANALYZER_WARNING (CWE-404): [#def248] bash-5.3/lib/readline/util.c:243:3: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ bash-5.3/lib/readline/util.c:238:3: acquire_resource: ‘va_start’ called here bash-5.3/lib/readline/util.c:243:3: throw: if ‘fflush’ throws an exception... bash-5.3/lib/readline/util.c:243:3: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 241| vfprintf (stderr, format, args); # 242| fprintf (stderr, "\n"); # 243|-> fflush (stderr); # 244| # 245| va_end (args); Error: GCC_ANALYZER_WARNING (CWE-404): [#def249] bash-5.3/lib/readline/util.c:260:3: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ bash-5.3/lib/readline/util.c:255:3: acquire_resource: ‘va_start’ called here bash-5.3/lib/readline/util.c:260:3: throw: if ‘fflush’ throws an exception... bash-5.3/lib/readline/util.c:260:3: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) # 258| vfprintf (stderr, format, args); # 259| fprintf (stderr, "\n"); # 260|-> fflush (stderr); # 261| # 262| va_end (args); Error: GCC_ANALYZER_WARNING (CWE-775): [#def250] bash-5.3/lib/readline/util.c:541:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ bash-5.3/lib/readline/util.c:534:8: acquire_resource: socket created here bash-5.3/lib/readline/util.c:535:6: branch_false: following ‘false’ branch (when ‘fd >= 0’)... bash-5.3/lib/readline/util.c:537:10: branch_false: ...to here bash-5.3/lib/readline/util.c:539:6: branch_true: following ‘true’ branch... bash-5.3/lib/readline/util.c:541:7: branch_true: ...to here bash-5.3/lib/readline/util.c:541:7: throw: if ‘close’ throws an exception... bash-5.3/lib/readline/util.c:541:7: danger: ‘fd’ leaks here # 539| if (NLMSG_SPACE (size) > MAX_AUDIT_MESSAGE_LENGTH) # 540| { # 541|-> close (fd); # 542| return; # 543| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def251] bash-5.3/lib/readline/util.c:558:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ bash-5.3/lib/readline/util.c:534:8: acquire_resource: socket created here bash-5.3/lib/readline/util.c:535:6: branch_false: following ‘false’ branch (when ‘fd >= 0’)... bash-5.3/lib/readline/util.c:537:10: branch_false: ...to here bash-5.3/lib/readline/util.c:539:6: branch_false: following ‘false’ branch... bash-5.3/lib/readline/util.c:545:3: branch_false: ...to here bash-5.3/lib/readline/util.c:558:3: throw: if ‘sendto’ throws an exception... bash-5.3/lib/readline/util.c:558:3: danger: ‘fd’ leaks here # 556| addr.nl_groups = 0; # 557| # 558|-> sendto (fd, &req, req.nlh.nlmsg_len, 0, (struct sockaddr*)&addr, sizeof(addr)); # 559| close (fd); # 560| } Error: COMPILER_WARNING: [#def252] bash-5.3/lib/readline/vi_mode.c: scope_hint: In function ‘rl_vi_fword’ bash-5.3/lib/readline/vi_mode.c:625:7: warning[-Wunused-but-set-variable=]: variable ‘opoint’ set but not used # 625 | int opoint; # | ^~~~~~ # 623| rl_vi_fword (int count, int ignore) # 624| { # 625|-> int opoint; # 626| # 627| while (count-- && rl_point < (rl_end - 1)) Error: COMPILER_WARNING: [#def253] bash-5.3/lib/readline/vi_mode.c: scope_hint: In function ‘rl_vi_change_char’ bash-5.3/lib/readline/vi_mode.c:2125:7: warning[-Wstringop-truncation]: ‘strncpy’ output may be truncated copying 16 bytes from a string of length 16 # 2125 | strncpy (mb, _rl_vi_last_replacement, MB_LEN_MAX); # | ^ # 2123| if (_rl_vi_redoing) # 2124| { # 2125|-> strncpy (mb, _rl_vi_last_replacement, MB_LEN_MAX); # 2126| c = (unsigned char)_rl_vi_last_replacement[0]; /* XXX */ # 2127| mb[MB_LEN_MAX] = '\0'; Error: COMPILER_WARNING (CWE-563): [#def254] bash-5.3/lib/sh/anonfile.c: scope_hint: In function ‘anonopen’ bash-5.3/lib/sh/anonfile.c:76:9: warning[-Wunused-variable]: unused variable ‘fname’ # 76 | char *fname; # | ^~~~~ # 74| { # 75| int fd, flag; # 76|-> char *fname; # 77| # 78| #if defined (HAVE_MEMFD_CREATE) Error: COMPILER_WARNING (CWE-1164): [#def255] bash-5.3/lib/sh/anonfile.c: scope_hint: At top level bash-5.3/lib/sh/anonfile.c:114:1: warning[-Wunused-function]: ‘anonunlink’ defined but not used # 114 | anonunlink (const char *fn) # | ^~~~~~~~~~ # 112| # 113| static int # 114|-> anonunlink (const char *fn) # 115| { # 116| int r; Error: COMPILER_WARNING (CWE-563): [#def256] bash-5.3/lib/sh/casemod.c: scope_hint: In function ‘sh_modcase’ bash-5.3/lib/sh/casemod.c:102:15: warning[-Wunused-variable]: unused variable ‘c’ # 102 | int inword, c, nc, nop, match, usewords; # | ^ # 100| { # 101| int start, next, end, retind; # 102|-> int inword, c, nc, nop, match, usewords; # 103| char *ret, *s; # 104| wchar_t wc; Error: COMPILER_WARNING (CWE-1164): [#def257] bash-5.3/lib/sh/eaccess.c:171:1: warning[-Wunused-function]: ‘sh_euidaccess’ defined but not used # 171 | sh_euidaccess (const char *path, int mode) # | ^~~~~~~~~~~~~ # 169| the effective and real uid and gid as appropriate. */ # 170| static int # 171|-> sh_euidaccess (const char *path, int mode) # 172| { # 173| int r, e; Error: COMPILER_WARNING (CWE-563): [#def258] bash-5.3/lib/sh/fnxform.c:49:14: warning[-Wunused-variable]: ‘outbuf’ defined but not used # 49 | static char *outbuf = 0; # | ^~~~~~ # 47| #define OUTLEN_MAX 4096 # 48| # 49|-> static char *outbuf = 0; # 50| static size_t outlen = 0; # 51| Error: COMPILER_WARNING (CWE-563): [#def259] bash-5.3/lib/sh/fnxform.c:50:15: warning[-Wunused-variable]: ‘outlen’ defined but not used # 50 | static size_t outlen = 0; # | ^~~~~~ # 48| # 49| static char *outbuf = 0; # 50|-> static size_t outlen = 0; # 51| # 52| static char *curencoding (void); Error: COMPILER_WARNING (CWE-1164): [#def260] bash-5.3/lib/sh/fnxform.c:80:1: warning[-Wunused-function]: ‘init_tofs’ defined but not used # 80 | init_tofs (void) # | ^~~~~~~~~ # 78| # 79| static void # 80|-> init_tofs (void) # 81| { # 82| char *cur; Error: COMPILER_WARNING (CWE-1164): [#def261] bash-5.3/lib/sh/fnxform.c:89:1: warning[-Wunused-function]: ‘init_fromfs’ defined but not used # 89 | init_fromfs (void) # | ^~~~~~~~~~~ # 87| # 88| static void # 89|-> init_fromfs (void) # 90| { # 91| char *cur; Error: COMPILER_WARNING: [#def262] bash-5.3/lib/sh/getenv.c: scope_hint: In function ‘getenv’ bash-5.3/lib/sh/getenv.c:54:6: warning[-Wnonnull-compare]: ‘nonnull’ argument ‘name’ compared to NULL # 54 | if (name == 0 || *name == '\0') # | ^ # 52| SHELL_VAR *var; # 53| # 54|-> if (name == 0 || *name == '\0') # 55| return ((char *)NULL); # 56| Error: COMPILER_WARNING: [#def263] bash-5.3/lib/sh/getenv.c: scope_hint: In function ‘putenv’ bash-5.3/lib/sh/getenv.c:106:6: warning[-Wnonnull-compare]: ‘nonnull’ argument ‘str’ compared to NULL # 106 | if (str == 0 || *str == '\0') # | ^ # 104| int offset; # 105| # 106|-> if (str == 0 || *str == '\0') # 107| { # 108| errno = EINVAL; Error: COMPILER_WARNING: [#def264] bash-5.3/lib/sh/getenv.c: scope_hint: In function ‘unsetenv’ bash-5.3/lib/sh/getenv.c:189:6: warning[-Wnonnull-compare]: ‘nonnull’ argument ‘name’ compared to NULL # 189 | if (name == 0 || *name == '\0' || strchr (name, '=') != 0) # | ^ # 187| unsetenv (const char *name) # 188| { # 189|-> if (name == 0 || *name == '\0' || strchr (name, '=') != 0) # 190| { # 191| errno = EINVAL; Error: GCC_ANALYZER_WARNING (CWE-401): [#def265] bash-5.3/lib/sh/mailstat.c:129:20: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(&dir)’ bash-5.3/lib/sh/mailstat.c:68:6: branch_false: following ‘false’ branch... bash-5.3/lib/sh/mailstat.c:71:6: branch_false: following ‘false’ branch... bash-5.3/lib/sh/mailstat.c:81:3: branch_false: ...to here bash-5.3/lib/sh/mailstat.c:94:6: branch_false: following ‘false’ branch... bash-5.3/lib/sh/mailstat.c:100:6: branch_false: following ‘false’ branch... bash-5.3/lib/sh/mailstat.c:106:6: branch_false: following ‘false’ branch... bash-5.3/lib/sh/mailstat.c:122:15: branch_true: following ‘true’ branch (when ‘i != 2’)... bash-5.3/lib/sh/mailstat.c:124:7: branch_true: ...to here bash-5.3/lib/sh/mailstat.c:124:7: branch_false: following ‘false’ branch (when ‘i == 0’)... bash-5.3/lib/sh/mailstat.c:124:7: branch_false: ...to here bash-5.3/lib/sh/mailstat.c:127:17: acquire_memory: allocated here bash-5.3/lib/sh/mailstat.c:127:10: branch_false: following ‘false’ branch... bash-5.3/lib/sh/mailstat.c:127:10: branch_false: ...to here bash-5.3/lib/sh/mailstat.c:129:20: throw: if ‘readdir’ throws an exception... bash-5.3/lib/sh/mailstat.c:129:20: danger: ‘opendir(&dir)’ leaks here; was allocated at [(15)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/14) # 127| if ((dd = opendir(dir)) == NULL) # 128| return 0; # 129|-> while ((fn = readdir(dd)) != NULL) # 130| { # 131| if (fn->d_name[0] == '.' || strlen(fn->d_name) + l >= sizeof(file)) Error: COMPILER_WARNING (CWE-569): [#def266] bash-5.3/lib/sh/makepath.c: scope_hint: In function ‘sh_makepath’ bash-5.3/lib/sh/makepath.c:117:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 117 | while (*r++ = *s++) # | ^ # 115| *r++ = '/'; # 116| s = xdir; # 117|-> while (*r++ = *s++) # 118| ; # 119| if (xpath != path && xpath != nullpath) Error: COMPILER_WARNING (CWE-704): [#def267] bash-5.3/lib/sh/mbschr.c: scope_hint: In function ‘mbschr’ bash-5.3/lib/sh/mbschr.c:84:11: warning[-Wdiscarded-qualifiers]: return discards ‘const’ qualifier from pointer target type # 84 | return (strchr (s, c)); # | ^~~~~~ # 82| else # 83| #endif # 84|-> return (strchr (s, c)); # 85| } Error: COMPILER_WARNING (CWE-704): [#def268] bash-5.3/lib/sh/mbschr.c:84:11: warning[-Wdiscarded-qualifiers]: return discards ‘const’ qualifier from pointer target type # 82| else # 83| #endif # 84|-> return (strchr (s, c)); # 85| } Error: GCC_ANALYZER_WARNING (CWE-457): [#def269] bash-5.3/lib/sh/netopen.c:228:14: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘<unknown>’ bash-5.3/lib/sh/netopen.c:221:6: branch_false: following ‘false’ branch... bash-5.3/lib/sh/netopen.c:231:8: branch_false: ...to here bash-5.3/lib/sh/netopen.c:231:20: branch_false: following ‘false’ branch (when ‘res’ is NULL)... bash-5.3/lib/sh/netopen.c:228:14: branch_false: ...to here bash-5.3/lib/sh/netopen.c:228:14: danger: use of uninitialized value ‘<unknown>’ here # 226| internal_error ("%s: %s", host, gai_strerror (gerr)); # 227| errno = EINVAL; # 228|-> return -1; # 229| } # 230| Error: GCC_ANALYZER_WARNING (CWE-775): [#def270] bash-5.3/lib/sh/netopen.c:241:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘s’ bash-5.3/lib/sh/netopen.c:221:6: branch_false: following ‘false’ branch... bash-5.3/lib/sh/netopen.c:231:8: branch_false: ...to here bash-5.3/lib/sh/netopen.c:231:20: branch_true: following ‘true’ branch (when ‘res’ is non-NULL)... bash-5.3/lib/sh/netopen.c:233:16: branch_true: ...to here bash-5.3/lib/sh/netopen.c:233:16: acquire_resource: socket created here bash-5.3/lib/sh/netopen.c:233:10: branch_false: following ‘false’ branch (when ‘s >= 0’)... bash-5.3/lib/sh/netopen.c:241:11: branch_false: ...to here bash-5.3/lib/sh/netopen.c:241:11: throw: if ‘connect’ throws an exception... bash-5.3/lib/sh/netopen.c:241:11: danger: ‘s’ leaks here # 239| return -1; # 240| } # 241|-> if (connect (s, res->ai_addr, res->ai_addrlen) < 0) # 242| { # 243| if (res->ai_next) Error: CPPCHECK_WARNING (CWE-457): [#def271] bash-5.3/lib/sh/netopen.c:258: warning[uninitvar]: Uninitialized variable: s # 256| break; # 257| } # 258|-> return s; # 259| } # 260| #endif /* HAVE_GETADDRINFO */ Error: COMPILER_WARNING (CWE-569): [#def272] bash-5.3/lib/sh/pathcanon.c: scope_hint: In function ‘sh_canonpath’ bash-5.3/lib/sh/pathcanon.c:113:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 113 | if (rooted = ROOTEDPATH(path)) # | ^~~~~~ # 111| /* POSIX.2 says to leave a leading `//' alone. On cygwin, we skip over any # 112| leading `x:' (dos drive name). */ # 113|-> if (rooted = ROOTEDPATH(path)) # 114| { # 115| stub_char = DIRSEP; Error: COMPILER_WARNING (CWE-1164): [#def273] bash-5.3/lib/sh/random.c:141:1: warning[-Wunused-function]: ‘brand32’ defined but not used # 141 | brand32 (void) # | ^~~~~~~ # 139| /* Returns a 32-bit pseudo-random number between 0 and 4294967295. */ # 140| static u_bits32_t # 141|-> brand32 (void) # 142| { # 143| u_bits32_t ret; Error: COMPILER_WARNING (CWE-563): [#def274] bash-5.3/lib/sh/random.c: scope_hint: In function ‘brand32’ bash-5.3/lib/sh/random.c:143:14: warning[-Wunused-variable]: unused variable ‘ret’ # 143 | u_bits32_t ret; # | ^~~ # 141| brand32 (void) # 142| { # 143|-> u_bits32_t ret; # 144| # 145| rseed32 = intrand32 (rseed32); Error: COMPILER_WARNING (CWE-1164): [#def275] bash-5.3/lib/sh/random.c: scope_hint: At top level bash-5.3/lib/sh/random.c:165:1: warning[-Wunused-function]: ‘perturb_rand32’ defined but not used # 165 | perturb_rand32 (void) # | ^~~~~~~~~~~~~~ # 163| # 164| static void # 165|-> perturb_rand32 (void) # 166| { # 167| rseed32 ^= genseed (); Error: COMPILER_WARNING (CWE-563): [#def276] bash-5.3/lib/sh/setlinebuf.c:33:14: warning[-Wunused-variable]: ‘stdoutbuf’ defined but not used # 33 | static char *stdoutbuf = 0; # | ^~~~~~~~~ # 31| #endif # 32| # 33|-> static char *stdoutbuf = 0; # 34| static char *stderrbuf = 0; # 35| Error: COMPILER_WARNING (CWE-563): [#def277] bash-5.3/lib/sh/setlinebuf.c:34:14: warning[-Wunused-variable]: ‘stderrbuf’ defined but not used # 34 | static char *stderrbuf = 0; # | ^~~~~~~~~ # 32| # 33| static char *stdoutbuf = 0; # 34|-> static char *stderrbuf = 0; # 35| # 36| /* Cause STREAM to buffer lines as opposed to characters or blocks. */ Error: COMPILER_WARNING (CWE-569): [#def278] bash-5.3/lib/sh/shmatch.c: scope_hint: In function ‘sh_regmatch’ bash-5.3/lib/sh/shmatch.c:86:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 86 | if (reg_err = regcomp (®ex, pattern, rflags)) # | ^~~~~~~ # 84| #endif # 85| # 86|-> if (reg_err = regcomp (®ex, pattern, rflags)) # 87| { # 88| if (errbuf) Error: GCC_ANALYZER_WARNING (CWE-401): [#def279] bash-5.3/lib/sh/shmatch.c:100:7: warning[-Wanalyzer-malloc-leak]: leak of ‘matches’ bash-5.3/lib/sh/shmatch.c:86:6: branch_false: following ‘false’ branch... bash-5.3/lib/sh/shmatch.c:94:58: branch_false: ...to here bash-5.3/lib/sh/shmatch.c:94:27: acquire_memory: allocated here bash-5.3/lib/sh/shmatch.c:100:7: branch_true: following ‘true’ branch (when ‘matches’ is non-NULL)... bash-5.3/lib/sh/shmatch.c:100:7: branch_true: ...to here bash-5.3/lib/sh/shmatch.c:100:7: throw: if ‘regexec’ throws an exception... bash-5.3/lib/sh/shmatch.c:100:7: danger: ‘matches’ leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2) # 98| # 99| /* man regexec: NULL PMATCH ignored if NMATCH == 0 */ # 100|-> if (regexec (®ex, string, matches ? regex.re_nsub + 1 : 0, matches, 0)) # 101| /* XXX - catch errors and fill in *errbuf here? */ # 102| result = EXECUTION_FAILURE; Error: GCC_ANALYZER_WARNING (CWE-401): [#def280] bash-5.3/lib/sh/shmatch.c:118:13: warning[-Wanalyzer-malloc-leak]: leak of ‘subexp_str’ bash-5.3/lib/sh/shmatch.c:86:6: branch_false: following ‘false’ branch... bash-5.3/lib/sh/shmatch.c:94:58: branch_false: ...to here bash-5.3/lib/sh/shmatch.c:108:16: acquire_memory: allocated here bash-5.3/lib/sh/shmatch.c:118:13: throw: if ‘builtin_find_indexed_array’ throws an exception... bash-5.3/lib/sh/shmatch.c:118:13: danger: ‘subexp_str’ leaks here; was allocated at [(3)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/2) # 116| rematch = make_new_array_variable ("BASH_REMATCH"); # 117| #else # 118|-> rematch = builtin_find_indexed_array ("BASH_REMATCH", 1); # 119| #endif # 120| amatch = rematch ? array_cell (rematch) : (ARRAY *)0; Error: GCC_ANALYZER_WARNING (CWE-401): [#def281] bash-5.3/lib/sh/shmatch.c:129:11: warning[-Wanalyzer-malloc-leak]: leak of ‘subexp_str’ bash-5.3/lib/sh/shmatch.c:86:6: branch_false: following ‘false’ branch... bash-5.3/lib/sh/shmatch.c:94:58: branch_false: ...to here bash-5.3/lib/sh/shmatch.c:108:16: acquire_memory: allocated here bash-5.3/lib/sh/shmatch.c:120:12: branch_true: following ‘true’ branch... bash-5.3/lib/sh/shmatch.c:120:3: branch_true: ...to here bash-5.3/lib/sh/shmatch.c:122:6: branch_true: following ‘true’ branch... bash-5.3/lib/sh/shmatch.c:122:7: branch_true: following ‘true’ branch... bash-5.3/lib/sh/shmatch.c:122:7: branch_true: ...to here bash-5.3/lib/sh/shmatch.c:124:28: branch_true: following ‘true’ branch... bash-5.3/lib/sh/shmatch.c:126:11: branch_true: ...to here bash-5.3/lib/sh/shmatch.c:129:11: throw: if ‘array_insert’ throws an exception... bash-5.3/lib/sh/shmatch.c:129:11: danger: ‘subexp_str’ leaks here; was allocated at [(3)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/2) # 127| strncpy (subexp_str, string + matches[subexp_ind].rm_so, # 128| matches[subexp_ind].rm_eo - matches[subexp_ind].rm_so); # 129|-> array_insert (amatch, subexp_ind, subexp_str); # 130| } # 131| } Error: GCC_ANALYZER_WARNING (CWE-457): [#def282] bash-5.3/lib/sh/spell.c:78:37: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘newname[1]’ bash-5.3/lib/sh/spell.c:185:1: enter_function: entry to ‘dirspell’ bash-5.3/lib/sh/spell.c:192:6: branch_false: following ‘false’ branch (when ‘guess’ is non-NULL)... bash-5.3/lib/sh/spell.c:195:11: branch_false: ...to here bash-5.3/lib/sh/spell.c:195:11: call_function: calling ‘spname’ from ‘dirspell’ # 76| { # 77| /* `.' is rarely the right thing. */ # 78|-> if (oldname[1] == '\0' && newname[1] == '\0' && # 79| oldname[0] != '.' && newname[0] == '.') # 80| return -1; Error: COMPILER_WARNING (CWE-569): [#def283] bash-5.3/lib/sh/spell.c: scope_hint: In function ‘spname’ bash-5.3/lib/sh/spell.c:96:22: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 96 | for (p = best; *np = *p++; np++) # | ^ # 94| * Add to end of newname # 95| */ # 96|-> for (p = best; *np = *p++; np++) # 97| ; # 98| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def284] bash-5.3/lib/sh/spell.c:118:16: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dir)’ bash-5.3/lib/sh/spell.c:115:13: acquire_memory: allocated here bash-5.3/lib/sh/spell.c:115:6: branch_false: following ‘false’ branch... bash-5.3/lib/sh/spell.c:115:6: branch_false: ...to here bash-5.3/lib/sh/spell.c:118:16: throw: if ‘readdir’ throws an exception... bash-5.3/lib/sh/spell.c:118:16: danger: ‘opendir(dir)’ leaks here; was allocated at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) # 116| return dist; # 117| # 118|-> while ((dp = readdir(fd)) != NULL) # 119| { # 120| /* Error: GCC_ANALYZER_WARNING (CWE-476): [#def285] bash-5.3/lib/sh/stringlist.c:126:9: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ bash-5.3/lib/sh/stringlist.c:114:1: enter_function: entry to ‘strlist_copy’ bash-5.3/lib/sh/stringlist.c:119:6: branch_false: following ‘false’ branch (when ‘sl’ is non-NULL)... bash-5.3/lib/sh/stringlist.c:121:9: branch_false: ...to here bash-5.3/lib/sh/stringlist.c:121:9: call_function: calling ‘strlist_create’ from ‘strlist_copy’ bash-5.3/lib/sh/stringlist.c:121:9: return_function: returning to ‘strlist_copy’ from ‘strlist_create’ bash-5.3/lib/sh/stringlist.c:123:6: branch_true: following ‘true’ branch... bash-5.3/lib/sh/stringlist.c:123:6: branch_true: ...to here bash-5.3/lib/sh/stringlist.c:125:19: branch_true: following ‘true’ branch... bash-5.3/lib/sh/stringlist.c:126:24: branch_true: ...to here bash-5.3/lib/sh/stringlist.c:126:24: branch_false: following ‘false’ branch... bash-5.3/lib/sh/stringlist.c:126:9: branch_false: ...to here bash-5.3/lib/sh/stringlist.c:126:9: release_memory: using NULL here bash-5.3/lib/sh/stringlist.c:126:9: danger: dereference of NULL ‘*<unknown>.list + (long unsigned int)i * 8’ # 124| { # 125| for (i = 0; i < sl->list_size; i++) # 126|-> new->list[i] = STRDUP (sl->list[i]); # 127| } # 128| new->list_size = sl->list_size; Error: GCC_ANALYZER_WARNING (CWE-476): [#def286] bash-5.3/lib/sh/stringlist.c:149:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ bash-5.3/lib/sh/stringlist.c:139:1: enter_function: entry to ‘strlist_merge’ bash-5.3/lib/sh/stringlist.c:147:8: call_function: calling ‘strlist_create’ from ‘strlist_merge’ bash-5.3/lib/sh/stringlist.c:147:8: return_function: returning to ‘strlist_merge’ from ‘strlist_create’ bash-5.3/lib/sh/stringlist.c:148:19: branch_true: following ‘true’ branch (when ‘i < l1’)... bash-5.3/lib/sh/stringlist.c:149:19: branch_true: ...to here bash-5.3/lib/sh/stringlist.c:149:19: branch_false: following ‘false’ branch... bash-5.3/lib/sh/stringlist.c:149:5: branch_false: ...to here bash-5.3/lib/sh/stringlist.c:149:5: release_memory: using NULL here bash-5.3/lib/sh/stringlist.c:149:5: danger: dereference of NULL ‘*<unknown>.list + i * 8’ # 147| sl = strlist_create (l1 + l2 + 1); # 148| for (i = n = 0; i < l1; i++, n++) # 149|-> sl->list[n] = STRDUP (m1->list[i]); # 150| for (i = 0; i < l2; i++, n++) # 151| sl->list[n] = STRDUP (m2->list[i]); Error: GCC_ANALYZER_WARNING (CWE-476): [#def287] bash-5.3/lib/sh/stringlist.c:151:5: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ bash-5.3/lib/sh/stringlist.c:139:1: enter_function: entry to ‘strlist_merge’ bash-5.3/lib/sh/stringlist.c:147:8: call_function: calling ‘strlist_create’ from ‘strlist_merge’ bash-5.3/lib/sh/stringlist.c:147:8: return_function: returning to ‘strlist_merge’ from ‘strlist_create’ bash-5.3/lib/sh/stringlist.c:148:19: branch_false: following ‘false’ branch (when ‘i >= l1’)... bash-5.3/lib/sh/stringlist.c:148:19: branch_false: ...to here bash-5.3/lib/sh/stringlist.c:150:15: branch_true: following ‘true’ branch (when ‘i < l2’)... bash-5.3/lib/sh/stringlist.c:151:19: branch_true: ...to here bash-5.3/lib/sh/stringlist.c:151:19: branch_false: following ‘false’ branch... bash-5.3/lib/sh/stringlist.c:151:5: branch_false: ...to here bash-5.3/lib/sh/stringlist.c:151:5: release_memory: using NULL here bash-5.3/lib/sh/stringlist.c:151:5: danger: dereference of NULL ‘*<unknown>.list + n * 8’ # 149| sl->list[n] = STRDUP (m1->list[i]); # 150| for (i = 0; i < l2; i++, n++) # 151|-> sl->list[n] = STRDUP (m2->list[i]); # 152| sl->list_len = n; # 153| sl->list[n] = (char *)NULL; Error: GCC_ANALYZER_WARNING (CWE-476): [#def288] bash-5.3/lib/sh/stringlist.c:153:3: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’ bash-5.3/lib/sh/stringlist.c:139:1: enter_function: entry to ‘strlist_merge’ bash-5.3/lib/sh/stringlist.c:147:8: call_function: calling ‘strlist_create’ from ‘strlist_merge’ bash-5.3/lib/sh/stringlist.c:147:8: return_function: returning to ‘strlist_merge’ from ‘strlist_create’ bash-5.3/lib/sh/stringlist.c:148:19: branch_false: following ‘false’ branch (when ‘i >= l1’)... bash-5.3/lib/sh/stringlist.c:148:19: branch_false: ...to here bash-5.3/lib/sh/stringlist.c:150:15: branch_false: following ‘false’ branch (when ‘i >= l2’)... bash-5.3/lib/sh/stringlist.c:152:3: branch_false: ...to here bash-5.3/lib/sh/stringlist.c:153:3: release_memory: using NULL here bash-5.3/lib/sh/stringlist.c:153:3: danger: dereference of NULL ‘*<unknown>.list + n * 8’ # 151| sl->list[n] = STRDUP (m2->list[i]); # 152| sl->list_len = n; # 153|-> sl->list[n] = (char *)NULL; # 154| return (sl); # 155| } Error: COMPILER_WARNING (CWE-569): [#def289] bash-5.3/lib/sh/strtrans.c: scope_hint: In function ‘ansic_quote’ bash-5.3/lib/sh/strtrans.c:250:17: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 250 | for (s = str; c = *s; s++) # | ^ # 248| *r++ = '\''; # 249| # 250|-> for (s = str; c = *s; s++) # 251| { # 252| switch (c) Error: COMPILER_WARNING (CWE-569): [#def290] bash-5.3/lib/sh/strtrans.c: scope_hint: In function ‘ansic_wshouldquote’ bash-5.3/lib/sh/strtrans.c:327:21: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 327 | for (wcs = wcstr; wcc = *wcs; wcs++) # | ^~~ # 325| mbstowcs (wcstr, string, slen + 1); # 326| # 327|-> for (wcs = wcstr; wcc = *wcs; wcs++) # 328| if (iswprint(wcc) == 0) # 329| { Error: COMPILER_WARNING (CWE-569): [#def291] bash-5.3/lib/sh/strtrans.c: scope_hint: In function ‘ansic_shouldquote’ bash-5.3/lib/sh/strtrans.c:349:20: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 349 | for (s = string; c = *s; s++) # | ^ # 347| return 0; # 348| # 349|-> for (s = string; c = *s; s++) # 350| { # 351| #if defined (HANDLE_MULTIBYTE) Error: COMPILER_WARNING (CWE-563): [#def292] bash-5.3/lib/sh/strvis.c: scope_hint: In function ‘sh_strvis’ bash-5.3/lib/sh/strvis.c:120:17: warning[-Wunused-variable]: unused variable ‘c’ # 120 | unsigned char c; # | ^ # 118| char *ret; # 119| size_t retind, retsize; # 120|-> unsigned char c; # 121| DECLARE_MBSTATE; # 122| Error: COMPILER_WARNING (CWE-563): [#def293] bash-5.3/lib/sh/timers.c: scope_hint: In function ‘shtimer_select’ bash-5.3/lib/sh/timers.c:189:26: warning[-Wunused-variable]: unused variable ‘prevmask’ # 189 | sigset_t blocked_sigs, prevmask; # | ^~~~~~~~ # 187| { # 188| int r, nfd; # 189|-> sigset_t blocked_sigs, prevmask; # 190| struct timeval now, tv; # 191| fd_set readfds; Error: COMPILER_WARNING (CWE-563): [#def294] bash-5.3/lib/sh/tmpfile.c:67:12: warning[-Wunused-variable]: ‘ntmpfiles’ defined but not used # 67 | static int ntmpfiles; # | ^~~~~~~~~ # 65| # 66| static char *sys_tmpdir = (char *)NULL; # 67|-> static int ntmpfiles; # 68| static int tmpnamelen = -1; # 69| static unsigned long filenum = 1L; Error: COMPILER_WARNING (CWE-563): [#def295] bash-5.3/lib/sh/tmpfile.c:69:22: warning[-Wunused-variable]: ‘filenum’ defined but not used # 69 | static unsigned long filenum = 1L; # | ^~~~~~~ # 67| static int ntmpfiles; # 68| static int tmpnamelen = -1; # 69|-> static unsigned long filenum = 1L; # 70| # 71| static char * Error: COMPILER_WARNING (CWE-1164): [#def296] bash-5.3/lib/sh/tmpfile.c: scope_hint: At top level bash-5.3/lib/sh/tmpfile.c:123:1: warning[-Wunused-function]: ‘sh_seedrand’ defined but not used # 123 | sh_seedrand (void) # | ^~~~~~~~~~~ # 121| # 122| static void # 123|-> sh_seedrand (void) # 124| { # 125| #if HAVE_RANDOM Error: COMPILER_WARNING (CWE-563): [#def297] bash-5.3/lib/sh/tmpfile.c:153:15: warning[-Wunused-variable]: unused variable ‘sb’ # 153 | struct stat sb; # | ^~ # 151| char *filename, *tdir; # 152| const char *lroot; # 153|-> struct stat sb; # 154| int r, tdlen; # 155| static int seeded = 0; Error: COMPILER_WARNING (CWE-563): [#def298] bash-5.3/lib/sh/tmpfile.c:154:7: warning[-Wunused-variable]: unused variable ‘r’ # 154 | int r, tdlen; # | ^ # 152| const char *lroot; # 153| struct stat sb; # 154|-> int r, tdlen; # 155| static int seeded = 0; # 156| Error: COMPILER_WARNING: [#def299] bash-5.3/lib/sh/tmpfile.c:154:10: warning[-Wunused-but-set-variable=]: variable ‘tdlen’ set but not used # 154 | int r, tdlen; # | ^~~~~ # 152| const char *lroot; # 153| struct stat sb; # 154|-> int r, tdlen; # 155| static int seeded = 0; # 156| Error: COMPILER_WARNING (CWE-563): [#def300] bash-5.3/lib/sh/tmpfile.c: scope_hint: In function ‘sh_mktmpname’ bash-5.3/lib/sh/tmpfile.c:155:14: warning[-Wunused-variable]: unused variable ‘seeded’ # 155 | static int seeded = 0; # | ^~~~~~ # 153| struct stat sb; # 154| int r, tdlen; # 155|-> static int seeded = 0; # 156| # 157| filename = (char *)xmalloc (PATH_MAX + 1); Error: COMPILER_WARNING: [#def301] bash-5.3/lib/sh/tmpfile.c: scope_hint: In function ‘sh_mktmpfd’ bash-5.3/lib/sh/tmpfile.c:215:11: warning[-Wunused-but-set-variable=]: variable ‘tdlen’ set but not used # 215 | int fd, tdlen; # | ^~~~~ # 213| char *filename, *tdir; # 214| const char *lroot; # 215|-> int fd, tdlen; # 216| # 217| filename = (char *)xmalloc (PATH_MAX + 1); Error: COMPILER_WARNING (CWE-563): [#def302] bash-5.3/lib/sh/tmpfile.c:312:7: warning[-Wunused-variable]: unused variable ‘fd’ # 312 | int fd; # | ^~ # 310| { # 311| char *filename; # 312|-> int fd; # 313| #ifdef USE_MKDTEMP # 314| char *tdir, *dirname; Error: COMPILER_WARNING: [#def303] bash-5.3/lib/sh/tmpfile.c: scope_hint: In function ‘sh_mktmpdir’ bash-5.3/lib/sh/tmpfile.c:316:7: warning[-Wunused-but-set-variable=]: variable ‘tdlen’ set but not used # 316 | int tdlen; # | ^~~~~ # 314| char *tdir, *dirname; # 315| const char *lroot; # 316|-> int tdlen; # 317| # 318| filename = (char *)xmalloc (PATH_MAX + 1); Error: COMPILER_WARNING (CWE-1164): [#def304] bash-5.3/lib/sh/ufuncs.c:111:1: warning[-Wunused-function]: ‘ssleep’ defined but not used # 111 | ssleep (unsigned int sec, unsigned int usec) # | ^~~~~~ # 109| #if defined (HAVE_TIMEVAL) && (defined (HAVE_SELECT) || defined (HAVE_PSELECT)) # 110| static int # 111|-> ssleep (unsigned int sec, unsigned int usec) # 112| { # 113| int e, r; Error: COMPILER_WARNING (CWE-1164): [#def305] bash-5.3/lib/sh/unicode.c:74:1: warning[-Wunused-function]: ‘stub_charset’ defined but not used # 74 | stub_charset (void) # | ^~~~~~~~~~~~ # 72| # 73| static char * # 74|-> stub_charset (void) # 75| { # 76| char *locale, *s, *t; Error: COMPILER_WARNING (CWE-704): [#def306] bash-5.3/lib/sh/utf8.c: scope_hint: In function ‘utf8_mbschr’ bash-5.3/lib/sh/utf8.c:38:10: warning[-Wdiscarded-qualifiers]: return discards ‘const’ qualifier from pointer target type # 38 | return strchr (s, c); /* for now */ # | ^~~~~~ # 36| utf8_mbschr (const char *s, int c) # 37| { # 38|-> return strchr (s, c); /* for now */ # 39| } # 40| Error: COMPILER_WARNING (CWE-704): [#def307] bash-5.3/lib/sh/utf8.c:38:10: warning[-Wdiscarded-qualifiers]: return discards ‘const’ qualifier from pointer target type # 36| utf8_mbschr (const char *s, int c) # 37| { # 38|-> return strchr (s, c); /* for now */ # 39| } # 40| Error: GCC_ANALYZER_WARNING (CWE-476): [#def308] bash-5.3/lib/sh/zgetline.c:110:7: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘line’ bash-5.3/lib/sh/zgetline.c:70:6: branch_false: following ‘false’ branch... bash-5.3/lib/sh/zgetline.c:70:34: branch_false: ...to here bash-5.3/lib/sh/zgetline.c:70:7: branch_true: following ‘true’ branch... bash-5.3/lib/sh/zgetline.c:70:51: branch_true: ...to here bash-5.3/lib/sh/zgetline.c:70:33: branch_false: following ‘false’ branch... bash-5.3/lib/sh/zgetline.c:70:33: branch_false: ...to here bash-5.3/lib/sh/zgetline.c:80:10: branch_false: following ‘false’ branch (when ‘retval > 0’)... bash-5.3/lib/sh/zgetline.c:87:11: branch_false: ...to here bash-5.3/lib/sh/zgetline.c:87:10: branch_false: following ‘false’ branch... bash-5.3/lib/sh/zgetline.c:110:11: branch_false: ...to here bash-5.3/lib/sh/zgetline.c:110:7: danger: dereference of NULL ‘line + (sizetype)nr’ # 108| } # 109| # 110|-> line[nr] = c; # 111| nr++; # 112| Error: COMPILER_WARNING (CWE-569): [#def309] bash-5.3/lib/tilde/tilde.c:188:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 188 | if (result = strchr (string, '~')) # | ^~~~~~ # 186| # 187| result_index = result_size = 0; # 188|-> if (result = strchr (string, '~')) # 189| result = (char *)xmalloc (result_size = (strlen (string) + 16)); # 190| else Error: COMPILER_WARNING (CWE-704): [#def310] bash-5.3/lib/tilde/tilde.c: scope_hint: In function ‘tilde_expand’ bash-5.3/lib/tilde/tilde.c:188:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 188 | if (result = strchr (string, '~')) # | ^ # 186| # 187| result_index = result_size = 0; # 188|-> if (result = strchr (string, '~')) # 189| result = (char *)xmalloc (result_size = (strlen (string) + 16)); # 190| else Error: COMPILER_WARNING (CWE-704): [#def311] bash-5.3/lib/tilde/tilde.c:188:14: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 186| # 187| result_index = result_size = 0; # 188|-> if (result = strchr (string, '~')) # 189| result = (char *)xmalloc (result_size = (strlen (string) + 16)); # 190| else Error: CPPCHECK_WARNING (CWE-457): [#def312] bash-5.3/locale.c:416: error[uninitvar]: Uninitialized variable: retval # 414| u32reset (); # 415| #endif # 416|-> return retval; # 417| } # 418| Error: COMPILER_WARNING (CWE-563): [#def313] bash-5.3/locale.c: scope_hint: In function ‘locale_isutf8’ bash-5.3/locale.c:620:14: warning[-Wunused-variable]: unused variable ‘encoding’ # 620 | char *cp, *encoding; # | ^~~~~~~~ # 618| const char *cp; # 619| #else # 620|-> char *cp, *encoding; # 621| #endif # 622| Error: COMPILER_WARNING (CWE-569): [#def314] bash-5.3/mailcheck.c: scope_hint: In function ‘remember_mail_dates’ bash-5.3/mailcheck.c:392:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 392 | while (mailfile = extract_colon_unit (mailpaths, &i)) # | ^~~~~~~~ # 390| } # 391| # 392|-> while (mailfile = extract_colon_unit (mailpaths, &i)) # 393| { # 394| mp = parse_mailpath_spec (mailfile); Error: COMPILER_WARNING (CWE-569): [#def315] bash-5.3/mailcheck.c: scope_hint: In function ‘check_mail’ bash-5.3/mailcheck.c:464:15: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 464 | if (temp = expand_string_to_string (message, Q_DOUBLE_QUOTES)) # | ^~~~ # 462| #undef mtime # 463| # 464|-> if (temp = expand_string_to_string (message, Q_DOUBLE_QUOTES)) # 465| { # 466| puts (temp); Error: COMPILER_WARNING (CWE-569): [#def316] bash-5.3/make_cmd.c: scope_hint: In function ‘make_here_document’ bash-5.3/make_cmd.c:571:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 571 | while (full_line = read_secondary_line (delim_unquoted)) # | ^~~~~~~~~ # 569| be read verbatim from the input. If it was not quoted, we # 570| need to perform backslash-quoted newline removal. */ # 571|-> while (full_line = read_secondary_line (delim_unquoted)) # 572| { # 573| register char *line; Error: COMPILER_WARNING (CWE-563): [#def317] bash-5.3/parse.y:317:12: warning[-Wunused-variable]: ‘save_simple_lineno’ defined but not used # 317 | static int save_simple_lineno = -1; # | ^~~~~~~~~~~~~~~~~~ # 315| # 316| static int simplecmd_lineno = -1; # 317|-> static int save_simple_lineno = -1; # 318| # 319| /* The line number in a script on which a function definition starts. */ Error: COMPILER_WARNING (CWE-563): [#def318] bash-5.3/parse.y:325:12: warning[-Wunused-variable]: ‘save_bstart’ defined but not used # 325 | static int save_bstart = -1; # | ^~~~~~~~~~~ # 323| /* The line number in a script on which a function body starts. */ # 324| static int function_bstart; # 325|-> static int save_bstart = -1; # 326| # 327| /* The line number in a script at which an arithmetic for command starts. */ Error: COMPILER_WARNING (CWE-563): [#def319] bash-5.3/parse.y:371:14: warning[-Wunused-variable]: ‘yyoutstream’ defined but not used # 371 | static FILE *yyoutstream; # | ^~~~~~~~~~~ # 369| static REDIRECTEE redir; # 370| # 371|-> static FILE *yyoutstream; # 372| static FILE *yyerrstream; # 373| %} Error: COMPILER_WARNING (CWE-563): [#def320] bash-5.3/parse.y:372:14: warning[-Wunused-variable]: ‘yyerrstream’ defined but not used # 372 | static FILE *yyerrstream; # | ^~~~~~~~~~~ # 370| # 371| static FILE *yyoutstream; # 372|-> static FILE *yyerrstream; # 373| %} # 374| Error: COMPILER_WARNING: [#def321] bash-5.3/parse.y: scope_hint: In function ‘parse_matched_pair’ bash-5.3/parse.y:3879:18: warning[-Wunused-but-set-variable=]: variable ‘prevch’ set but not used # 3879 | int count, ch, prevch, tflags, start_lineno; # | ^~~~~~ # 3877| parse_matched_pair (int qc, int open, int close, size_t *lenp, int flags) # 3878| { # 3879|-> int count, ch, prevch, tflags, start_lineno; # 3880| size_t nestlen, ttranslen; # 3881| char *ret, *nestret, *ttrans; Error: COMPILER_WARNING: [#def322] bash-5.3/parse.y: scope_hint: In function ‘parse_comsub’ bash-5.3/parse.y:4455:7: warning[-Wunused-but-set-variable=]: variable ‘start_lineno’ set but not used # 4455 | int start_lineno, save_lineno; # | ^~~~~~~~~~~~ # 4453| int peekc, r; # 4454| int dolbrace_spec, local_extglob, was_extpat; # 4455|-> int start_lineno, save_lineno; # 4456| int was_word, was_newline, was_semi, was_amp; # 4457| char *ret, *tcmd; Error: COMPILER_WARNING (CWE-457): [#def323] bash-5.3/parse.y:4571:19: warning[-Wmaybe-uninitialized]: ‘local_extglob’ may be used uninitialized # 4571 | extended_glob = local_extglob; # | ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~ bash-5.3/parse.y:4454:22: note: ‘local_extglob’ was declared here # 4454 | int dolbrace_spec, local_extglob, was_extpat; # | ^~~~~~~~~~~~~ # 4569| #if defined (EXTENDED_GLOB) # 4570| if (shell_compatibility_level <= 51 && was_extpat == 0) # 4571|-> extended_glob = local_extglob; # 4572| #endif # 4573| Error: COMPILER_WARNING (CWE-457): [#def324] bash-5.3/parse.y: scope_hint: In function ‘parse_comsub’ bash-5.3/parse.y:4659:14: warning[-Wmaybe-uninitialized]: ‘dolbrace_spec’ may be used uninitialized # 4659 | ret[0] = (dolbrace_spec == '|') ? '|' : ' '; # | ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bash-5.3/parse.y:4454:7: note: ‘dolbrace_spec’ was declared here # 4454 | int dolbrace_spec, local_extglob, was_extpat; # | ^~~~~~~~~~~~~ # 4657| retlen++; # 4658| ret = xmalloc (retlen + 4); # 4659|-> ret[0] = (dolbrace_spec == '|') ? '|' : ' '; # 4660| strcpy (ret + 1, tcmd); /* ( */ # 4661| if (was_newline) Error: COMPILER_WARNING: [#def325] bash-5.3/parse.y: scope_hint: In function ‘xparse_dolparen’ bash-5.3/parse.y:4690:10: warning[-Wunused-but-set-variable=]: variable ‘orig_ind’ set but not used # 4690 | size_t orig_ind; # | ^~~~~~~~ # 4688| sh_parser_state_t ps; # 4689| sh_input_line_state_t ls; # 4690|-> size_t orig_ind; # 4691| int nc, sflags, start_lineno, local_extglob, funsub, closer; # 4692| int save_lineno; Error: COMPILER_WARNING: [#def326] bash-5.3/parse.y: scope_hint: In function ‘parse_dparen’ bash-5.3/parse.y:4904:15: warning[-Wunused-but-set-variable=]: variable ‘sline’ set but not used # 4904 | int cmdtyp, sline; # | ^~~~~ # 4902| parse_dparen (int c) # 4903| { # 4904|-> int cmdtyp, sline; # 4905| char *wval; # 4906| WORD_DESC *wd; Error: COMPILER_WARNING: [#def327] bash-5.3/parse.y: scope_hint: In function ‘parse_arith_cmd’ bash-5.3/parse.y:4966:7: warning[-Wunused-but-set-variable=]: variable ‘exp_lineno’ set but not used # 4966 | int exp_lineno, rval, c; # | ^~~~~~~~~~ # 4964| parse_arith_cmd (char **ep, int adddq) # 4965| { # 4966|-> int exp_lineno, rval, c; # 4967| char *ttok, *tokstr; # 4968| size_t ttoklen; Error: COMPILER_WARNING (CWE-569): [#def328] bash-5.3/parse.y: scope_hint: In function ‘cond_error’ bash-5.3/parse.y:5022:11: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 5022 | if (etext = error_token_from_token (cond_token)) # | ^~~~~ # 5020| else if (cond_token != COND_ERROR) # 5021| { # 5022|-> if (etext = error_token_from_token (cond_token)) # 5023| { # 5024| parser_error (cond_lineno, _("syntax error in conditional expression: unexpected token `%s'"), etext); Error: COMPILER_WARNING (CWE-569): [#def329] bash-5.3/parse.y: scope_hint: In function ‘cond_term’ bash-5.3/parse.y:5104:15: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 5104 | if (etext = error_token_from_token (cond_token)) # | ^~~~~ # 5102| if (term) # 5103| dispose_cond_node (term); /* ( */ # 5104|-> if (etext = error_token_from_token (cond_token)) # 5105| { # 5106| parser_error (lineno, _("unexpected token `%s', expected `)'"), etext); Error: COMPILER_WARNING (CWE-569): [#def330] bash-5.3/parse.y:5138:15: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 5138 | if (etext = error_token_from_token (tok)) # | ^~~~~ # 5136| { # 5137| dispose_word (op); # 5138|-> if (etext = error_token_from_token (tok)) # 5139| { # 5140| parser_error (line_number, _("unexpected argument `%s' to conditional unary operator"), etext); Error: COMPILER_WARNING (CWE-569): [#def331] bash-5.3/parse.y:5189:15: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 5189 | if (etext = error_token_from_token (tok)) # | ^~~~~ # 5187| else # 5188| { # 5189|-> if (etext = error_token_from_token (tok)) # 5190| { # 5191| parser_error (line_number, _("unexpected token `%s', conditional binary operator expected"), etext); Error: COMPILER_WARNING (CWE-569): [#def332] bash-5.3/parse.y:5222:15: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 5222 | if (etext = error_token_from_token (tok)) # | ^~~~~ # 5220| else # 5221| { # 5222|-> if (etext = error_token_from_token (tok)) # 5223| { # 5224| parser_error (line_number, _("unexpected argument `%s' to conditional binary operator"), etext); Error: COMPILER_WARNING (CWE-569): [#def333] bash-5.3/parse.y:5240:16: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 5240 | else if (etext = error_token_from_token (tok)) # | ^~~~~ # 5238| if (tok < 256) # 5239| parser_error (line_number, _("unexpected token `%c' in conditional command"), tok); # 5240|-> else if (etext = error_token_from_token (tok)) # 5241| { # 5242| parser_error (line_number, _("unexpected token `%s' in conditional command"), etext); Error: COMPILER_WARNING (CWE-569): [#def334] bash-5.3/parse.y: scope_hint: In function ‘decode_prompt_string’ bash-5.3/parse.y:6293:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 6293 | while (c = *string++) # | ^ # 6291| decoding_prompt = string; # 6292| # 6293|-> while (c = *string++) # 6294| { # 6295| if (posixly_correct && c == '!') Error: COMPILER_WARNING (CWE-569): [#def335] bash-5.3/parse.y: scope_hint: In function ‘error_token_from_token’ bash-5.3/parse.y:6738:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 6738 | if (t = find_token_in_alist (tok, word_token_alist, 0)) # | ^ # 6736| char *t; # 6737| # 6738|-> if (t = find_token_in_alist (tok, word_token_alist, 0)) # 6739| return t; # 6740| Error: COMPILER_WARNING (CWE-569): [#def336] bash-5.3/parse.y:6741:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 6741 | if (t = find_token_in_alist (tok, other_token_alist, 0)) # | ^ # 6739| return t; # 6740| # 6741|-> if (t = find_token_in_alist (tok, other_token_alist, 0)) # 6742| return t; # 6743| Error: COMPILER_WARNING (CWE-1164): [#def337] bash-5.3/parse.y: scope_hint: At top level bash-5.3/parse.y:6927:1: warning[-Wunused-function]: ‘discard_parser_constructs’ defined but not used # 6927 | discard_parser_constructs (int error_p) # | ^~~~~~~~~~~~~~~~~~~~~~~~~ # 6925| (dispose_command () will actually free the command.) */ # 6926| static void # 6927|-> discard_parser_constructs (int error_p) # 6928| { # 6929| } Error: COMPILER_WARNING (CWE-569): [#def338] bash-5.3/parse.y: scope_hint: In function ‘parse_string_to_word_list’ bash-5.3/parse.y:7032:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 7032 | if (ea = expanding_alias ()) # | ^~ # 7030| # 7031| push_stream (1); # 7032|-> if (ea = expanding_alias ()) # 7033| parser_save_alias (); # 7034| Error: COMPILER_WARNING (CWE-569): [#def339] bash-5.3/pathexp.c: scope_hint: In function ‘unquoted_glob_pattern_p’ bash-5.3/pathexp.c:77:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 77 | while (c = *string++) # | ^ # 75| send = string + strlen (string); # 76| # 77|-> while (c = *string++) # 78| { # 79| switch (c) Error: COMPILER_WARNING (CWE-563): [#def340] bash-5.3/pathexp.c: scope_hint: In function ‘shell_glob_filename’ bash-5.3/pathexp.c:445:15: warning[-Wunused-variable]: unused variable ‘quoted_pattern’ # 445 | int gflags, quoted_pattern; # | ^~~~~~~~~~~~~~ # 443| { # 444| char *temp, **results; # 445|-> int gflags, quoted_pattern; # 446| # 447| noglob_dot_filenames = glob_dot_filenames == 0; Error: COMPILER_WARNING (CWE-704): [#def341] bash-5.3/pathexp.c: scope_hint: In function ‘glob_name_is_acceptable’ bash-5.3/pathexp.c:536:5: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 536 | n = strrchr (name, '/'); # | ^ # 534| /* . and .. are never matched. We extend this to the terminal component of a # 535| pathname. */ # 536|-> n = strrchr (name, '/'); # 537| if (n == 0 || n[1] == 0) # 538| n = (char *)name; Error: COMPILER_WARNING (CWE-704): [#def342] bash-5.3/pathexp.c:536:5: warning[-Wdiscarded-qualifiers]: assignment discards ‘const’ qualifier from pointer target type # 534| /* . and .. are never matched. We extend this to the terminal component of a # 535| pathname. */ # 536|-> n = strrchr (name, '/'); # 537| if (n == 0 || n[1] == 0) # 538| n = (char *)name; Error: COMPILER_WARNING (CWE-569): [#def343] bash-5.3/pathexp.c: scope_hint: In function ‘setup_ignore_patterns’ bash-5.3/pathexp.c:664:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 664 | while (colon_bit = split_ignorespec (this_ignoreval, &ptr)) # | ^~~~~~~~~ # 662| numitems = maxitems = ptr = 0; # 663| # 664|-> while (colon_bit = split_ignorespec (this_ignoreval, &ptr)) # 665| { # 666| if (numitems + 1 >= maxitems) Error: COMPILER_WARNING (CWE-563): [#def344] bash-5.3/pathexp.c: scope_hint: In function ‘gs_checknum’ bash-5.3/pathexp.c:820:12: warning[-Wunused-variable]: unused variable ‘i’ # 820 | intmax_t i; # | ^ # 818| { # 819| int v; # 820|-> intmax_t i; # 821| # 822| v = all_digits (string); Error: COMPILER_WARNING (CWE-563): [#def345] bash-5.3/pathexp.c: scope_hint: In function ‘globsort_numericcmp’ bash-5.3/pathexp.c:832:15: warning[-Wunused-variable]: unused variable ‘x’ # 832 | int v1, v2, x; # | ^ # 830| { # 831| intmax_t i1, i2; # 832|-> int v1, v2, x; # 833| # 834| /* like valid_number but doesn't allow leading/trailing whitespace or sign */ Error: GCC_ANALYZER_WARNING (CWE-457): [#def346] bash-5.3/pathexp.c:913:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘sortfunc’ bash-5.3/pathexp.c:892:3: branch_false: following ‘false’ branch... bash-5.3/pathexp.c:908:5: branch_false: ...to here bash-5.3/pathexp.c:913:3: danger: use of uninitialized value ‘sortfunc’ here # 911| } # 912| # 913|-> qsort (garray, len, sizeof (struct globsort_t), sortfunc); # 914| } # 915| Error: COMPILER_WARNING (CWE-457): [#def347] bash-5.3/pathexp.c:913:3: warning[-Wmaybe-uninitialized]: ‘sortfunc’ may be used uninitialized # 913 | qsort (garray, len, sizeof (struct globsort_t), sortfunc); # | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ bash-5.3/pathexp.c: scope_hint: In function ‘sh_sortglob’ bash-5.3/pathexp.c:888:11: note: ‘sortfunc’ was declared here # 888 | QSFUNC *sortfunc; # | ^~~~~~~~ # 911| } # 912| # 913|-> qsort (garray, len, sizeof (struct globsort_t), sortfunc); # 914| } # 915| Error: COMPILER_WARNING: [#def348] bash-5.3/print_cmd.c: scope_hint: In function ‘make_command_string_internal’ bash-5.3/print_cmd.c:181:14: warning[-Wformat-zero-length]: zero-length gnu_printf format string # 181 | cprintf (""); # | ^~ # 179| # 180| if (command == 0) # 181|-> cprintf (""); # 182| else # 183| { Error: COMPILER_WARNING: [#def349] bash-5.3/print_cmd.c: scope_hint: In function ‘print_simple_command’ bash-5.3/print_cmd.c:1007:14: warning[-Wformat-zero-length]: zero-length gnu_printf format string # 1007 | cprintf (""); # | ^~ # 1005| command_print_word_list (simple_command->words, " "); # 1006| else # 1007|-> cprintf (""); # 1008| # 1009| if (simple_command->redirects) Error: COMPILER_WARNING (CWE-1164): [#def350] bash-5.3/print_cmd.c: scope_hint: At top level bash-5.3/print_cmd.c:1018:1: warning[-Wunused-function]: ‘print_heredocs’ defined but not used # 1018 | print_heredocs (REDIRECT *heredocs) # | ^~~~~~~~~~~~~~ # 1016| # 1017| static void # 1018|-> print_heredocs (REDIRECT *heredocs) # 1019| { # 1020| REDIRECT *hdtail; Error: GCC_ANALYZER_WARNING (CWE-404): [#def351] bash-5.3/print_cmd.c:1586:24: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ bash-5.3/print_cmd.c:1541:3: acquire_resource: ‘va_start’ called here bash-5.3/print_cmd.c:1548:10: branch_true: following ‘true’ branch... bash-5.3/print_cmd.c:1550:12: branch_true: ...to here bash-5.3/print_cmd.c:1552:10: branch_false: following ‘false’ branch... bash-5.3/print_cmd.c:1580:18: branch_false: following ‘false’ branch (when ‘digit_arg >= 0’)... bash-5.3/print_cmd.c:1586:24: branch_false: ...to here bash-5.3/print_cmd.c:1586:24: throw: if ‘inttostr’ throws an exception... bash-5.3/print_cmd.c:1586:24: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 1584| } # 1585| else # 1586|-> argp = inttostr (digit_arg, intbuf, sizeof (intbuf)); # 1587| arg_len = strlen (argp); # 1588| break; Error: GCC_ANALYZER_WARNING (CWE-404): [#def352] bash-5.3/print_cmd.c:1597:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ bash-5.3/print_cmd.c:1541:3: acquire_resource: ‘va_start’ called here bash-5.3/print_cmd.c:1548:10: branch_true: following ‘true’ branch... bash-5.3/print_cmd.c:1550:12: branch_true: ...to here bash-5.3/print_cmd.c:1552:10: branch_false: following ‘false’ branch... bash-5.3/print_cmd.c:1597:15: throw: if ‘programming_error’ throws an exception... bash-5.3/print_cmd.c:1597:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/0) # 1595| # 1596| default: # 1597|-> programming_error (_("cprintf: `%c': invalid format character"), c); # 1598| /*NOTREACHED*/ # 1599| } Error: GCC_ANALYZER_WARNING (CWE-404): [#def353] bash-5.3/print_cmd.c:1623:37: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ bash-5.3/print_cmd.c:1533:1: enter_function: entry to ‘cprintf’ bash-5.3/print_cmd.c:1541:3: acquire_resource: ‘va_start’ called here bash-5.3/print_cmd.c:1544:3: call_function: calling ‘the_printed_command_resize’ from ‘cprintf’ # 1621| { # 1622| the_printed_command_size = (length + PRINTED_COMMAND_INITIAL_SIZE - 1) & ~(PRINTED_COMMAND_INITIAL_SIZE - 1); # 1623|-> the_printed_command = (char *)xmalloc (the_printed_command_size); # 1624| command_string_index = 0; # 1625| } Error: GCC_ANALYZER_WARNING (CWE-404): [#def354] bash-5.3/print_cmd.c:1635:37: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ bash-5.3/print_cmd.c:1533:1: enter_function: entry to ‘cprintf’ bash-5.3/print_cmd.c:1541:3: acquire_resource: ‘va_start’ called here bash-5.3/print_cmd.c:1544:3: call_function: calling ‘the_printed_command_resize’ from ‘cprintf’ # 1633| the_printed_command_size = new; # 1634| # 1635|-> the_printed_command = (char *)xrealloc (the_printed_command, the_printed_command_size); # 1636| } # 1637| } Error: GCC_ANALYZER_WARNING (CWE-775): [#def355] bash-5.3/redir.c:408:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘herepipe[0]’ bash-5.3/redir.c:423:1: enter_function: entry to ‘here_document_to_fd’ bash-5.3/redir.c:434:14: call_function: calling ‘heredoc_expand’ from ‘here_document_to_fd’ bash-5.3/redir.c:434:14: return_function: returning to ‘here_document_to_fd’ from ‘heredoc_expand’ bash-5.3/redir.c:437:6: branch_false: following ‘false’ branch... bash-5.3/redir.c:447:7: branch_false: ...to here bash-5.3/redir.c:447:6: branch_false: following ‘false’ branch... bash-5.3/redir.c:454:6: branch_false: ...to here bash-5.3/redir.c:454:6: branch_true: following ‘true’ branch... bash-5.3/redir.c:456:11: branch_true: ...to here bash-5.3/redir.c:456:10: branch_false: following ‘false’ branch... bash-5.3/redir.c:467:11: branch_false: ...to here bash-5.3/redir.c:467:10: branch_false: following ‘false’ branch... bash-5.3/redir.c:475:11: branch_false: ...to here bash-5.3/redir.c:475:11: call_function: calling ‘heredoc_write’ from ‘here_document_to_fd’ # 406| # 407| errno = 0; # 408|-> nw = write (fd, heredoc, herelen); # 409| e = errno; # 410| if (nw != herelen) Error: GCC_ANALYZER_WARNING (CWE-775): [#def356] bash-5.3/redir.c:467:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘herepipe[0]’ bash-5.3/redir.c:423:1: enter_function: entry to ‘here_document_to_fd’ bash-5.3/redir.c:434:14: call_function: calling ‘heredoc_expand’ from ‘here_document_to_fd’ bash-5.3/redir.c:434:14: return_function: returning to ‘here_document_to_fd’ from ‘heredoc_expand’ bash-5.3/redir.c:437:6: branch_false: following ‘false’ branch... bash-5.3/redir.c:447:7: branch_false: ...to here bash-5.3/redir.c:447:6: branch_false: following ‘false’ branch... bash-5.3/redir.c:454:6: branch_false: ...to here bash-5.3/redir.c:454:6: branch_true: following ‘true’ branch... bash-5.3/redir.c:456:11: branch_true: ...to here bash-5.3/redir.c:456:10: branch_false: following ‘false’ branch... bash-5.3/redir.c:467:11: branch_false: ...to here bash-5.3/redir.c:467:11: throw: if ‘fcntl’ throws an exception... bash-5.3/redir.c:467:11: danger: ‘herepipe[0]’ leaks here # 465| # 466| #if defined (F_GETPIPE_SZ) # 467|-> if (fcntl (herepipe[1], F_GETPIPE_SZ, 0) < document_len) # 468| { # 469| close (herepipe[0]); Error: GCC_ANALYZER_WARNING (CWE-775): [#def357] bash-5.3/redir.c:467:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘herepipe[1]’ bash-5.3/redir.c:423:1: enter_function: entry to ‘here_document_to_fd’ bash-5.3/redir.c:434:14: call_function: calling ‘heredoc_expand’ from ‘here_document_to_fd’ bash-5.3/redir.c:434:14: return_function: returning to ‘here_document_to_fd’ from ‘heredoc_expand’ bash-5.3/redir.c:437:6: branch_false: following ‘false’ branch... bash-5.3/redir.c:447:7: branch_false: ...to here bash-5.3/redir.c:447:6: branch_false: following ‘false’ branch... bash-5.3/redir.c:454:6: branch_false: ...to here bash-5.3/redir.c:454:6: branch_true: following ‘true’ branch... bash-5.3/redir.c:456:11: branch_true: ...to here bash-5.3/redir.c:456:10: branch_false: following ‘false’ branch... bash-5.3/redir.c:467:11: branch_false: ...to here bash-5.3/redir.c:467:11: throw: if ‘fcntl’ throws an exception... bash-5.3/redir.c:467:11: danger: ‘herepipe[1]’ leaks here # 465| # 466| #if defined (F_GETPIPE_SZ) # 467|-> if (fcntl (herepipe[1], F_GETPIPE_SZ, 0) < document_len) # 468| { # 469| close (herepipe[0]); Error: GCC_ANALYZER_WARNING (CWE-775): [#def358] bash-5.3/redir.c:469:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘herepipe[0]’ bash-5.3/redir.c:423:1: enter_function: entry to ‘here_document_to_fd’ bash-5.3/redir.c:434:14: call_function: calling ‘heredoc_expand’ from ‘here_document_to_fd’ bash-5.3/redir.c:434:14: return_function: returning to ‘here_document_to_fd’ from ‘heredoc_expand’ bash-5.3/redir.c:437:6: branch_false: following ‘false’ branch... bash-5.3/redir.c:447:7: branch_false: ...to here bash-5.3/redir.c:447:6: branch_false: following ‘false’ branch... bash-5.3/redir.c:454:6: branch_false: ...to here bash-5.3/redir.c:454:6: branch_true: following ‘true’ branch... bash-5.3/redir.c:456:11: branch_true: ...to here bash-5.3/redir.c:456:10: branch_false: following ‘false’ branch... bash-5.3/redir.c:467:11: branch_false: ...to here bash-5.3/redir.c:467:10: branch_true: following ‘true’ branch... bash-5.3/redir.c:469:11: branch_true: ...to here bash-5.3/redir.c:469:11: throw: if ‘close’ throws an exception... bash-5.3/redir.c:469:11: danger: ‘herepipe[0]’ leaks here # 467| if (fcntl (herepipe[1], F_GETPIPE_SZ, 0) < document_len) # 468| { # 469|-> close (herepipe[0]); # 470| close (herepipe[1]); # 471| goto use_tempfile; Error: GCC_ANALYZER_WARNING (CWE-775): [#def359] bash-5.3/redir.c:478:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘herepipe[0]’ bash-5.3/redir.c:423:1: enter_function: entry to ‘here_document_to_fd’ bash-5.3/redir.c:434:14: call_function: calling ‘heredoc_expand’ from ‘here_document_to_fd’ bash-5.3/redir.c:434:14: return_function: returning to ‘here_document_to_fd’ from ‘heredoc_expand’ bash-5.3/redir.c:437:6: branch_false: following ‘false’ branch... bash-5.3/redir.c:447:7: branch_false: ...to here bash-5.3/redir.c:447:6: branch_false: following ‘false’ branch... bash-5.3/redir.c:454:6: branch_false: ...to here bash-5.3/redir.c:454:6: branch_true: following ‘true’ branch... bash-5.3/redir.c:456:11: branch_true: ...to here bash-5.3/redir.c:456:10: branch_false: following ‘false’ branch... bash-5.3/redir.c:467:11: branch_false: ...to here bash-5.3/redir.c:467:10: branch_false: following ‘false’ branch... bash-5.3/redir.c:475:11: branch_false: ...to here bash-5.3/redir.c:478:7: throw: if ‘close’ throws an exception... bash-5.3/redir.c:478:7: danger: ‘herepipe[0]’ leaks here # 476| if (document != redirectee->word) # 477| free (document); # 478|-> close (herepipe[1]); # 479| if (r) /* write error */ # 480| { Error: GCC_ANALYZER_WARNING (CWE-775): [#def360] bash-5.3/redir.c:481:11: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘herepipe[0]’ bash-5.3/redir.c:423:1: enter_function: entry to ‘here_document_to_fd’ bash-5.3/redir.c:434:14: call_function: calling ‘heredoc_expand’ from ‘here_document_to_fd’ bash-5.3/redir.c:434:14: return_function: returning to ‘here_document_to_fd’ from ‘heredoc_expand’ bash-5.3/redir.c:437:6: branch_false: following ‘false’ branch... bash-5.3/redir.c:447:7: branch_false: ...to here bash-5.3/redir.c:447:6: branch_false: following ‘false’ branch... bash-5.3/redir.c:454:6: branch_false: ...to here bash-5.3/redir.c:454:6: branch_true: following ‘true’ branch... bash-5.3/redir.c:456:11: branch_true: ...to here bash-5.3/redir.c:456:10: branch_false: following ‘false’ branch... bash-5.3/redir.c:467:11: branch_false: ...to here bash-5.3/redir.c:467:10: branch_false: following ‘false’ branch... bash-5.3/redir.c:475:11: branch_false: ...to here bash-5.3/redir.c:475:11: call_function: calling ‘heredoc_write’ from ‘here_document_to_fd’ bash-5.3/redir.c:475:11: return_function: returning to ‘here_document_to_fd’ from ‘heredoc_write’ bash-5.3/redir.c:479:10: branch_true: following ‘true’ branch... bash-5.3/redir.c:481:11: branch_true: ...to here bash-5.3/redir.c:481:11: throw: if ‘close’ throws an exception... bash-5.3/redir.c:481:11: danger: ‘herepipe[0]’ leaks here # 479| if (r) /* write error */ # 480| { # 481|-> close (herepipe[0]); # 482| errno = r; # 483| return (-1); Error: COMPILER_WARNING (CWE-1164): [#def361] bash-5.3/redir.c:748:1: warning[-Wunused-function]: ‘undoablefd’ defined but not used # 748 | undoablefd (int fd) # | ^~~~~~~~~~ # 746| # 747| static int # 748|-> undoablefd (int fd) # 749| { # 750| int clexec; Error: COMPILER_WARNING: [#def362] bash-5.3/redir.c: scope_hint: In function ‘do_redirection_internal’ bash-5.3/redir.c:770:52: warning[-Wunused-but-set-variable=]: variable ‘fdactive’ set but not used # 770 | int redir_fd, fd, redirector, r, oflags, rflags, fdactive; # | ^~~~~~~~ # 768| { # 769| WORD_DESC *redirectee; # 770|-> int redir_fd, fd, redirector, r, oflags, rflags, fdactive; # 771| intmax_t lfd; # 772| char *redirectee_word; Error: GCC_ANALYZER_WARNING (CWE-457): [#def363] bash-5.3/redir.c:913:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘oflags’ bash-5.3/redir.c:784:6: branch_false: following ‘false’ branch... bash-5.3/redir.c:908:10: branch_false: following ‘false’ branch... bash-5.3/redir.c:911:27: branch_false: ...to here bash-5.3/redir.c:912:10: branch_true: following ‘true’ branch... bash-5.3/redir.c:913:9: danger: use of uninitialized value ‘oflags’ here # 911| redirectee_word = savestring (redirectee->word); # 912| if (posixly_correct && interactive_shell == 0) # 913|-> redirectee->flags = oflags; # 914| # 915| if (redirectee_word == 0) Error: COMPILER_WARNING (CWE-457): [#def364] bash-5.3/redir.c: scope_hint: In function ‘do_redirection_internal.constprop.0’ bash-5.3/redir.c:913:27: warning[-Wmaybe-uninitialized]: ‘oflags’ may be used uninitialized # 913 | redirectee->flags = oflags; # | ~~~~~~~~~~~~~~~~~~^~~~~~~~ bash-5.3/redir.c:770:36: note: ‘oflags’ was declared here # 770 | int redir_fd, fd, redirector, r, oflags, rflags, fdactive; # | ^~~~~~ # 911| redirectee_word = savestring (redirectee->word); # 912| if (posixly_correct && interactive_shell == 0) # 913|-> redirectee->flags = oflags; # 914| # 915| if (redirectee_word == 0) Error: GCC_ANALYZER_WARNING (CWE-775): [#def365] bash-5.3/redir.c:1170:19: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(redir_fd, redirector)’ bash-5.3/redir.c:784:6: branch_false: following ‘false’ branch... bash-5.3/redir.c:1119:10: branch_true: following ‘true’ branch... bash-5.3/redir.c:1119:35: branch_true: ...to here bash-5.3/redir.c:1128:11: branch_true: following ‘true’ branch (when ‘redir_fd != redirector’)... bash-5.3/redir.c:1130:15: branch_true: ...to here bash-5.3/redir.c:1161:14: branch_false: following ‘false’ branch... bash-5.3/redir.c:1170:20: branch_false: ...to here bash-5.3/redir.c:1170:20: acquire_resource: opened here bash-5.3/redir.c:1170:19: danger: ‘dup2(redir_fd, redirector)’ leaks here; was opened at [(11)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/10) # 1168| } # 1169| /* This is correct. 2>&1 means dup2 (1, 2); */ # 1170|-> else if (dup2 (redir_fd, redirector) < 0) # 1171| return (errno); # 1172| Error: COMPILER_WARNING (CWE-1164): [#def366] bash-5.3/redir.c: scope_hint: At top level bash-5.3/redir.c:1376:1: warning[-Wunused-function]: ‘add_undo_fd_redirect’ defined but not used # 1376 | add_undo_fd_redirect (int sfd, int rfd) # | ^~~~~~~~~~~~~~~~~~~~ # 1374| # 1375| static int # 1376|-> add_undo_fd_redirect (int sfd, int rfd) # 1377| { # 1378| REDIRECTEE rd, sd; Error: COMPILER_WARNING (CWE-569): [#def367] bash-5.3/redir.c: scope_hint: In function ‘redir_varvalue’ bash-5.3/redir.c:1477:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 1477 | if (vr = valid_array_reference (w, 0)) # | ^~ # 1475| /* XXX - handle set -u here? */ # 1476| #if defined (ARRAY_VARS) # 1477|-> if (vr = valid_array_reference (w, 0)) # 1478| { # 1479| v = array_variable_part (w, 0, &sub, &len); Error: COMPILER_WARNING (CWE-569): [#def368] bash-5.3/redir.c:1492:19: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 1492 | if (vr = valid_array_reference (w, 0)) # | ^~ # 1490| { # 1491| w = nameref_cell (v); # 1492|-> if (vr = valid_array_reference (w, 0)) # 1493| v = array_variable_part (w, 0, &sub, &len); # 1494| else Error: COMPILER_WARNING (CWE-569): [#def369] bash-5.3/shell.c: scope_hint: In function ‘parse_shell_options’ bash-5.3/shell.c:925:14: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 925 | while (arg_character = arg_string[i++]) # | ^~~~~~~~~~~~~ # 923| i = 1; # 924| on_or_off = arg_string[0]; # 925|-> while (arg_character = arg_string[i++]) # 926| { # 927| switch (arg_character) Error: COMPILER_WARNING: [#def370] bash-5.3/shell.c: scope_hint: In function ‘disable_priv_mode’ bash-5.3/shell.c:1351:7: warning[-Wunused-but-set-variable=]: variable ‘e’ set but not used # 1351 | int e, r; # | ^ # 1349| disable_priv_mode (void) # 1350| { # 1351|-> int e, r; # 1352| # 1353| r = 0; Error: GCC_ANALYZER_WARNING (CWE-775): [#def371] bash-5.3/shell.c:1624:33: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ bash-5.3/shell.c:1596:8: acquire_resource: opened here bash-5.3/shell.c:1597:6: branch_false: following ‘false’ branch... bash-5.3/shell.c:1623:9: branch_false: ...to here bash-5.3/shell.c:1624:20: branch_true: following ‘true’ branch... bash-5.3/shell.c:1624:33: branch_true: ...to here bash-5.3/shell.c:1624:33: throw: if ‘xmalloc’ throws an exception... bash-5.3/shell.c:1624:33: danger: ‘fd’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 1622| # 1623| free (dollar_vars[0]); # 1624|-> dollar_vars[0] = exec_argv0 ? savestring (exec_argv0) : savestring (script_name); # 1625| if (exec_argv0) # 1626| { Error: GCC_ANALYZER_WARNING (CWE-775): [#def372] bash-5.3/shell.c:1624:59: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ bash-5.3/shell.c:1596:8: acquire_resource: opened here bash-5.3/shell.c:1597:6: branch_false: following ‘false’ branch... bash-5.3/shell.c:1623:9: branch_false: ...to here bash-5.3/shell.c:1624:20: branch_false: following ‘false’ branch... bash-5.3/shell.c:1624:59: branch_false: ...to here bash-5.3/shell.c:1624:59: throw: if ‘xmalloc’ throws an exception... bash-5.3/shell.c:1624:59: danger: ‘fd’ leaks here; was opened at [(1)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/0) # 1622| # 1623| free (dollar_vars[0]); # 1624|-> dollar_vars[0] = exec_argv0 ? savestring (exec_argv0) : savestring (script_name); # 1625| if (exec_argv0) # 1626| { Error: GCC_ANALYZER_WARNING (CWE-775): [#def373] bash-5.3/shell.c:1631:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ bash-5.3/shell.c:1596:8: acquire_resource: opened here bash-5.3/shell.c:1597:6: branch_false: following ‘false’ branch... bash-5.3/shell.c:1623:9: branch_false: ...to here bash-5.3/shell.c:1631:7: throw: if ‘file_isdir’ throws an exception... bash-5.3/shell.c:1631:7: danger: ‘fd’ leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0) # 1629| } # 1630| # 1631|-> if (file_isdir (filename)) # 1632| { # 1633| #if defined (EISDIR) Error: GCC_ANALYZER_WARNING (CWE-775): [#def374] bash-5.3/shell.c:1638:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ bash-5.3/shell.c:1596:8: acquire_resource: opened here bash-5.3/shell.c:1597:6: branch_false: following ‘false’ branch... bash-5.3/shell.c:1623:9: branch_false: ...to here bash-5.3/shell.c:1631:6: branch_true: following ‘true’ branch... bash-5.3/shell.c:1634:7: branch_true: ...to here bash-5.3/shell.c:1638:7: throw: if ‘file_error’ throws an exception... bash-5.3/shell.c:1638:7: danger: ‘fd’ leaks here; was opened at [(1)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/0) # 1636| errno = EINVAL; # 1637| #endif # 1638|-> file_error (filename); # 1639| #if defined (JOB_CONTROL) # 1640| end_job_control (); /* just in case we were run as bash -i script */ Error: GCC_ANALYZER_WARNING (CWE-775): [#def375] bash-5.3/shell.c:1640:7: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ bash-5.3/shell.c:1596:8: acquire_resource: opened here bash-5.3/shell.c:1597:6: branch_false: following ‘false’ branch... bash-5.3/shell.c:1623:9: branch_false: ...to here bash-5.3/shell.c:1631:6: branch_true: following ‘true’ branch... bash-5.3/shell.c:1634:7: branch_true: ...to here bash-5.3/shell.c:1640:7: throw: if ‘end_job_control’ throws an exception... bash-5.3/shell.c:1640:7: danger: ‘fd’ leaks here; was opened at [(1)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/0) # 1638| file_error (filename); # 1639| #if defined (JOB_CONTROL) # 1640|-> end_job_control (); /* just in case we were run as bash -i script */ # 1641| #endif # 1642| sh_exit (EX_NOINPUT); Error: GCC_ANALYZER_WARNING (CWE-775): [#def376] bash-5.3/shell.c:1646:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ bash-5.3/shell.c:1596:8: acquire_resource: opened here bash-5.3/shell.c:1597:6: branch_false: following ‘false’ branch... bash-5.3/shell.c:1623:9: branch_false: ...to here bash-5.3/shell.c:1631:6: branch_false: following ‘false’ branch... bash-5.3/shell.c:1646:3: branch_false: ...to here bash-5.3/shell.c:1646:3: throw: if ‘find_variable’ throws an exception... bash-5.3/shell.c:1646:3: danger: ‘fd’ leaks here; was opened at [(1)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/0) # 1644| # 1645| #if defined (ARRAY_VARS) # 1646|-> GET_ARRAY_FROM_VAR ("FUNCNAME", funcname_v, funcname_a); # 1647| GET_ARRAY_FROM_VAR ("BASH_SOURCE", bash_source_v, bash_source_a); # 1648| GET_ARRAY_FROM_VAR ("BASH_LINENO", bash_lineno_v, bash_lineno_a); Error: GCC_ANALYZER_WARNING (CWE-775): [#def377] bash-5.3/shell.c:1647:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ bash-5.3/shell.c:1596:8: acquire_resource: opened here bash-5.3/shell.c:1597:6: branch_false: following ‘false’ branch... bash-5.3/shell.c:1623:9: branch_false: ...to here bash-5.3/shell.c:1631:6: branch_false: following ‘false’ branch... bash-5.3/shell.c:1646:3: branch_false: ...to here bash-5.3/shell.c:1647:3: throw: if ‘find_variable’ throws an exception... bash-5.3/shell.c:1647:3: danger: ‘fd’ leaks here; was opened at [(1)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/0) # 1645| #if defined (ARRAY_VARS) # 1646| GET_ARRAY_FROM_VAR ("FUNCNAME", funcname_v, funcname_a); # 1647|-> GET_ARRAY_FROM_VAR ("BASH_SOURCE", bash_source_v, bash_source_a); # 1648| GET_ARRAY_FROM_VAR ("BASH_LINENO", bash_lineno_v, bash_lineno_a); # 1649| Error: GCC_ANALYZER_WARNING (CWE-775): [#def378] bash-5.3/shell.c:1648:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ bash-5.3/shell.c:1597:6: branch_true: following ‘true’ branch... bash-5.3/shell.c:1603:10: branch_true: following ‘true’ branch... bash-5.3/shell.c:1605:11: branch_true: ...to here bash-5.3/shell.c:1607:16: acquire_resource: opened here bash-5.3/shell.c:1613:6: branch_false: following ‘false’ branch (when ‘fd >= 0’)... bash-5.3/shell.c:1623:9: branch_false: ...to here bash-5.3/shell.c:1631:6: branch_false: following ‘false’ branch... bash-5.3/shell.c:1646:3: branch_false: ...to here bash-5.3/shell.c:1648:3: throw: if ‘find_variable’ throws an exception... bash-5.3/shell.c:1648:3: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/14/codeFlows/0/threadFlows/0/locations/4) # 1646| GET_ARRAY_FROM_VAR ("FUNCNAME", funcname_v, funcname_a); # 1647| GET_ARRAY_FROM_VAR ("BASH_SOURCE", bash_source_v, bash_source_a); # 1648|-> GET_ARRAY_FROM_VAR ("BASH_LINENO", bash_lineno_v, bash_lineno_a); # 1649| # 1650| push_source (bash_source_a, filename); Error: GCC_ANALYZER_WARNING (CWE-775): [#def379] bash-5.3/shell.c:1650:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ bash-5.3/shell.c:1597:6: branch_true: following ‘true’ branch... bash-5.3/shell.c:1603:10: branch_true: following ‘true’ branch... bash-5.3/shell.c:1605:11: branch_true: ...to here bash-5.3/shell.c:1607:16: acquire_resource: opened here bash-5.3/shell.c:1613:6: branch_false: following ‘false’ branch (when ‘fd >= 0’)... bash-5.3/shell.c:1623:9: branch_false: ...to here bash-5.3/shell.c:1631:6: branch_false: following ‘false’ branch... bash-5.3/shell.c:1646:3: branch_false: ...to here bash-5.3/shell.c:1650:3: throw: if ‘push_source’ throws an exception... bash-5.3/shell.c:1650:3: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/15/codeFlows/0/threadFlows/0/locations/4) # 1648| GET_ARRAY_FROM_VAR ("BASH_LINENO", bash_lineno_v, bash_lineno_a); # 1649| # 1650|-> push_source (bash_source_a, filename); # 1651| if (bash_lineno_a) # 1652| { Error: GCC_ANALYZER_WARNING (CWE-775): [#def380] bash-5.3/shell.c:1657:3: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ bash-5.3/shell.c:1597:6: branch_true: following ‘true’ branch... bash-5.3/shell.c:1603:10: branch_true: following ‘true’ branch... bash-5.3/shell.c:1605:11: branch_true: ...to here bash-5.3/shell.c:1607:16: acquire_resource: opened here bash-5.3/shell.c:1613:6: branch_false: following ‘false’ branch (when ‘fd >= 0’)... bash-5.3/shell.c:1623:9: branch_false: ...to here bash-5.3/shell.c:1631:6: branch_false: following ‘false’ branch... bash-5.3/shell.c:1646:3: branch_false: ...to here bash-5.3/shell.c:1651:6: branch_false: following ‘false’ branch (when ‘bash_lineno_a’ is NULL)... bash-5.3/shell.c:1657:3: branch_false: ...to here bash-5.3/shell.c:1657:3: throw: if ‘array_rshift’ throws an exception... bash-5.3/shell.c:1657:3: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/16/codeFlows/0/threadFlows/0/locations/4) # 1655| free (t); # 1656| } # 1657|-> array_push (funcname_a, "main"); # 1658| #endif # 1659| Error: GCC_ANALYZER_WARNING (CWE-775): [#def381] bash-5.3/shell.c:1710:8: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’ bash-5.3/shell.c:1597:6: branch_true: following ‘true’ branch... bash-5.3/shell.c:1603:10: branch_true: following ‘true’ branch... bash-5.3/shell.c:1605:11: branch_true: ...to here bash-5.3/shell.c:1607:16: acquire_resource: opened here bash-5.3/shell.c:1613:6: branch_false: following ‘false’ branch (when ‘fd >= 0’)... bash-5.3/shell.c:1623:9: branch_false: ...to here bash-5.3/shell.c:1631:6: branch_false: following ‘false’ branch... bash-5.3/shell.c:1646:3: branch_false: ...to here bash-5.3/shell.c:1651:6: branch_false: following ‘false’ branch (when ‘bash_lineno_a’ is NULL)... bash-5.3/shell.c:1657:3: branch_false: ...to here bash-5.3/shell.c:1667:6: branch_false: following ‘false’ branch (when ‘fd_is_tty != 0’)... bash-5.3/shell.c:1710:8: branch_false: ...to here bash-5.3/shell.c:1710:8: throw: if ‘move_to_high_fd’ throws an exception... bash-5.3/shell.c:1710:8: danger: ‘fd’ leaks here; was opened at [(5)](sarif:/runs/0/results/17/codeFlows/0/threadFlows/0/locations/4) # 1708| large one, in the hopes that any descriptors used by the script will # 1709| not match with ours. */ # 1710|-> fd = move_to_high_fd (fd, 1, -1); # 1711| # 1712| default_buffered_input = fd; Error: CPPCHECK_WARNING (CWE-476): [#def382] bash-5.3/sig.c:685: error[nullPointer]: Null pointer dereference: (volatile unsigned long*)0 # 683| # 684| if (core) # 685|-> *((volatile unsigned long *) NULL) = 0xdead0000 + sig; /* SIGSEGV */ # 686| # 687| exit (128+sig); Error: COMPILER_WARNING (CWE-563): [#def383] bash-5.3/stringlib.c: scope_hint: In function ‘strsub’ bash-5.3/stringlib.c:140:16: warning[-Wunused-variable]: unused variable ‘r’ # 140 | char *temp, *r;; # | ^ # 138| size_t patlen, replen, templen, tempsize, i; # 139| int repl; # 140|-> char *temp, *r;; # 141| # 142| patlen = strlen (pat); Error: GCC_ANALYZER_WARNING (CWE-688): [#def384] bash-5.3/stringlib.c:155:11: warning[-Wanalyzer-null-argument]: use of NULL ‘temp’ where non-null expected bash-5.3/stringlib.c:144:59: branch_true: following ‘true’ branch... bash-5.3/stringlib.c:146:10: branch_true: ...to here bash-5.3/stringlib.c:146:10: branch_true: following ‘true’ branch... bash-5.3/stringlib.c:155:19: release_memory: ‘temp’ is NULL bash-5.3/stringlib.c:155:11: danger: argument 1 (‘temp + templen’) NULL where non-null expected # 153| temp[templen++] = *r++; # 154| #else # 155|-> memcpy (temp + templen, rep, replen); # 156| templen += replen; # 157| #endif Error: COMPILER_WARNING (CWE-563): [#def385] bash-5.3/subst.c:229:53: warning[-Wunused-variable]: ‘expand_param_unset’ defined but not used # 229 | static char expand_param_error, expand_param_fatal, expand_param_unset; # | ^~~~~~~~~~~~~~~~~~ # 227| static WORD_LIST expand_word_error, expand_word_fatal; # 228| static WORD_DESC expand_wdesc_error, expand_wdesc_fatal; # 229|-> static char expand_param_error, expand_param_fatal, expand_param_unset; # 230| static char extract_string_error, extract_string_fatal; # 231| Error: COMPILER_WARNING (CWE-1164): [#def386] bash-5.3/subst.c: scope_hint: At top level bash-5.3/subst.c:243:14: warning[-Wunused-function]: ‘quoted_substring’ declared ‘static’ but never defined # 243 | static char *quoted_substring (char *, int, int); # | ^~~~~~~~~~~~~~~~ # 241| static WORD_LIST *garglist = (WORD_LIST *)NULL; # 242| # 243|-> static char *quoted_substring (char *, int, int); # 244| static int quoted_strlen (char *); # 245| static char *quoted_strchr (char *, int, int); Error: COMPILER_WARNING (CWE-1164): [#def387] bash-5.3/subst.c:244:12: warning[-Wunused-function]: ‘quoted_strlen’ declared ‘static’ but never defined # 244 | static int quoted_strlen (char *); # | ^~~~~~~~~~~~~ # 242| # 243| static char *quoted_substring (char *, int, int); # 244|-> static int quoted_strlen (char *); # 245| static char *quoted_strchr (char *, int, int); # 246| Error: COMPILER_WARNING (CWE-1164): [#def388] bash-5.3/subst.c:245:14: warning[-Wunused-function]: ‘quoted_strchr’ declared ‘static’ but never defined # 245 | static char *quoted_strchr (char *, int, int); # | ^~~~~~~~~~~~~ # 243| static char *quoted_substring (char *, int, int); # 244| static int quoted_strlen (char *); # 245|-> static char *quoted_strchr (char *, int, int); # 246| # 247| static char *expand_string_if_necessary (char *, int, EXPFUNC *); Error: COMPILER_WARNING (CWE-1164): [#def389] bash-5.3/subst.c:261:19: warning[-Wunused-function]: ‘list_dequote_escapes’ declared ‘static’ but never defined # 261 | static WORD_LIST *list_dequote_escapes (WORD_LIST *); # | ^~~~~~~~~~~~~~~~~~~~ # 259| # 260| static WORD_LIST *list_quote_escapes (WORD_LIST *); # 261|-> static WORD_LIST *list_dequote_escapes (WORD_LIST *); # 262| # 263| static char *make_quoted_char (int); Error: COMPILER_WARNING (CWE-1164): [#def390] bash-5.3/subst.c:266:12: warning[-Wunused-function]: ‘unquoted_substring’ declared ‘static’ but never defined # 266 | static int unquoted_substring (const char *, const char *); # | ^~~~~~~~~~~~~~~~~~ # 264| static WORD_LIST *quote_list (WORD_LIST *); # 265| # 266|-> static int unquoted_substring (const char *, const char *); # 267| static int unquoted_member (int, const char *); # 268| Error: COMPILER_WARNING (CWE-1164): [#def391] bash-5.3/subst.c:267:12: warning[-Wunused-function]: ‘unquoted_member’ declared ‘static’ but never defined # 267 | static int unquoted_member (int, const char *); # | ^~~~~~~~~~~~~~~ # 265| # 266| static int unquoted_substring (const char *, const char *); # 267|-> static int unquoted_member (int, const char *); # 268| # 269| #if defined (ARRAY_VARS) Error: COMPILER_WARNING (CWE-1164): [#def392] bash-5.3/subst.c:286:23: warning[-Wunused-function]: ‘mb_getcharlens’ declared ‘static’ but never defined # 286 | static unsigned char *mb_getcharlens (const char *, int); # | ^~~~~~~~~~~~~~ # 284| static char *pos_params (const char *, int, int, int, int); # 285| # 286|-> static unsigned char *mb_getcharlens (const char *, int); # 287| # 288| static char *remove_upattern (char *, char *, int); Error: COMPILER_WARNING (CWE-1164): [#def393] bash-5.3/subst.c:301:14: warning[-Wunused-function]: ‘variable_remove_pattern’ declared ‘static’ but never defined # 301 | static char *variable_remove_pattern (char *, char *, int, int); # | ^~~~~~~~~~~~~~~~~~~~~~~ # 299| static int getpatspec (int, const char *); # 300| static char *getpattern (char *, int, int); # 301|-> static char *variable_remove_pattern (char *, char *, int, int); # 302| static char *list_remove_pattern (WORD_LIST *, char *, int, int, int); # 303| static char *parameter_list_remove_pattern (int, char *, int, int); Error: COMPILER_WARNING (CWE-1164): [#def394] bash-5.3/subst.c:348:14: warning[-Wunused-function]: ‘mb_subfstring’ declared ‘static’ but never defined # 348 | static char *mb_subfstring (const char *, int, int); # | ^~~~~~~~~~~~~ # 346| static int verify_substring_values (SHELL_VAR *, char *, char *, int, intmax_t *, intmax_t *); # 347| static int get_var_and_type (char *, char *, array_eltstate_t *, int, int, SHELL_VAR **, char **); # 348|-> static char *mb_subfstring (const char *, int, int); # 349| static char *parameter_brace_substring (char *, char *, array_eltstate_t *, char *, int, int, int); # 350| Error: COMPILER_WARNING (CWE-1164): [#def395] bash-5.3/subst.c:358:14: warning[-Wunused-function]: ‘pos_params_casemod’ declared ‘static’ but never defined # 358 | static char *pos_params_casemod (char *, char *, int, int); # | ^~~~~~~~~~~~~~~~~~ # 356| static char *parameter_brace_patsub (char *, char *, array_eltstate_t *, char *, int, int, int); # 357| # 358|-> static char *pos_params_casemod (char *, char *, int, int); # 359| static char *parameter_brace_casemod (char *, char *, array_eltstate_t *, int, char *, int, int, int); # 360| Error: COMPILER_WARNING (CWE-569): [#def396] bash-5.3/subst.c: scope_hint: In function ‘string_extract’ bash-5.3/subst.c:802:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 802 | while (c = string[i]) # | ^ # 800| i = *sindex; # 801| found = 0; # 802|-> while (c = string[i]) # 803| { # 804| if (c == '\\') Error: COMPILER_WARNING (CWE-569): [#def397] bash-5.3/subst.c: scope_hint: In function ‘string_extract_double_quoted’ bash-5.3/subst.c:873:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 873 | while (c = string[i]) # | ^ # 871| j = 0; # 872| i = *sindex; # 873|-> while (c = string[i]) # 874| { # 875| /* Process a character that was quoted by a backslash. */ Error: COMPILER_WARNING: [#def398] bash-5.3/subst.c:1018:9: warning[-Wunused-but-set-variable=]: variable ‘ret’ set but not used # 1018 | char *ret; # | ^~~ # 1016| int c; # 1017| size_t i, si; # 1018|-> char *ret; # 1019| int pass_next, backquote; # 1020| DECLARE_MBSTATE; Error: COMPILER_WARNING (CWE-569): [#def399] bash-5.3/subst.c: scope_hint: In function ‘skip_double_quoted’ bash-5.3/subst.c:1024:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 1024 | while (c = string[i]) # | ^ # 1022| pass_next = backquote = 0; # 1023| i = sind; # 1024|-> while (c = string[i]) # 1025| { # 1026| if (pass_next) Error: COMPILER_WARNING (CWE-569): [#def400] bash-5.3/subst.c: scope_hint: In function ‘string_extract_verbatim’ bash-5.3/subst.c:1182:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 1182 | while (c = string[i]) # | ^ # 1180| wcharlist = 0; # 1181| #endif # 1182|-> while (c = string[i]) # 1183| { # 1184| #if defined (HANDLE_MULTIBYTE) Error: COMPILER_WARNING (CWE-563): [#def401] bash-5.3/subst.c:1363:10: warning[-Wunused-variable]: unused variable ‘xflags’ # 1363 | int c, xflags; # | ^~~~~~ # 1361| extract_delimited_string (const char *string, size_t *sindex, char *opener, char *alt_opener, char *closer, int flags) # 1362| { # 1363|-> int c, xflags; # 1364| size_t i, si, slen; # 1365| char *t, *result; Error: COMPILER_WARNING: [#def402] bash-5.3/subst.c: scope_hint: In function ‘extract_delimited_string’ bash-5.3/subst.c:1365:9: warning[-Wunused-but-set-variable=]: variable ‘t’ set but not used # 1365 | char *t, *result; # | ^ # 1363| int c, xflags; # 1364| size_t i, si, slen; # 1365|-> char *t, *result; # 1366| int pass_character, nesting_level, in_comment; # 1367| size_t len_closer, len_opener, len_alt_opener; Error: COMPILER_WARNING (CWE-569): [#def403] bash-5.3/subst.c: scope_hint: In function ‘extract_heredoc_dolbrace_string’ bash-5.3/subst.c:1560:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 1560 | while (c = string[i]) # | ^ # 1558| # 1559| i = *sindex; # 1560|-> while (c = string[i]) # 1561| { # 1562| if (pass_character) Error: COMPILER_WARNING: [#def404] bash-5.3/subst.c: scope_hint: In function ‘extract_dollar_brace_string’ bash-5.3/subst.c:1644:11: warning[-Wstringop-truncation]: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length # 1644 | strncpy (result + result_index, t, tlen); # | ^ bash-5.3/subst.c:1640:18: note: length computed here # 1640 | tlen = strlen (t); # | ^~~~~~~~~~ # 1642| # 1643| RESIZE_MALLOCED_BUFFER (result, result_index, tlen + 1, result_size, 64); # 1644|-> strncpy (result + result_index, t, tlen); # 1645| result_index += tlen; # 1646| free (t); Error: COMPILER_WARNING: [#def405] bash-5.3/subst.c:1830:18: warning[-Wunused-but-set-variable=]: variable ‘t’ set but not used # 1830 | char *result, *t; # | ^ # 1828| size_t si, slen; # 1829| int pass_character, nesting_level, dolbrace_state; # 1830|-> char *result, *t; # 1831| DECLARE_MBSTATE; # 1832| Error: COMPILER_WARNING (CWE-569): [#def406] bash-5.3/subst.c: scope_hint: In function ‘extract_dollar_brace_string’ bash-5.3/subst.c:1851:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 1851 | while (c = string[i]) # | ^ # 1849| # 1850| i = *sindex; # 1851|-> while (c = string[i]) # 1852| { # 1853| if (pass_character) Error: COMPILER_WARNING: [#def407] bash-5.3/subst.c:2090:9: warning[-Wunused-but-set-variable=]: variable ‘temp’ set but not used # 2090 | char *temp; # | ^~~~ # 2088| int pass_next, backq, c, count, oldjmp; # 2089| size_t i, si, slen; # 2090|-> char *temp; # 2091| DECLARE_MBSTATE; # 2092| Error: COMPILER_WARNING (CWE-569): [#def408] bash-5.3/subst.c: scope_hint: In function ‘skip_matched_pair’ bash-5.3/subst.c:2103:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 2103 | while (c = string[i]) # | ^ # 2101| count = 1; # 2102| pass_next = backq = 0; # 2103|-> while (c = string[i]) # 2104| { # 2105| if (pass_next) Error: COMPILER_WARNING: [#def409] bash-5.3/subst.c:2205:9: warning[-Wunused-but-set-variable=]: variable ‘temp’ set but not used # 2205 | char *temp, open[3]; # | ^~~~ # 2203| int arithexp, skipcol; # 2204| size_t i, si, slen; # 2205|-> char *temp, open[3]; # 2206| DECLARE_MBSTATE; # 2207| Error: COMPILER_WARNING (CWE-569): [#def410] bash-5.3/subst.c: scope_hint: In function ‘skip_to_delim’ bash-5.3/subst.c:2222:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 2222 | while (c = string[i]) # | ^ # 2220| i = start; # 2221| pass_next = backq = dquote = 0; # 2222|-> while (c = string[i]) # 2223| { # 2224| /* If this is non-zero, we should not let quote characters be delimiters Error: COMPILER_WARNING (CWE-569): [#def411] bash-5.3/subst.c: scope_hint: In function ‘skip_to_histexp’ bash-5.3/subst.c:2393:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 2393 | while (c = string[i]) # | ^ # 2391| i = start; # 2392| pass_next = backq = dquote = 0; # 2393|-> while (c = string[i]) # 2394| { # 2395| if (pass_next) Error: COMPILER_WARNING (CWE-569): [#def412] bash-5.3/subst.c: scope_hint: In function ‘do_assignment_internal’ bash-5.3/subst.c:3599:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 3599 | if (t = mbschr (name, LBRACK)) # | ^ # 3597| #if defined (ARRAY_VARS) # 3598| /* could use strchr, since variable names can't yet contain multibyte characters */ # 3599|-> if (t = mbschr (name, LBRACK)) # 3600| { # 3601| if (assign_list) Error: COMPILER_WARNING (CWE-569): [#def413] bash-5.3/subst.c: scope_hint: In function ‘expand_string_dollar_quote’ bash-5.3/subst.c:4151:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 4151 | while (c = string[sindex]) # | ^ # 4149| retind = 0; # 4150| # 4151|-> while (c = string[sindex]) # 4152| { # 4153| switch (c) Error: CPPCHECK_WARNING (CWE-562): [#def414] bash-5.3/subst.c:4709: error[returnDanglingLifetime]: Returning pointer to local variable 'result' that will be invalid when returning. # 4707| # 4708| if (strchr (string, CTLESC) == 0) # 4709|-> return (strcpy (result, string)); # 4710| # 4711| quote_spaces = (ifs_value && *ifs_value == 0); Error: CPPCHECK_WARNING (CWE-562): [#def415] bash-5.3/subst.c:4831: error[returnDanglingLifetime]: Returning pointer to local variable 'result' that will be invalid when returning. # 4829| each character. Just return a copy of the string passed to us. */ # 4830| if (strchr (string, CTLESC) == NULL) # 4831|-> return (strcpy (result, string)); # 4832| # 4833| send = string + slen; Error: COMPILER_WARNING (CWE-1164): [#def416] bash-5.3/subst.c:4942:1: warning[-Wunused-function]: ‘list_quote_ifs’ defined but not used # 4942 | list_quote_ifs (WORD_LIST *list) # | ^~~~~~~~~~~~~~ # 4940| # 4941| static WORD_LIST * # 4942|-> list_quote_ifs (WORD_LIST *list) # 4943| { # 4944| WORD_LIST *w; Error: COMPILER_WARNING (CWE-457): [#def417] bash-5.3/subst.c: scope_hint: In function ‘read_comsub’ bash-5.3/subst.c:6718:11: warning[-Wmaybe-uninitialized]: ‘bufp’ may be used uninitialized # 6718 | c = *bufp++; # | ^~~~~~~ bash-5.3/subst.c:6684:40: note: ‘bufp’ was declared here # 6684 | char *istring, buf[COMSUB_PIPEBUF], *bufp; # | ^~~~ # 6716| bufp = buf; # 6717| } # 6718|-> c = *bufp++; # 6719| # 6720| if (c == 0) Error: COMPILER_WARNING (CWE-1164): [#def418] bash-5.3/subst.c:6859:1: warning[-Wunused-function]: ‘uw_unbind_variable’ defined but not used # 6859 | uw_unbind_variable (void *name) # | ^~~~~~~~~~~~~~~~~~ # 6857| # 6858| static void # 6859|-> uw_unbind_variable (void *name) # 6860| { # 6861| unbind_variable_noref (name); Error: COMPILER_WARNING (CWE-569): [#def419] bash-5.3/subst.c: scope_hint: In function ‘comsub_quote_string’ bash-5.3/subst.c:6910:24: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 6910 | for (i = 0, ind = 0; c = string[i]; ) # | ^ # 6908| skip_ctlnul = ifs_cmap[CTLNUL]; # 6909| # 6910|-> for (i = 0, ind = 0; c = string[i]; ) # 6911| { # 6912| if (comsub_shouldquote (c, quoted, flags, skip_ctlesc, skip_ctlnul)) Error: COMPILER_WARNING (CWE-569): [#def420] bash-5.3/subst.c: scope_hint: In function ‘function_substitute’ bash-5.3/subst.c:6944:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 6944 | if (valsub = (string && *string == '|')) # | ^~~~~~ # 6942| #endif # 6943| # 6944|-> if (valsub = (string && *string == '|')) # 6945| string++; # 6946| Error: COMPILER_WARNING (CWE-569): [#def421] bash-5.3/subst.c: scope_hint: In function ‘parameter_brace_expand_word’ bash-5.3/subst.c:7774:12: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 7774 | else if (var = find_variable (name)) # | ^~~ # 7772| } # 7773| #endif # 7774|-> else if (var = find_variable (name)) # 7775| { # 7776| if (var_isset (var) && invisible_p (var) == 0) Error: COMPILER_WARNING (CWE-569): [#def422] bash-5.3/subst.c:7804:12: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 7804 | else if (var = find_variable_last_nameref (name, 0)) # | ^~~ # 7802| temp = (char *)NULL; # 7803| } # 7804|-> else if (var = find_variable_last_nameref (name, 0)) # 7805| { # 7806| temp = nameref_cell (var); Error: COMPILER_WARNING (CWE-457): [#def423] bash-5.3/subst.c: scope_hint: In function ‘parameter_brace_find_indir’ bash-5.3/subst.c:7863:33: warning[-Wmaybe-uninitialized]: ‘oldex’ may be used uninitialized # 7863 | expand_no_split_dollar_star = oldex; # | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~ bash-5.3/subst.c:7844:15: note: ‘oldex’ was declared here # 7844 | int pflags, oldex; # | ^~~~~ # 7861| w = parameter_brace_expand_word (name, var_is_special, quoted, pflags, 0); # 7862| if (var_is_special) # 7863|-> expand_no_split_dollar_star = oldex; # 7864| # 7865| t = w->word; Error: COMPILER_WARNING (CWE-457): [#def424] bash-5.3/subst.c:8464:9: warning[-Wmaybe-uninitialized]: ‘a’ may be used uninitialized # 8464 | len = assoc_p (v) ? assoc_num_elements (h) : array_num_elements (a); bash-5.3/subst.c: scope_hint: In function ‘parameter_brace_substring’ bash-5.3/subst.c:8402:9: note: ‘a’ was declared here # 8402 | ARRAY *a; # | ^ # 8462| /* For arrays, the second offset deals with the number of elements. */ # 8463| if (vtype == VT_ARRAYVAR) # 8464|-> len = assoc_p (v) ? assoc_num_elements (h) : array_num_elements (a); # 8465| #endif # 8466| Error: COMPILER_WARNING (CWE-569): [#def425] bash-5.3/subst.c: scope_hint: In function ‘shouldexp_replacement’ bash-5.3/subst.c:9160:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 9160 | while (c = s[sindex]) # | ^ # 9158| sindex = 0; # 9159| slen = STRLEN (s); # 9160|-> while (c = s[sindex]) # 9161| { # 9162| if (c == '\\') Error: COMPILER_WARNING (CWE-563): [#def426] bash-5.3/subst.c: scope_hint: In function ‘pat_subst’ bash-5.3/subst.c:9291:18: warning[-Wunused-variable]: unused variable ‘clen’ # 9291 | size_t clen; # | ^~~~ # 9289| we increment one character to avoid infinite recursion. */ # 9290| char *p, *origp, *origs; # 9291|-> size_t clen; # 9292| # 9293| RESIZE_MALLOCED_BUFFER (ret, rptr, locale_mb_cur_max, rsize, 64); Error: COMPILER_WARNING (CWE-569): [#def427] bash-5.3/subst.c: scope_hint: In function ‘parameter_brace_expand’ bash-5.3/subst.c:9865:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 9865 | if (c = string[sindex]) # | ^ # 9863| /* Find out what character ended the variable name. Then # 9864| do the appropriate thing. */ # 9865|-> if (c = string[sindex]) # 9866| sindex++; # 9867| Error: COMPILER_WARNING (CWE-569): [#def428] bash-5.3/subst.c:9875:11: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 9875 | if (c = string[sindex]) # | ^ # 9873| { # 9874| check_nullness++; # 9875|-> if (c = string[sindex]) # 9876| sindex++; # 9877| } Error: COMPILER_WARNING: [#def429] bash-5.3/subst.c:11274:7: warning[-Wunused-but-set-variable=]: variable ‘local_expanded’ set but not used #11274 | int local_expanded; # | ^~~~~~~~~~~~~~ #11272| int internal_tilde; #11273| int split_on_spaces; #11274|-> int local_expanded; #11275| int tflag; #11276| int pflags; /* flags passed to param_expand */ Error: COMPILER_WARNING (CWE-1164): [#def430] bash-5.3/subst.c: scope_hint: In function ‘expand_word_internal’ bash-5.3/subst.c:11961:1: warning[-Wunused-label]: label ‘add_quoted_character’ defined but not used #11961 | add_quoted_character: # | ^~~~~~~~~~~~~~~~~~~~ #11959| if ((quoted&(Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) == 0) #11960| has_quoted_ifs++; #11961|-> add_quoted_character: #11962| if (string[sindex]) /* from old goto dollar_add_string */ #11963| sindex++; Error: COMPILER_WARNING (CWE-569): [#def431] bash-5.3/subst.c: scope_hint: In function ‘string_quote_removal’ bash-5.3/subst.c:12219:29: warning[-Wparentheses]: suggest parentheses around assignment used as truth value #12219 | for (dquote = sindex = 0; c = string[sindex];) # | ^ #12217| r = result_string = (char *)xmalloc (slen + 1); #12218| #12219|-> for (dquote = sindex = 0; c = string[sindex];) #12220| { #12221| switch (c) Error: COMPILER_WARNING (CWE-569): [#def432] bash-5.3/subst.c: scope_hint: In function ‘brace_expand_word_list’ bash-5.3/subst.c:12748:28: warning[-Wparentheses]: suggest parentheses around assignment used as truth value #12748 | for (eindex = 0; temp_string = expansions[eindex]; eindex++) # | ^~~~~~~~~~~ #12746| } #12747| #12748|-> for (eindex = 0; temp_string = expansions[eindex]; eindex++) #12749| { #12750| w = alloc_word_desc (); Error: COMPILER_WARNING (CWE-563): [#def433] bash-5.3/subst.c:12949:35: warning[-Wunused-variable]: unused variable ‘inheriting’ #12949 | int t, i_on, i_off, oind, skip, inheriting; # | ^~~~~~~~~~ #12947| { #12948| char opts_on[16], opts_off[16], omap[128]; #12949|-> int t, i_on, i_off, oind, skip, inheriting; #12950| WORD_LIST *l; #12951| Error: COMPILER_WARNING (CWE-823): [#def434] bash-5.3/subst.c: scope_hint: In function ‘expand_declaration_argument’ bash-5.3/subst.c:12991:33: warning[-Wchar-subscripts]: array subscript has type ‘char’ #12991 | omap[l->word->word[oind]] |= (optchar == '-' ? 1 : 2); # | ~~~~~~~~~~~~~^~~~~~ #12989| case 'u': #12990| case 'c': #12991|-> omap[l->word->word[oind]] |= (optchar == '-' ? 1 : 2); #12992| break; #12993| default: Error: COMPILER_WARNING (CWE-569): [#def435] bash-5.3/support/bashversion.c: scope_hint: In function ‘main’ bash-5.3/support/bashversion.c:67:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 67 | if (progname = strrchr (argv[0], '/')) # | ^~~~~~~~ # 65| char dv[128], *rv; # 66| # 67|-> if (progname = strrchr (argv[0], '/')) # 68| progname++; # 69| else Error: COMPILER_WARNING (CWE-563): [#def436] bash-5.3/support/man2html.c:104:13: warning[-Wunused-variable]: ‘location_base’ defined but not used # 104 | static char location_base[NULL_TERMINATED(MED_STR_MAX)] = ""; # | ^~~~~~~~~~~~~ # 102| #endif # 103| # 104|-> static char location_base[NULL_TERMINATED(MED_STR_MAX)] = ""; # 105| # 106| static char th_page_and_sec[128] = { '\0' }; Error: COMPILER_WARNING (CWE-1164): [#def437] bash-5.3/support/man2html.c:148:1: warning[-Wunused-function]: ‘strgrow’ defined but not used # 148 | strgrow(char *old, int len) # | ^~~~~~~ # 146| # 147| static char * # 148|-> strgrow(char *old, int len) # 149| { # 150| char *new = realloc(old, (strlen(old) + len + 1) * sizeof(char)); Error: COMPILER_WARNING (CWE-1164): [#def438] bash-5.3/support/man2html.c:190:1: warning[-Wunused-function]: ‘strduplicate’ defined but not used # 190 | strduplicate(char *from) # | ^~~~~~~~~~~~ # 188| */ # 189| static char * # 190|-> strduplicate(char *from) # 191| { # 192| char *new = stralloc(strlen(from)); Error: COMPILER_WARNING (CWE-1164): [#def439] bash-5.3/support/man2html.c:210:1: warning[-Wunused-function]: ‘strmaxcat’ defined but not used # 210 | strmaxcat(char *to, char *from, int n) # | ^~~~~~~~~ # 208| # 209| static char * # 210|-> strmaxcat(char *to, char *from, int n) # 211| { # 212| int to_len = strlen(to); Error: COMPILER_WARNING (CWE-1164): [#def440] bash-5.3/support/man2html.c:240:1: warning[-Wunused-function]: ‘escape_input’ defined but not used # 240 | escape_input(char *str) # | ^~~~~~~~~~~~ # 238| */ # 239| static char * # 240|-> escape_input(char *str) # 241| { # 242| int i, j = 0; Error: COMPILER_WARNING (CWE-563): [#def441] bash-5.3/support/man2html.c:298:14: warning[-Wunused-variable]: ‘fname’ defined but not used # 298 | static char *fname; # | ^~~~~ # 296| #define INDEXFILE "/tmp/manindex.list" # 297| # 298|-> static char *fname; # 299| static FILE *idxfile; # 300| Error: COMPILER_WARNING (CWE-563): [#def442] bash-5.3/support/man2html.c:299:14: warning[-Wunused-variable]: ‘idxfile’ defined but not used # 299 | static FILE *idxfile; # | ^~~~~~~ # 297| # 298| static char *fname; # 299|-> static FILE *idxfile; # 300| # 301| static STRDEF *chardef, *strdef, *defdef; Error: COMPILER_WARNING (CWE-563): [#def443] bash-5.3/support/man2html.c:428:13: warning[-Wunused-variable]: ‘eqndelimopen’ defined but not used # 428 | static char eqndelimopen = 0, eqndelimclose = 0; # | ^~~~~~~~~~~~ # 426| # 427| # 428|-> static char eqndelimopen = 0, eqndelimclose = 0; # 429| static char escapesym = '\\', nobreaksym = '\'', controlsym = '.', fieldsym = 0, padsym = 0; # 430| Error: COMPILER_WARNING (CWE-563): [#def444] bash-5.3/support/man2html.c:428:31: warning[-Wunused-variable]: ‘eqndelimclose’ defined but not used # 428 | static char eqndelimopen = 0, eqndelimclose = 0; # | ^~~~~~~~~~~~~ # 426| # 427| # 428|-> static char eqndelimopen = 0, eqndelimclose = 0; # 429| static char escapesym = '\\', nobreaksym = '\'', controlsym = '.', fieldsym = 0, padsym = 0; # 430| Error: COMPILER_WARNING (CWE-563): [#def445] bash-5.3/support/man2html.c: scope_hint: In function ‘read_man_page’ bash-5.3/support/man2html.c:517:17: warning[-Wunused-variable]: unused variable ‘i’ # 517 | int i; # | ^ # 515| { # 516| char *man_buf = NULL; # 517|-> int i; # 518| FILE *man_stream = NULL; # 519| struct stat stbuf; Error: COMPILER_WARNING (CWE-563): [#def446] bash-5.3/support/man2html.c:946:12: warning[-Wunused-variable]: ‘asint’ defined but not used # 946 | static int asint = 0; # | ^~~~~ # 944| } # 945| # 946|-> static int asint = 0; # 947| static int intresult = 0; # 948| Error: COMPILER_WARNING (CWE-563): [#def447] bash-5.3/support/man2html.c:1448:17: warning[-Wunused-variable]: unused variable ‘t’ # 1448 | char *t, *h, *g; # | ^ # 1446| scan_table(char *c) # 1447| { # 1448|-> char *t, *h, *g; # 1449| int center = 0, expand = 0, box = 0, border = 0, linesize = 1; # 1450| int i, j, maxcol = 0, finished = 0; Error: COMPILER_WARNING (CWE-563): [#def448] bash-5.3/support/man2html.c: scope_hint: In function ‘scan_table’ bash-5.3/support/man2html.c:1453:44: warning[-Wunused-variable]: unused variable ‘ftable’ # 1453 | TABLEROW *layout = NULL, *currow, *ftable; # | ^~~~~~ # 1451| int oldfont, oldsize, oldfillout; # 1452| char itemsep = '\t'; # 1453|-> TABLEROW *layout = NULL, *currow, *ftable; # 1454| TABLEITEM *curfield; # 1455| Error: COMPILER_WARNING (CWE-563): [#def449] bash-5.3/support/man2html.c: scope_hint: In function ‘scan_expression’ bash-5.3/support/man2html.c:1783:36: warning[-Wunused-variable]: unused variable ‘j’ # 1783 | int value = 0, value2, j = 0, sign = 1, opex = 0; # | ^ # 1781| scan_expression(char *c, int *result) # 1782| { # 1783|-> int value = 0, value2, j = 0, sign = 1, opex = 0; # 1784| char oper = 'c'; # 1785| Error: COMPILER_WARNING (CWE-569): [#def450] bash-5.3/support/man2html.c: scope_hint: In function ‘skip_till_newline’ bash-5.3/support/man2html.c:2160:19: warning[-Wparentheses]: suggest parentheses around ‘&&’ within ‘||’ # 2160 | while (*c && *c != '\n' || lvl > 0) { # | ~~~^~~~~~~~~~~~~ # 2158| int lvl = 0; # 2159| # 2160|-> while (*c && *c != '\n' || lvl > 0) { # 2161| if (*c == '\\') { # 2162| c++; Error: COMPILER_WARNING (CWE-563): [#def451] bash-5.3/support/man2html.c: scope_hint: In function ‘scan_request’ bash-5.3/support/man2html.c:2252:41: warning[-Wunused-variable]: unused variable ‘oldcurpos’ # 2252 | int oldcurpos = curpos; # | ^~~~~~~~~ # 2250| { # 2251| STRDEF *de; # 2252|-> int oldcurpos = curpos; # 2253| # 2254| c = c + j; Error: COMPILER_WARNING (CWE-563): [#def452] bash-5.3/support/man2html.c:2549:41: warning[-Wunused-variable]: unused variable ‘f’ # 2549 | FILE *f; # | ^ # 2547| case V('s', 'o'): # 2548| { # 2549|-> FILE *f; # 2550| struct stat stbuf; # 2551| int l = 0; Error: CPPCHECK_WARNING (CWE-786): [#def453] bash-5.3/support/man2html.c:2708: error[negativeIndex]: Array 'wordlist[100]' accessed at index wordlist[*][-1], which is out of bounds. # 2706| curpos++; # 2707| } # 2708|-> wordlist[i][-1] = ' '; # 2709| out_html(change_to_font(font[i & 1])); # 2710| scan_troff(wordlist[i], 1, NULL); Error: CPPCHECK_WARNING (CWE-786): [#def454] bash-5.3/support/man2html.c:2908: error[negativeIndex]: Array 'wordlist[100]' accessed at index wordlist[*][-1], which is out of bounds. # 2906| char *t; # 2907| for (i = 1; i < words; i++) # 2908|-> wordlist[i][-1] = '\0'; # 2909| *sl = '\0'; # 2910| output_possible = 1; Error: CPPCHECK_WARNING (CWE-786): [#def455] bash-5.3/support/man2html.c:2947: error[negativeIndex]: Array 'wordlist[100]' accessed at index wordlist[*][-1], which is out of bounds. # 2945| out_html(change_to_font('I')); # 2946| if (words > 1) # 2947|-> wordlist[1][-1] = '\0'; # 2948| c = lookup_abbrev(wordlist[0]); # 2949| curpos += strlen(c); Error: CPPCHECK_WARNING (CWE-457): [#def456] bash-5.3/support/man2html.c:3108: warning[uninitvar]: Uninitialized variable: list_options # 3106| strlimitcpy(list_options, c, nl - c, MED_STR_MAX); # 3107| } # 3108|-> if (strstr(list_options, "-bullet")) { /* HTML Unnumbered List */ # 3109| dl_set[itemdepth] = BL_BULLET_LIST; # 3110| out_html("<UL>\n"); Error: CPPCHECK_WARNING (CWE-457): [#def457] bash-5.3/support/man2html.c:3241: warning[uninitvar]: Uninitialized variable: bd_options # 3239| mandoc_bd_options = 0; /* Remember options for # 3240| * terminating Bl */ # 3241|-> if (strstr(bd_options, "-offset indent")) { # 3242| mandoc_bd_options |= BD_INDENT; # 3243| out_html("<BLOCKQUOTE>\n"); Error: CPPCHECK_WARNING (CWE-786): [#def458] bash-5.3/support/man2html.c:3688: error[negativeIndex]: Array 'wordlist[100]' accessed at index wordlist[*][-1], which is out of bounds. # 3686| *sl = '\0'; # 3687| for (i = 1; i < words; i++) # 3688|-> wordlist[i][-1] = '\0'; # 3689| for (i = 0; i < words; i++) { # 3690| char *h = NULL; Error: COMPILER_WARNING (CWE-569): [#def459] bash-5.3/support/man2html.c:3702:45: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 3702 | for (i = 0; owndef->st[deflen + 2 + i] = owndef->st[i]; i++); # | ^~~~~~ # 3700| wordlist[i] = NULL; # 3701| deflen = strlen(owndef->st); # 3702|-> for (i = 0; owndef->st[deflen + 2 + i] = owndef->st[i]; i++); # 3703| oldargument = argument; # 3704| argument = wordlist; Error: COMPILER_WARNING (CWE-1164): [#def460] bash-5.3/support/man2html.c: scope_hint: At top level bash-5.3/support/man2html.c:3757:1: warning[-Wunused-function]: ‘flush’ defined but not used # 3757 | flush(void) # | ^~~~~ # 3755| # 3756| static void # 3757|-> flush(void) # 3758| { # 3759| } Error: COMPILER_WARNING (CWE-563): [#def461] bash-5.3/support/man2html.c:3772:17: warning[-Wunused-variable]: unused variable ‘i’ # 3772 | int i; # | ^ # 3770| char intbuff[NULL_TERMINATED(MED_STR_MAX)]; # 3771| int ibp = 0; # 3772|-> int i; # 3773| char *exbuffer; # 3774| int exbuffpos, exbuffmax, exscaninbuff, exnewline_for_fun; Error: COMPILER_WARNING (CWE-563): [#def462] bash-5.3/support/man2html.c: scope_hint: In function ‘scan_troff’ bash-5.3/support/man2html.c:3831:33: warning[-Wunused-variable]: unused variable ‘mx’ # 3831 | int mx; # | ^~ # 3829| h--; # 3830| } else { # 3831|-> int mx; # 3832| # 3833| if (h[-1] == '\n' && still_dd && isalnum(*h)) { Error: COMPILER_WARNING (CWE-563): [#def463] bash-5.3/support/man2html.c:4001:17: warning[-Wunused-variable]: unused variable ‘f’ # 4001 | FILE *f; # | ^ # 3999| main(int argc, char **argv) # 4000| { # 4001|-> FILE *f; # 4002| char *t; # 4003| int l, i; Error: COMPILER_WARNING (CWE-563): [#def464] bash-5.3/support/man2html.c:4003:17: warning[-Wunused-variable]: unused variable ‘l’ # 4003 | int l, i; # | ^ # 4001| FILE *f; # 4002| char *t; # 4003|-> int l, i; # 4004| char *buf; # 4005| char *h, *fullname; Error: COMPILER_WARNING (CWE-563): [#def465] bash-5.3/support/man2html.c: scope_hint: In function ‘main’ bash-5.3/support/man2html.c:4005:21: warning[-Wunused-variable]: unused variable ‘fullname’ # 4005 | char *h, *fullname; # | ^~~~~~~~ # 4003| int l, i; # 4004| char *buf; # 4005|-> char *h, *fullname; # 4006| STRDEF *stdf; # 4007| Error: GCC_ANALYZER_WARNING (CWE-775): [#def466] bash-5.3/support/mksignames.c:104:3: warning[-Wanalyzer-file-leak]: leak of FILE ‘stream’ bash-5.3/support/mksignames.c:80:6: branch_false: following ‘false’ branch (when ‘argc != 1’)... bash-5.3/support/mksignames.c:85:11: branch_false: ...to here bash-5.3/support/mksignames.c:85:11: branch_true: following ‘true’ branch (when ‘argc == 2’)... bash-5.3/support/mksignames.c:87:7: branch_true: ...to here bash-5.3/support/mksignames.c:88:16: acquire_resource: opened here bash-5.3/support/mksignames.c:96:6: branch_false: following ‘false’ branch (when ‘stream’ is non-NULL)... bash-5.3/support/mksignames.c:104:3: branch_false: ...to here bash-5.3/support/mksignames.c:104:3: throw: if ‘initialize_signames’ throws an exception... bash-5.3/support/mksignames.c:104:3: danger: ‘stream’ leaks here; was opened at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4) # 102| # 103| #if !defined (CROSS_COMPILING) # 104|-> initialize_signames (); # 105| #endif # 106| write_signames (stream); Error: GCC_ANALYZER_WARNING (CWE-401): [#def467] bash-5.3/support/mksignames.c:104:3: warning[-Wanalyzer-malloc-leak]: leak of ‘stream’ bash-5.3/support/mksignames.c:80:6: branch_false: following ‘false’ branch (when ‘argc != 1’)... bash-5.3/support/mksignames.c:85:11: branch_false: ...to here bash-5.3/support/mksignames.c:85:11: branch_true: following ‘true’ branch (when ‘argc == 2’)... bash-5.3/support/mksignames.c:87:7: branch_true: ...to here bash-5.3/support/mksignames.c:88:16: acquire_memory: allocated here bash-5.3/support/mksignames.c:96:6: branch_false: following ‘false’ branch (when ‘stream’ is non-NULL)... bash-5.3/support/mksignames.c:104:3: branch_false: ...to here bash-5.3/support/mksignames.c:104:3: throw: if ‘initialize_signames’ throws an exception... bash-5.3/support/mksignames.c:104:3: danger: ‘stream’ leaks here; was allocated at [(5)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/4) # 102| # 103| #if !defined (CROSS_COMPILING) # 104|-> initialize_signames (); # 105| #endif # 106| write_signames (stream); Error: COMPILER_WARNING (CWE-569): [#def468] bash-5.3/trap.c: scope_hint: In function ‘save_bash_trapsig’ bash-5.3/trap.c:301:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 301 | if (ret = get_string_value ("BASH_TRAPSIG")) # | ^~~ # 299| char *ret; # 300| # 301|-> if (ret = get_string_value ("BASH_TRAPSIG")) # 302| ret = savestring (ret); # 303| return ret; Error: CPPCHECK_WARNING (CWE-457): [#def469] bash-5.3/trap.c:486: error[legacyUninitvar]: Uninitialized variable: save_return_catch # 484| if (return_catch_flag) # 485| { # 486|-> COPY_PROCENV (return_catch, save_return_catch); # 487| function_code = setjmp_nosigs (return_catch); # 488| } Error: CPPCHECK_WARNING (CWE-457): [#def470] bash-5.3/trap.c:1189: error[uninitvar]: Uninitialized variable: save_return_catch # 1187| if (return_catch_flag) # 1188| { # 1189|-> COPY_PROCENV (return_catch, save_return_catch); # 1190| function_code = setjmp_nosigs (return_catch); # 1191| } Error: COMPILER_WARNING (CWE-569): [#def471] bash-5.3/unwind_prot.c: scope_hint: In function ‘unwind_frame_discard_internal’ bash-5.3/unwind_prot.c:232:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 232 | while (elt = unwind_protect_list) # | ^~~ # 230| # 231| found = 0; # 232|-> while (elt = unwind_protect_list) # 233| { # 234| unwind_protect_list = unwind_protect_list->head.next; Error: COMPILER_WARNING (CWE-569): [#def472] bash-5.3/unwind_prot.c: scope_hint: In function ‘unwind_frame_run_internal’ bash-5.3/unwind_prot.c:267:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 267 | while (elt = unwind_protect_list) # | ^~~ # 265| # 266| found = 0; # 267|-> while (elt = unwind_protect_list) # 268| { # 269| unwind_protect_list = elt->head.next; Error: COMPILER_WARNING (CWE-563): [#def473] bash-5.3/variables.c:189:21: warning[-Wunused-variable]: ‘last_context_searched’ defined but not used # 189 | static VAR_CONTEXT *last_context_searched; # | ^~~~~~~~~~~~~~~~~~~~~ # 187| # 188| static HASH_TABLE *last_table_searched; /* hash_lookup sets this */ # 189|-> static VAR_CONTEXT *last_context_searched; # 190| # 191| /* Some forward declarations. */ Error: COMPILER_WARNING (CWE-1164): [#def474] bash-5.3/variables.c: scope_hint: At top level bash-5.3/variables.c:287:13: warning[-Wunused-function]: ‘init_shell_variable’ declared ‘static’ but never defined # 287 | static void init_shell_variable (SHELL_VAR *); # | ^~~~~~~~~~~~~~~~~~~ # 285| static SHELL_VAR *bind_variable_internal (const char *, const char *, HASH_TABLE *, int, int); # 286| # 287|-> static void init_shell_variable (SHELL_VAR *); # 288| # 289| static void dispose_variable_value (SHELL_VAR *); Error: COMPILER_WARNING (CWE-569): [#def475] bash-5.3/variables.c: scope_hint: In function ‘initialize_shell_variables’ bash-5.3/variables.c:428:15: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 428 | if (temp_var = find_function (tname)) # | ^~~~~~~~ # 426| free (temp_string); /* parse_and_execute does this */ # 427| # 428|-> if (temp_var = find_function (tname)) # 429| { # 430| VSETATTR (temp_var, (att_exported|att_imported)); Error: COMPILER_WARNING (CWE-569): [#def476] bash-5.3/variables.c:435:19: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 435 | if (temp_var = bind_invalid_envvar (name, string, 0)) # | ^~~~~~~~ # 433| else # 434| { # 435|-> if (temp_var = bind_invalid_envvar (name, string, 0)) # 436| { # 437| VSETATTR (temp_var, (att_exported | att_imported | att_invisible)); Error: COMPILER_WARNING: [#def477] bash-5.3/variables.c: scope_hint: In function ‘set_machine_vars’ bash-5.3/variables.c:721:14: warning[-Wunused-but-set-variable=]: variable ‘temp_var’ set but not used # 721 | SHELL_VAR *temp_var; # | ^~~~~~~~ # 719| set_machine_vars (void) # 720| { # 721|-> SHELL_VAR *temp_var; # 722| # 723| temp_var = set_if_not ("HOSTTYPE", HOSTTYPE); Error: COMPILER_WARNING (CWE-569): [#def478] bash-5.3/variables.c: scope_hint: In function ‘var_lookup’ bash-5.3/variables.c:1949:9: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 1949 | if (v = hash_lookup (name, vc->table)) # | ^ # 1947| v = (SHELL_VAR *)NULL; # 1948| for (vc = vcontext; vc; vc = vc->down) # 1949|-> if (v = hash_lookup (name, vc->table)) # 1950| break; # 1951| Error: COMPILER_WARNING (CWE-569): [#def479] bash-5.3/variables.c: scope_hint: In function ‘delete_var’ bash-5.3/variables.c:3940:9: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 3940 | if (elt = hash_remove (name, v->table, 0)) # | ^~~ # 3938| # 3939| for (elt = (BUCKET_CONTENTS *)NULL, v = vc; v; v = v->down) # 3940|-> if (elt = hash_remove (name, v->table, 0)) # 3941| break; # 3942| Error: COMPILER_WARNING (CWE-569): [#def480] bash-5.3/variables.c: scope_hint: In function ‘makunbound’ bash-5.3/variables.c:3967:9: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 3967 | if (elt = hash_remove (name, v->table, 0)) # | ^~~ # 3965| # 3966| for (elt = (BUCKET_CONTENTS *)NULL, v = vc; v; v = v->down) # 3967|-> if (elt = hash_remove (name, v->table, 0)) # 3968| break; # 3969| Error: COMPILER_WARNING (CWE-563): [#def481] bash-5.3/variables.c: scope_hint: In function ‘mk_env_string’ bash-5.3/variables.c:4724:15: warning[-Wunused-variable]: unused variable ‘isarray’ # 4724 | int isfunc, isarray; # | ^~~~~~~ # 4722| size_t name_len, value_len; # 4723| char *p, *q, *t; # 4724|-> int isfunc, isarray; # 4725| # 4726| name_len = strlen (name); Error: COMPILER_WARNING (CWE-569): [#def482] bash-5.3/variables.c: scope_hint: In function ‘make_env_array_from_var_list’ bash-5.3/variables.c:4858:31: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 4858 | for (i = 0, list_index = 0; var = vars[i]; i++) # | ^~~ # 4856| list = strvec_create ((1 + strvec_len ((char **)vars))); # 4857| # 4858|-> for (i = 0, list_index = 0; var = vars[i]; i++) # 4859| { # 4860| #if defined (__CYGWIN__) Error: COMPILER_WARNING (CWE-569): [#def483] bash-5.3/variables.c: scope_hint: In function ‘pop_var_context’ bash-5.3/variables.c:5358:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 5358 | if (ret = vcxt->down) # | ^~~ # 5356| } # 5357| # 5358|-> if (ret = vcxt->down) # 5359| { # 5360| ret->up = (VAR_CONTEXT *)NULL; Error: COMPILER_WARNING: [#def484] bash-5.3/variables.c: scope_hint: In function ‘pop_scope’ bash-5.3/variables.c:5452:7: warning[-Wunused-but-set-variable=]: variable ‘is_bltinenv’ set but not used # 5452 | int is_bltinenv; # | ^~~~~~~~~~~ # 5450| { # 5451| VAR_CONTEXT *vcxt, *ret; # 5452|-> int is_bltinenv; # 5453| # 5454| vcxt = shell_variables; Error: COMPILER_WARNING (CWE-569): [#def485] bash-5.3/variables.c: scope_hint: In function ‘sv_history_control’ bash-5.3/variables.c:6125:10: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 6125 | while (val = extract_colon_unit (temp, &tptr)) # | ^~~ # 6123| # 6124| tptr = 0; # 6125|-> while (val = extract_colon_unit (temp, &tptr)) # 6126| { # 6127| if (STREQ (val, "ignorespace")) Error: COMPILER_WARNING (CWE-569): [#def486] bash-5.3/variables.c: scope_hint: In function ‘sv_histtimefmt’ bash-5.3/variables.c:6172:7: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 6172 | if (v = find_variable (name)) # | ^ # 6170| SHELL_VAR *v; # 6171| # 6172|-> if (v = find_variable (name)) # 6173| { # 6174| if (history_comment_char == 0) Error: COMPILER_WARNING: [#def487] bash-5.3/xmalloc.c:123:20: warning[-Walloc-size-larger-than=]: argument 2 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 # 123 | temp = pointer ? realloc (pointer, bytes) : malloc (bytes); # | ^ /usr/include/stdlib.h: scope_hint: In function ‘shell_getc’ /usr/include/stdlib.h:687:14: note: in a call to allocation function ‘realloc’ declared here # 687 | extern void *realloc (void *__ptr, size_t __size) # | ^ # 121| # 122| FINDBRK(); # 123|-> temp = pointer ? realloc (pointer, bytes) : malloc (bytes); # 124| # 125| if (temp == 0) Error: COMPILER_WARNING: [#def488] bash-5.3/xmalloc.c:123:47: warning[-Walloc-size-larger-than=]: argument 1 value ‘18446744073709551615’ exceeds maximum object size 9223372036854775807 # 123 | temp = pointer ? realloc (pointer, bytes) : malloc (bytes); # | ^ /usr/include/stdlib.h: scope_hint: In function ‘shell_getc’ /usr/include/stdlib.h:676:14: note: in a call to allocation function ‘malloc’ declared here # 676 | extern void *malloc (size_t __size) __THROW __attribute_malloc__ # | ^ # 121| # 122| FINDBRK(); # 123|-> temp = pointer ? realloc (pointer, bytes) : malloc (bytes); # 124| # 125| if (temp == 0)
| analyzer-version-clippy | 1.92.0 |
| analyzer-version-cppcheck | 2.19.1 |
| analyzer-version-gcc | 16.0.0 |
| analyzer-version-gcc-analyzer | 16.0.0 |
| analyzer-version-shellcheck | 0.11.0 |
| analyzer-version-unicontrol | 0.0.2 |
| enabled-plugins | clippy, cppcheck, gcc, shellcheck, unicontrol |
| exit-code | 0 |
| host | ip-172-16-1-18.us-west-2.compute.internal |
| known-false-positives | /usr/share/csmock/known-false-positives.js |
| known-false-positives-rpm | known-false-positives-0.0.0.20250521.132812.g8eff701.main-1.el9.noarch |
| mock-config | fedora-rawhide-x86_64 |
| project-name | bash-5.3.9-1.fc44 |
| store-results-to | /tmp/tmpkld9yypl/bash-5.3.9-1.fc44.tar.xz |
| time-created | 2026-01-08 15:32:13 |
| time-finished | 2026-01-08 15:35:19 |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpkld9yypl/bash-5.3.9-1.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpkld9yypl/bash-5.3.9-1.fc44.src.rpm' |
| tool-version | csmock-3.8.3.20251215.161544.g62de9a5-1.el9 |