Error: GCC_ANALYZER_WARNING (CWE-404): [#def1] readline-8.3/bind.c:1145:3: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ readline-8.3/bind.c:2059:1: enter_function: entry to ‘rl_variable_bind’ readline-8.3/bind.c:2074:7: call_function: calling ‘find_string_var’ from ‘rl_variable_bind’ readline-8.3/bind.c:2074:7: return_function: returning to ‘rl_variable_bind’ from ‘find_string_var’ readline-8.3/bind.c:2078:6: branch_false: following ‘false’ branch... readline-8.3/bind.c:2086:6: branch_true: following ‘true’ branch... readline-8.3/bind.c:2087:5: branch_true: ...to here readline-8.3/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): [#def2] readline-8.3/bind.c: scope_hint: In function ‘_rl_skip_to_delim’ readline-8.3/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): [#def3] readline-8.3/bind.c: scope_hint: In function ‘rl_function_dumper’ readline-8.3/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): [#def4] readline-8.3/complete.c: scope_hint: In function ‘print_filename’ readline-8.3/complete.c:1101:22: warning[-Wmaybe-uninitialized]: ‘printed_len’ may be used uninitialized # 1101 | printed_len++; # | ~~~~~~~~~~~^~ readline-8.3/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): [#def5] readline-8.3/complete.c:1105:10: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘printed_len’ readline-8.3/complete.c:3057:1: enter_function: entry to ‘_rl_export_completions’ readline-8.3/complete.c:3061:9: call_function: calling ‘vector_len’ from ‘_rl_export_completions’ readline-8.3/complete.c:3061:9: return_function: returning to ‘_rl_export_completions’ from ‘vector_len’ readline-8.3/complete.c:3068:15: branch_true: following ‘true’ branch... readline-8.3/complete.c:3070:42: branch_true: ...to here readline-8.3/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): [#def6] readline-8.3/complete.c: scope_hint: In function ‘_rl_find_completion_word’ readline-8.3/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): [#def7] readline-8.3/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): [#def8] readline-8.3/complete.c: scope_hint: In function ‘rl_complete_internal’ readline-8.3/complete.c:2178:14: warning[-Wmaybe-uninitialized]: ‘tlen’ may be used uninitialized # 2178 | if (mlen >= tlen) # | ^ readline-8.3/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): [#def9] readline-8.3/complete.c: scope_hint: In function ‘rl_completion_matches’ readline-8.3/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): [#def10] readline-8.3/complete.c: scope_hint: In function ‘rl_username_completion_function’ readline-8.3/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 (CWE-457): [#def11] readline-8.3/display.c: scope_hint: In function ‘rl_redisplay’ readline-8.3/display.c:1487:32: warning[-Wmaybe-uninitialized]: ‘physpos’ may be used uninitialized # 1487 | _rl_last_c_pos = physpos + WRAP_OFFSET (cursor_linenum, wrap_offset); # | ^ readline-8.3/display.c:1472:19: note: ‘physpos’ was declared here # 1472 | int physpos; # | ^~~~~~~ # 1485| for invisible characters. */ # 1486| if ((mb_cur_max == 1 || rl_byte_oriented) && cursor_linenum == prompt_last_screen_line) # 1487|-> _rl_last_c_pos = physpos + WRAP_OFFSET (cursor_linenum, wrap_offset); # 1488| } # 1489| Error: GCC_ANALYZER_WARNING (CWE-404): [#def12] readline-8.3/display.c:3140:15: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ readline-8.3/display.c:3137:3: acquire_resource: ‘va_start’ called here readline-8.3/display.c:3139:6: branch_true: following ‘true’ branch... readline-8.3/display.c:3140:24: branch_true: ...to here readline-8.3/display.c:3140:15: throw: if ‘xmalloc’ throws an exception... readline-8.3/display.c:3140:15: danger: missing call to ‘va_end’ to match ‘va_start’ at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) # 3138| # 3139| if (msg_buf == 0) # 3140|-> msg_buf = xmalloc (msg_bufsiz = 128); # 3141| # 3142| #if defined (HAVE_VSNPRINTF) Error: COMPILER_WARNING (CWE-569): [#def13] readline-8.3/histexpand.c: scope_hint: In function ‘get_history_event’ readline-8.3/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: GCC_ANALYZER_WARNING (CWE-401): [#def14] readline-8.3/histfile.c:204:9: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’ readline-8.3/histfile.c:473:1: enter_function: entry to ‘history_truncate_file’ readline-8.3/histfile.c:484:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:487:10: branch_false: ...to here readline-8.3/histfile.c:493:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:505:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:516:23: branch_false: ...to here readline-8.3/histfile.c:519:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... readline-8.3/histfile.c:532:20: branch_false: ...to here readline-8.3/histfile.c:532:20: acquire_memory: allocated here readline-8.3/histfile.c:533:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... readline-8.3/histfile.c:541:6: branch_false: ...to here readline-8.3/histfile.c:541:6: branch_true: following ‘true’ branch (when ‘lines == 0’)... readline-8.3/histfile.c:543:7: branch_true: ...to here readline-8.3/histfile.c:603:14: call_function: calling ‘history_tempfile’ from ‘history_truncate_file’ # 202| # 203| len = strlen (fn); # 204|-> ret = xmalloc (len + 11); # 205| strcpy (ret, fn); # 206| Error: GCC_ANALYZER_WARNING (CWE-401): [#def15] readline-8.3/histfile.c:204:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ readline-8.3/histfile.c:473:1: enter_function: entry to ‘history_truncate_file’ readline-8.3/histfile.c:484:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:487:10: branch_false: ...to here readline-8.3/histfile.c:493:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:505:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:516:23: branch_false: ...to here readline-8.3/histfile.c:519:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... readline-8.3/histfile.c:532:20: branch_false: ...to here readline-8.3/histfile.c:532:20: acquire_memory: allocated here readline-8.3/histfile.c:533:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... readline-8.3/histfile.c:541:6: branch_false: ...to here readline-8.3/histfile.c:541:6: branch_false: following ‘false’ branch (when ‘lines != 0’)... readline-8.3/histfile.c:549:16: branch_false: ...to here readline-8.3/histfile.c:552:6: branch_false: following ‘false’ branch (when ‘chars_read > 0’)... readline-8.3/histfile.c:557:9: branch_false: ...to here readline-8.3/histfile.c:594:6: branch_false: following ‘false’ branch (when ‘bp > buffer’)... readline-8.3/histfile.c:602:1: branch_false: ...to here readline-8.3/histfile.c:603:14: call_function: calling ‘history_tempfile’ from ‘history_truncate_file’ # 202| # 203| len = strlen (fn); # 204|-> ret = xmalloc (len + 11); # 205| strcpy (ret, fn); # 206| Error: GCC_ANALYZER_WARNING (CWE-401): [#def16] readline-8.3/histfile.c:320:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ readline-8.3/histfile.c:255:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:257:3: branch_false: ...to here readline-8.3/histfile.c:260:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:263:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:275:27: branch_false: ...to here readline-8.3/histfile.c:278:11: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... readline-8.3/histfile.c:284:10: branch_false: ...to here readline-8.3/histfile.c:284:10: branch_false: following ‘false’ branch (when ‘file_size != 0’)... readline-8.3/histfile.c:303:20: branch_false: ...to here readline-8.3/histfile.c:303:20: acquire_memory: allocated here readline-8.3/histfile.c:304:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... readline-8.3/histfile.c:310:16: branch_false: ...to here readline-8.3/histfile.c:312:6: branch_true: following ‘true’ branch (when ‘chars_read < 0’)... readline-8.3/histfile.c:314:3: branch_true: ...to here readline-8.3/histfile.c:319:10: branch_true: following ‘true’ branch... readline-8.3/histfile.c:320:9: branch_true: ...to here readline-8.3/histfile.c:320:9: throw: if ‘close’ throws an exception... readline-8.3/histfile.c:320:9: danger: ‘buffer’ leaks here; was allocated at [(11)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/10) # 318| chars_read = EIO; # 319| if (file >= 0) # 320|-> close (file); # 321| # 322| FREE (input); Error: GCC_ANALYZER_WARNING (CWE-401): [#def17] readline-8.3/histfile.c:330:3: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ readline-8.3/histfile.c:255:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:257:3: branch_false: ...to here readline-8.3/histfile.c:260:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:263:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:275:27: branch_false: ...to here readline-8.3/histfile.c:278:11: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... readline-8.3/histfile.c:284:10: branch_false: ...to here readline-8.3/histfile.c:284:10: branch_false: following ‘false’ branch (when ‘file_size != 0’)... readline-8.3/histfile.c:303:20: branch_false: ...to here readline-8.3/histfile.c:303:20: acquire_memory: allocated here readline-8.3/histfile.c:304:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... readline-8.3/histfile.c:310:16: branch_false: ...to here readline-8.3/histfile.c:312:6: branch_false: following ‘false’ branch (when ‘chars_read >= 0’)... readline-8.3/histfile.c:330:3: branch_false: ...to here readline-8.3/histfile.c:330:3: throw: if ‘close’ throws an exception... readline-8.3/histfile.c:330:3: danger: ‘buffer’ leaks here; was allocated at [(11)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/10) # 328| } # 329| # 330|-> close (file); # 331| # 332| /* Set TO to larger than end of file if negative. */ Error: COMPILER_WARNING: [#def18] readline-8.3/histfile.c: scope_hint: In function ‘history_truncate_file’ readline-8.3/histfile.c:476:49: warning[-Wunused-but-set-variable=]: variable ‘r’ set but not used # 476 | int file, chars_read, rv, orig_lines, exists, r; # | ^ # 474| { # 475| char *buffer, *filename, *tempname, *bp, *bp1; /* bp1 == bp+1 */ # 476|-> int file, chars_read, rv, orig_lines, exists, r; # 477| struct stat finfo, nfinfo; # 478| size_t file_size; Error: GCC_ANALYZER_WARNING (CWE-401): [#def19] readline-8.3/histfile.c:543:7: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ readline-8.3/histfile.c:484:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:487:10: branch_false: ...to here readline-8.3/histfile.c:493:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:505:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:516:23: branch_false: ...to here readline-8.3/histfile.c:519:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... readline-8.3/histfile.c:532:20: branch_false: ...to here readline-8.3/histfile.c:532:20: acquire_memory: allocated here readline-8.3/histfile.c:533:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... readline-8.3/histfile.c:541:6: branch_false: ...to here readline-8.3/histfile.c:541:6: branch_true: following ‘true’ branch (when ‘lines == 0’)... readline-8.3/histfile.c:543:7: branch_true: ...to here readline-8.3/histfile.c:543:7: throw: if ‘close’ throws an exception... readline-8.3/histfile.c:543:7: danger: ‘buffer’ leaks here; was allocated at [(9)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/8) # 541| if (lines == 0) # 542| { # 543|-> close (file); # 544| buffer[chars_read = 0] = '\0'; # 545| bp = buffer; Error: GCC_ANALYZER_WARNING (CWE-401): [#def20] readline-8.3/histfile.c:550:3: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ readline-8.3/histfile.c:484:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:487:10: branch_false: ...to here readline-8.3/histfile.c:493:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:505:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:516:23: branch_false: ...to here readline-8.3/histfile.c:519:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... readline-8.3/histfile.c:532:20: branch_false: ...to here readline-8.3/histfile.c:532:20: acquire_memory: allocated here readline-8.3/histfile.c:533:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... readline-8.3/histfile.c:541:6: branch_false: ...to here readline-8.3/histfile.c:541:6: branch_false: following ‘false’ branch (when ‘lines != 0’)... readline-8.3/histfile.c:549:16: branch_false: ...to here readline-8.3/histfile.c:550:3: throw: if ‘close’ throws an exception... readline-8.3/histfile.c:550:3: danger: ‘buffer’ leaks here; was allocated at [(9)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/8) # 548| # 549| chars_read = read (file, buffer, file_size); # 550|-> close (file); # 551| # 552| if (chars_read <= 0) Error: GCC_ANALYZER_WARNING (CWE-401): [#def21] readline-8.3/histfile.c:606:15: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’ readline-8.3/histfile.c:484:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:487:10: branch_false: ...to here readline-8.3/histfile.c:493:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:505:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:516:23: branch_false: ...to here readline-8.3/histfile.c:519:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... readline-8.3/histfile.c:532:20: branch_false: ...to here readline-8.3/histfile.c:532:20: acquire_memory: allocated here readline-8.3/histfile.c:533:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... readline-8.3/histfile.c:541:6: branch_false: ...to here readline-8.3/histfile.c:541:6: branch_true: following ‘true’ branch (when ‘lines == 0’)... readline-8.3/histfile.c:543:7: branch_true: ...to here readline-8.3/histfile.c:606:15: throw: if ‘open’ throws an exception... readline-8.3/histfile.c:606:15: danger: ‘bp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/6/codeFlows/0/threadFlows/0/locations/8) # 604| # 605| rv = 0; # 606|-> if ((file = open (tempname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0600)) != -1) # 607| { # 608| if (write (file, bp, chars_read - (bp - buffer)) < 0) Error: GCC_ANALYZER_WARNING (CWE-401): [#def22] readline-8.3/histfile.c:606:15: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ readline-8.3/histfile.c:484:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:487:10: branch_false: ...to here readline-8.3/histfile.c:493:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:505:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:516:23: branch_false: ...to here readline-8.3/histfile.c:519:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... readline-8.3/histfile.c:532:20: branch_false: ...to here readline-8.3/histfile.c:532:20: acquire_memory: allocated here readline-8.3/histfile.c:533:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... readline-8.3/histfile.c:541:6: branch_false: ...to here readline-8.3/histfile.c:541:6: branch_false: following ‘false’ branch (when ‘lines != 0’)... readline-8.3/histfile.c:549:16: branch_false: ...to here readline-8.3/histfile.c:552:6: branch_false: following ‘false’ branch (when ‘chars_read > 0’)... readline-8.3/histfile.c:557:9: branch_false: ...to here readline-8.3/histfile.c:594:6: branch_false: following ‘false’ branch (when ‘bp > buffer’)... readline-8.3/histfile.c:602:1: branch_false: ...to here readline-8.3/histfile.c:606:15: throw: if ‘open’ throws an exception... readline-8.3/histfile.c:606:15: danger: ‘buffer’ leaks here; was allocated at [(9)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/8) # 604| # 605| rv = 0; # 606|-> if ((file = open (tempname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0600)) != -1) # 607| { # 608| if (write (file, bp, chars_read - (bp - buffer)) < 0) Error: GCC_ANALYZER_WARNING (CWE-401): [#def23] readline-8.3/histfile.c:608:11: warning[-Wanalyzer-malloc-leak]: leak of ‘bp’ readline-8.3/histfile.c:484:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:487:10: branch_false: ...to here readline-8.3/histfile.c:493:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:505:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:516:23: branch_false: ...to here readline-8.3/histfile.c:519:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... readline-8.3/histfile.c:532:20: branch_false: ...to here readline-8.3/histfile.c:532:20: acquire_memory: allocated here readline-8.3/histfile.c:533:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... readline-8.3/histfile.c:541:6: branch_false: ...to here readline-8.3/histfile.c:541:6: branch_true: following ‘true’ branch (when ‘lines == 0’)... readline-8.3/histfile.c:543:7: branch_true: ...to here readline-8.3/histfile.c:606:6: branch_true: following ‘true’ branch... readline-8.3/histfile.c:608:28: branch_true: ...to here readline-8.3/histfile.c:608:11: throw: if ‘write’ throws an exception... readline-8.3/histfile.c:608:11: danger: ‘bp’ leaks here; was allocated at [(9)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/8) # 606| if ((file = open (tempname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0600)) != -1) # 607| { # 608|-> if (write (file, bp, chars_read - (bp - buffer)) < 0) # 609| { # 610| rv = errno; Error: GCC_ANALYZER_WARNING (CWE-401): [#def24] readline-8.3/histfile.c:608:11: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ readline-8.3/histfile.c:484:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:487:10: branch_false: ...to here readline-8.3/histfile.c:493:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:505:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:516:23: branch_false: ...to here readline-8.3/histfile.c:519:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... readline-8.3/histfile.c:532:20: branch_false: ...to here readline-8.3/histfile.c:532:20: acquire_memory: allocated here readline-8.3/histfile.c:533:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... readline-8.3/histfile.c:541:6: branch_false: ...to here readline-8.3/histfile.c:541:6: branch_false: following ‘false’ branch (when ‘lines != 0’)... readline-8.3/histfile.c:549:16: branch_false: ...to here readline-8.3/histfile.c:552:6: branch_false: following ‘false’ branch (when ‘chars_read > 0’)... readline-8.3/histfile.c:557:9: branch_false: ...to here readline-8.3/histfile.c:594:6: branch_false: following ‘false’ branch (when ‘bp > buffer’)... readline-8.3/histfile.c:602:1: branch_false: ...to here readline-8.3/histfile.c:606:6: branch_true: following ‘true’ branch... readline-8.3/histfile.c:608:28: branch_true: ...to here readline-8.3/histfile.c:608:11: throw: if ‘write’ throws an exception... readline-8.3/histfile.c:608:11: danger: ‘buffer’ leaks here; was allocated at [(9)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/8) # 606| if ((file = open (tempname, O_WRONLY|O_CREAT|O_TRUNC|O_BINARY, 0600)) != -1) # 607| { # 608|-> if (write (file, bp, chars_read - (bp - buffer)) < 0) # 609| { # 610| rv = errno; Error: GCC_ANALYZER_WARNING (CWE-1341): [#def25] readline-8.3/histfile.c:620:22: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘open(history_tempfile(history_filename(fname)), 577, 384)’ readline-8.3/histfile.c:484:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:487:10: branch_false: ...to here readline-8.3/histfile.c:493:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:505:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:516:23: branch_false: ...to here readline-8.3/histfile.c:519:7: branch_false: following ‘false’ branch (when ‘file_size != 18446744073709551615’)... readline-8.3/histfile.c:532:20: branch_false: ...to here readline-8.3/histfile.c:533:6: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... readline-8.3/histfile.c:541:6: branch_false: ...to here readline-8.3/histfile.c:606:6: branch_true: following ‘true’ branch... readline-8.3/histfile.c:608:28: branch_true: ...to here readline-8.3/histfile.c:614:11: branch_true: following ‘true’ branch... readline-8.3/histfile.c:616:16: branch_true: ...to here readline-8.3/histfile.c:617:11: release_resource: first ‘close’ here readline-8.3/histfile.c:620:10: branch_true: following ‘true’ branch (when ‘rv == 0’)... readline-8.3/histfile.c:620:22: branch_true: ...to here readline-8.3/histfile.c:620:22: danger: second ‘close’ here; first ‘close’ was at [(15)](sarif:/runs/0/results/10/codeFlows/0/threadFlows/0/locations/14) # 618| } # 619| # 620|-> if (rv == 0 && close (file) < 0) # 621| rv = errno; # 622| } Error: GCC_ANALYZER_WARNING (CWE-401): [#def26] readline-8.3/histfile.c:676:7: warning[-Wanalyzer-malloc-leak]: leak of ‘fp’ readline-8.3/histfile.c:665:8: acquire_memory: allocated here readline-8.3/histfile.c:666:6: branch_false: following ‘false’ branch (when ‘fp’ is non-NULL)... readline-8.3/histfile.c:669:12: branch_false: ...to here readline-8.3/histfile.c:676:7: throw: if ‘fflush’ throws an exception... readline-8.3/histfile.c:676:7: danger: ‘fp’ leaks here; was allocated at [(1)](sarif:/runs/0/results/11/codeFlows/0/threadFlows/0/locations/0) # 674| goto slow_write_error; # 675| } # 676|-> if (fflush (fp) < 0) # 677| { # 678| slow_write_error: Error: GCC_ANALYZER_WARNING (CWE-401): [#def27] readline-8.3/histfile.c:813:9: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ readline-8.3/histfile.c:718:10: branch_true: following ‘true’ branch (when ‘output’ is non-NULL)... readline-8.3/histfile.c:718:19: branch_true: ...to here readline-8.3/histfile.c:721:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:733:7: branch_false: ...to here readline-8.3/histfile.c:746:59: branch_false: following ‘false’ branch... readline-8.3/histfile.c:777:22: branch_false: ...to here readline-8.3/histfile.c:777:22: acquire_memory: allocated here readline-8.3/histfile.c:778:8: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... readline-8.3/histfile.c:793:14: branch_false: ...to here readline-8.3/histfile.c:793:42: branch_false: following ‘false’ branch... readline-8.3/histfile.c:813:9: branch_false: ...to here readline-8.3/histfile.c:813:9: throw: if ‘write’ throws an exception... readline-8.3/histfile.c:813:9: danger: ‘buffer’ leaks here; was allocated at [(7)](sarif:/runs/0/results/12/codeFlows/0/threadFlows/0/locations/6) # 811| rv = errno; # 812| #else # 813|-> if (write (file, buffer, buffer_size) < 0) # 814| rv = errno; # 815| xfree (buffer); Error: GCC_ANALYZER_WARNING (CWE-401): [#def28] readline-8.3/histfile.c:815:5: warning[-Wanalyzer-malloc-leak]: leak of ‘buffer’ readline-8.3/histfile.c:718:10: branch_true: following ‘true’ branch (when ‘output’ is non-NULL)... readline-8.3/histfile.c:718:19: branch_true: ...to here readline-8.3/histfile.c:721:6: branch_false: following ‘false’ branch... readline-8.3/histfile.c:733:7: branch_false: ...to here readline-8.3/histfile.c:746:59: branch_false: following ‘false’ branch... readline-8.3/histfile.c:777:22: branch_false: ...to here readline-8.3/histfile.c:777:22: acquire_memory: allocated here readline-8.3/histfile.c:778:8: branch_false: following ‘false’ branch (when ‘buffer’ is non-NULL)... readline-8.3/histfile.c:793:14: branch_false: ...to here readline-8.3/histfile.c:793:42: branch_false: following ‘false’ branch... readline-8.3/histfile.c:813:9: branch_false: ...to here readline-8.3/histfile.c:815:5: throw: if ‘xfree’ throws an exception... readline-8.3/histfile.c:815:5: danger: ‘buffer’ leaks here; was allocated at [(7)](sarif:/runs/0/results/13/codeFlows/0/threadFlows/0/locations/6) # 813| if (write (file, buffer, buffer_size) < 0) # 814| rv = errno; # 815|-> xfree (buffer); # 816| #endif # 817| } Error: COMPILER_WARNING (CWE-569): [#def29] readline-8.3/histsearch.c: scope_hint: In function ‘_hs_history_patsearch’ readline-8.3/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): [#def30] readline-8.3/input.c: scope_hint: In function ‘rl_read_key’ readline-8.3/input.c:798:11: warning[-Wparentheses]: suggest parentheses around assignment used as truth value # 798 | if (c = _rl_next_macro_key ()) # | ^ # 796| { # 797| /* If input is coming from a macro, then use that. */ # 798|-> if (c = _rl_next_macro_key ()) # 799| return ((unsigned char)c); # 800| Error: COMPILER_WARNING: [#def31] readline-8.3/isearch.c: scope_hint: In function ‘rl_search_history’ readline-8.3/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): [#def32] readline-8.3/kill.c:202:12: warning[-Wanalyzer-infinite-recursion]: infinite recursion readline-8.3/kill.c:197:1: enter_function: entry to ‘rl_kill_word’ readline-8.3/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): [#def33] readline-8.3/kill.c:225:12: warning[-Wanalyzer-infinite-recursion]: infinite recursion readline-8.3/kill.c:220:1: enter_function: entry to ‘rl_backward_kill_word’ readline-8.3/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): [#def34] readline-8.3/kill.c:494:12: warning[-Wanalyzer-infinite-recursion]: infinite recursion readline-8.3/kill.c:491:1: enter_function: entry to ‘rl_copy_forward_word’ readline-8.3/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): [#def35] readline-8.3/kill.c:503:12: warning[-Wanalyzer-infinite-recursion]: infinite recursion readline-8.3/kill.c:500:1: enter_function: entry to ‘rl_copy_backward_word’ readline-8.3/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): [#def36] readline-8.3/misc.c: scope_hint: In function ‘_rl_revert_previous_lines’ readline-8.3/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): [#def37] readline-8.3/misc.c: scope_hint: In function ‘rl_clear_history’ readline-8.3/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): [#def38] readline-8.3/misc.c:623:12: warning[-Wanalyzer-infinite-recursion]: infinite recursion readline-8.3/misc.c:618:1: enter_function: entry to ‘rl_get_next_history’ readline-8.3/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: [#def39] readline-8.3/parens.c: scope_hint: In function ‘rl_insert_close’ readline-8.3/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): [#def40] readline-8.3/readline.c:76: included_from: Included from here. readline-8.3/parse-colors.h: scope_hint: At top level readline-8.3/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-563): [#def41] readline-8.3/readline.c:576:21: warning[-Wunused-variable]: unused variable ‘eof_found’ # 576 | static int lastc, eof_found; # | ^~~~~~~~~ # 574| #endif # 575| { # 576|-> static int lastc, eof_found; # 577| int c, code, lk, r; # 578| static procenv_t olevel; Error: COMPILER_WARNING: [#def42] readline-8.3/readline.c: scope_hint: In function ‘readline_internal_char’ readline-8.3/readline.c:577:20: warning[-Wunused-but-set-variable=]: variable ‘r’ set but not used # 577 | int c, code, lk, r; # | ^ # 575| { # 576| static int lastc, eof_found; # 577|-> int c, code, lk, r; # 578| static procenv_t olevel; # 579| Error: COMPILER_WARNING (CWE-563): [#def43] readline-8.3/signals.c: scope_hint: In function ‘rl_set_signals’ readline-8.3/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): [#def44] readline-8.3/text.c:101:3: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘string’ readline-8.3/text.c:2358:1: enter_function: entry to ‘rl_execute_named_command’ readline-8.3/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: [#def45] readline-8.3/text.c: scope_hint: In function ‘rl_insert_text’ readline-8.3/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); # | ^ readline-8.3/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): [#def46] readline-8.3/text.c:397:12: warning[-Wanalyzer-infinite-recursion]: infinite recursion readline-8.3/text.c:394:1: enter_function: entry to ‘rl_backward_byte’ readline-8.3/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: [#def47] readline-8.3/text.c: scope_hint: In function ‘rl_insert’ readline-8.3/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): [#def48] readline-8.3/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): [#def49] readline-8.3/tilde.c: scope_hint: In function ‘tilde_expand’ readline-8.3/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): [#def50] readline-8.3/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): [#def51] readline-8.3/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): [#def52] readline-8.3/util.c:243:3: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ readline-8.3/util.c:238:3: acquire_resource: ‘va_start’ called here readline-8.3/util.c:243:3: throw: if ‘fflush’ throws an exception... readline-8.3/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): [#def53] readline-8.3/util.c:260:3: warning[-Wanalyzer-va-list-leak]: missing call to ‘va_end’ readline-8.3/util.c:255:3: acquire_resource: ‘va_start’ called here readline-8.3/util.c:260:3: throw: if ‘fflush’ throws an exception... readline-8.3/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: COMPILER_WARNING: [#def54] readline-8.3/vi_mode.c: scope_hint: In function ‘rl_vi_fword’ readline-8.3/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: [#def55] readline-8.3/vi_mode.c: scope_hint: In function ‘rl_vi_change_char’ readline-8.3/vi_mode.c:2124:7: warning[-Wstringop-truncation]: ‘strncpy’ output may be truncated copying 16 bytes from a string of length 16 # 2124 | strncpy (mb, _rl_vi_last_replacement, MB_LEN_MAX); # | ^ # 2122| if (_rl_vi_redoing) # 2123| { # 2124|-> strncpy (mb, _rl_vi_last_replacement, MB_LEN_MAX); # 2125| c = (unsigned char)_rl_vi_last_replacement[0]; /* XXX */ # 2126| mb[MB_LEN_MAX] = '\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-95.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 | readline-8.3-3.fc44 |
| store-results-to | /tmp/tmpyww1vk8s/readline-8.3-3.fc44.tar.xz |
| time-created | 2026-01-08 21:34:15 |
| time-finished | 2026-01-08 21:36:01 |
| tool | csmock |
| tool-args | '/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'gcc,cppcheck,clippy,shellcheck,unicontrol' '-o' '/tmp/tmpyww1vk8s/readline-8.3-3.fc44.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpyww1vk8s/readline-8.3-3.fc44.src.rpm' |
| tool-version | csmock-3.8.3.20251215.161544.g62de9a5-1.el9 |