Task #119208 - added.err
back to task #119208download
Error: CPPCHECK_WARNING (CWE-401):
lsof-4.99.6-rh/lib/dialects/linux/dmnt.c:144: error[memleakOnRealloc]: Common realloc mistake: 'cvt_str' nulled but not freed upon failure
# 142| */
# 143| cvt_len += 64; /* (Make an arbitrary increase.) */
# 144|-> if (!(cvt_str = (char *)realloc(cvt_str, cvt_len + 1))) {
# 145| (void)fprintf(
# 146| stderr, "%s: can't realloc %d bytes for octal-escaping.\n",
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/dialects/linux/dnode.c: scope_hint: In function 'process_proc_node'
lsof-4.99.6-rh/lib/dialects/linux/dnode.c:716:11: warning[-Wunused-variable]: unused variable 'tn'
# 716 | char *tn;
# | ^~
# 714| struct mounts *mp = (struct mounts *)NULL;
# 715| size_t sz;
# 716|-> char *tn;
# 717| /*
# 718| * Set the access mode, if possible.
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/dialects/linux/dnode.c: scope_hint: In function ‘process_proc_node’
lsof-4.99.6-rh/lib/dialects/linux/dnode.c:716:11: warning[-Wunused-variable]: unused variable ‘tn’
# 716 | char *tn;
# | ^~
# 714| struct mounts *mp = (struct mounts *)NULL;
# 715| size_t sz;
# 716|-> char *tn;
# 717| /*
# 718| * Set the access mode, if possible.
Error: CPPCHECK_WARNING (CWE-401):
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:316: error[memleakOnRealloc]: Common realloc mistake: 'pidpath' nulled but not freed upon failure
# 314| if ((pidx + n + 1 + 1) > pidpathl) {
# 315| pidpathl = pidx + n + 1 + 1 + 64;
# 316|-> if (!(pidpath = (char *)realloc((MALLOC_P *)pidpath, pidpathl))) {
# 317| (void)fprintf(stderr,
# 318| "%s: can't allocate %d bytes for \"%s/%s/\"\n",
Error: CPPCHECK_WARNING (CWE-401):
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:387: error[memleakOnRealloc]: Common realloc mistake: 'tidpath' nulled but not freed upon failure
# 385| tidpathl = tx + 1 + n + 1 + 4 + 64;
# 386| if (tidpath)
# 387|-> tidpath =
# 388| (char *)realloc((MALLOC_P *)tidpath, tidpathl);
# 389| else
Error: GCC_ANALYZER_WARNING (CWE-775):
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:855:13: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(p, m)'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:210:6: enter_function: entry to 'gather_proc_info'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:308:12: branch_true: following 'true' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:309:19: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:328:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:330:9: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:20: call_function: calling 'read_id_stat' from 'gather_proc_info'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:20: return_function: returning to 'gather_proc_info' from 'read_id_stat'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:12: branch_true: following 'true' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:337:13: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:427:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:427:12: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:308:12: branch_true: following 'true' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:309:19: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:309:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:314:14: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:314:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:323:15: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:328:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:330:9: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:335:15: call_function: calling 'make_proc_path' from 'gather_proc_info'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:335:15: return_function: returning to 'gather_proc_info' from 'make_proc_path'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:20: call_function: calling 'read_id_stat' from 'gather_proc_info'
# 853| */
# 854| if (!(tsz = *sz)) {
# 855|-> if (!psz)
# 856| psz = getpagesize();
# 857| tsz = psz;
Error: GCC_ANALYZER_WARNING (CWE-775):
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:855:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(p, m)’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:210:6: enter_function: entry to ‘gather_proc_info’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:308:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:309:19: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:328:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:330:9: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:20: call_function: calling ‘read_id_stat’ from ‘gather_proc_info’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:20: return_function: returning to ‘gather_proc_info’ from ‘read_id_stat’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:337:13: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:427:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:427:12: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:308:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:309:19: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:309:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:314:14: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:314:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:323:15: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:328:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:330:9: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:335:15: call_function: calling ‘make_proc_path’ from ‘gather_proc_info’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:335:15: return_function: returning to ‘gather_proc_info’ from ‘make_proc_path’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:20: call_function: calling ‘read_id_stat’ from ‘gather_proc_info’
# 853| */
# 854| if (!(tsz = *sz)) {
# 855|-> if (!psz)
# 856| psz = getpagesize();
# 857| tsz = psz;
Error: GCC_ANALYZER_WARNING (CWE-401):
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:855:13: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(p, m)'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:210:6: enter_function: entry to 'gather_proc_info'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:308:12: branch_true: following 'true' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:309:19: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:328:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:330:9: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:20: call_function: calling 'read_id_stat' from 'gather_proc_info'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:20: return_function: returning to 'gather_proc_info' from 'read_id_stat'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:12: branch_true: following 'true' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:337:13: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:427:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:427:12: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:308:12: branch_true: following 'true' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:309:19: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:309:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:314:14: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:314:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:323:15: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:328:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:330:9: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:335:15: call_function: calling 'make_proc_path' from 'gather_proc_info'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:335:15: return_function: returning to 'gather_proc_info' from 'make_proc_path'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:20: call_function: calling 'read_id_stat' from 'gather_proc_info'
# 853| */
# 854| if (!(tsz = *sz)) {
# 855|-> if (!psz)
# 856| psz = getpagesize();
# 857| tsz = psz;
Error: GCC_ANALYZER_WARNING (CWE-401):
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:855:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(p, m)’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:210:6: enter_function: entry to ‘gather_proc_info’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:308:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:309:19: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:328:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:330:9: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:20: call_function: calling ‘read_id_stat’ from ‘gather_proc_info’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:20: return_function: returning to ‘gather_proc_info’ from ‘read_id_stat’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:337:13: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:427:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:427:12: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:308:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:309:19: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:309:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:314:14: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:314:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:323:15: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:328:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:330:9: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:335:15: call_function: calling ‘make_proc_path’ from ‘gather_proc_info’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:335:15: return_function: returning to ‘gather_proc_info’ from ‘make_proc_path’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:336:20: call_function: calling ‘read_id_stat’ from ‘gather_proc_info’
# 853| */
# 854| if (!(tsz = *sz)) {
# 855|-> if (!psz)
# 856| psz = getpagesize();
# 857| tsz = psz;
Error: GCC_ANALYZER_WARNING (CWE-775):
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:862:10: warning[-Wanalyzer-file-leak]: leak of FILE 'fopen(p, m)'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:839:16: acquire_resource: opened here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:839:8: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:849:8: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:849:8: branch_false: following 'false' branch (when 'buf' is non-NULL)...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:854:10: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:862:8: branch_true: following 'true' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:863:30: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:862:10: danger: 'fopen(p, m)' leaks here; was opened at [(1)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/0)
# 860| * Allocate a buffer for the stream, as required.
# 861| */
# 862|-> if (!*buf) {
# 863| if (!(*buf = (char *)malloc((MALLOC_S)tsz))) {
# 864| (void)fprintf(stderr,
Error: GCC_ANALYZER_WARNING (CWE-775):
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:862:10: warning[-Wanalyzer-file-leak]: leak of FILE 'open_proc_stream(ctx, p, "r", & vbuf, & vsz, 0)'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1429:1: enter_function: entry to 'process_proc_map'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1458:16: call_function: calling 'open_proc_stream' from 'process_proc_map'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1458:16: return_function: returning to 'process_proc_map' from 'open_proc_stream'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1458:8: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1462:23: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1462:8: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1462:8: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1465:12: branch_true: following 'true' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1466:13: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1487:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1498:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1500:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1506:12: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1513:21: branch_false: following 'false' branch (when 'i >= ns')...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1517:12: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1517:12: branch_false: following 'false' branch (when 'i >= ns')...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1522:13: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1522:12: branch_true: following 'true' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1523:17: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1525:16: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1528:42: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:862:10: danger: 'open_proc_stream(ctx, p, "r", & vbuf, & vsz, 0)' leaks here; was opened at [(4)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/3)
# 860| * Allocate a buffer for the stream, as required.
# 861| */
# 862|-> if (!*buf) {
# 863| if (!(*buf = (char *)malloc((MALLOC_S)tsz))) {
# 864| (void)fprintf(stderr,
Error: GCC_ANALYZER_WARNING (CWE-775):
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:862:10: warning[-Wanalyzer-file-leak]: leak of FILE ‘open_proc_stream(ctx, p, "r", & vbuf, & vsz, 0)’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1429:1: enter_function: entry to ‘process_proc_map’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1458:16: call_function: calling ‘open_proc_stream’ from ‘process_proc_map’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1458:16: return_function: returning to ‘process_proc_map’ from ‘open_proc_stream’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1458:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1462:23: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1462:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1462:8: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1465:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1466:13: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1487:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1498:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1500:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1506:12: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1513:21: branch_false: following ‘false’ branch (when ‘i >= ns’)...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1517:12: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1517:12: branch_false: following ‘false’ branch (when ‘i >= ns’)...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1522:13: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1522:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1523:17: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1525:16: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1528:42: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:862:10: danger: ‘open_proc_stream(ctx, p, "r", & vbuf, & vsz, 0)’ leaks here; was opened at [(4)](sarif:/runs/0/results/8/codeFlows/0/threadFlows/0/locations/3)
# 860| * Allocate a buffer for the stream, as required.
# 861| */
# 862|-> if (!*buf) {
# 863| if (!(*buf = (char *)malloc((MALLOC_S)tsz))) {
# 864| (void)fprintf(stderr,
Error: GCC_ANALYZER_WARNING (CWE-401):
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:862:10: warning[-Wanalyzer-malloc-leak]: leak of 'fopen(p, m)'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:839:16: acquire_memory: allocated here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:839:8: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:849:8: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:849:8: branch_false: following 'false' branch (when 'buf' is non-NULL)...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:854:10: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:862:8: branch_true: following 'true' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:863:30: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:862:10: danger: 'fopen(p, m)' leaks here; was allocated at [(1)](sarif:/runs/0/results/5/codeFlows/0/threadFlows/0/locations/0)
# 860| * Allocate a buffer for the stream, as required.
# 861| */
# 862|-> if (!*buf) {
# 863| if (!(*buf = (char *)malloc((MALLOC_S)tsz))) {
# 864| (void)fprintf(stderr,
Error: GCC_ANALYZER_WARNING (CWE-401):
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:862:10: warning[-Wanalyzer-malloc-leak]: leak of 'open_proc_stream(ctx, p, "r", & vbuf, & vsz, 0)'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1429:1: enter_function: entry to 'process_proc_map'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1458:16: call_function: calling 'open_proc_stream' from 'process_proc_map'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1458:16: return_function: returning to 'process_proc_map' from 'open_proc_stream'
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1458:8: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1462:23: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1462:8: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1462:8: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1465:12: branch_true: following 'true' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1466:13: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1487:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1498:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1500:12: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1506:12: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1513:21: branch_false: following 'false' branch (when 'i >= ns')...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1517:12: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1517:12: branch_false: following 'false' branch (when 'i >= ns')...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1522:13: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1522:12: branch_true: following 'true' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1523:17: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1525:16: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1528:42: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:862:10: danger: 'open_proc_stream(ctx, p, "r", & vbuf, & vsz, 0)' leaks here; was allocated at [(4)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/3)
# 860| * Allocate a buffer for the stream, as required.
# 861| */
# 862|-> if (!*buf) {
# 863| if (!(*buf = (char *)malloc((MALLOC_S)tsz))) {
# 864| (void)fprintf(stderr,
Error: GCC_ANALYZER_WARNING (CWE-401):
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:862:10: warning[-Wanalyzer-malloc-leak]: leak of ‘open_proc_stream(ctx, p, "r", & vbuf, & vsz, 0)’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1429:1: enter_function: entry to ‘process_proc_map’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1458:16: call_function: calling ‘open_proc_stream’ from ‘process_proc_map’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1458:16: return_function: returning to ‘process_proc_map’ from ‘open_proc_stream’
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1458:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1462:23: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1462:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1462:8: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1465:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1466:13: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1487:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1498:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1500:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1506:12: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1513:21: branch_false: following ‘false’ branch (when ‘i >= ns’)...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1517:12: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1517:12: branch_false: following ‘false’ branch (when ‘i >= ns’)...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1522:13: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1522:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1523:17: branch_true: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1525:16: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:1528:42: branch_false: ...to here
lsof-4.99.6-rh/lib/dialects/linux/dproc.c:862:10: danger: ‘open_proc_stream(ctx, p, "r", & vbuf, & vsz, 0)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/9/codeFlows/0/threadFlows/0/locations/3)
# 860| * Allocate a buffer for the stream, as required.
# 861| */
# 862|-> if (!*buf) {
# 863| if (!(*buf = (char *)malloc((MALLOC_S)tsz))) {
# 864| (void)fprintf(stderr,
Error: COMPILER_WARNING (CWE-1164):
lsof-4.99.6-rh/lib/dialects/linux/dsock.c: scope_hint: At top level
lsof-4.99.6-rh/lib/dialects/linux/dsock.c:372:14: warning[-Wunused-function]: 'socket_state_to_str' declared 'static' but never defined
# 372 | static char *socket_state_to_str(struct lsof_context *ctx, unsigned int ss);
# | ^~~~~~~~~~~~~~~~~~~
# 370| static char *netlink_proto_to_str(unsigned int pr);
# 371| #if defined(HASSOSTATE)
# 372|-> static char *socket_state_to_str(struct lsof_context *ctx, unsigned int ss);
# 373| #endif /* defined(HASSOSTATE) */
# 374| static char *ethernet_proto_to_str(unsigned int pr);
Error: COMPILER_WARNING (CWE-1164):
lsof-4.99.6-rh/lib/dialects/linux/dsock.c: scope_hint: At top level
lsof-4.99.6-rh/lib/dialects/linux/dsock.c:372:14: warning[-Wunused-function]: ‘socket_state_to_str’ declared ‘static’ but never defined
# 372 | static char *socket_state_to_str(struct lsof_context *ctx, unsigned int ss);
# | ^~~~~~~~~~~~~~~~~~~
# 370| static char *netlink_proto_to_str(unsigned int pr);
# 371| #if defined(HASSOSTATE)
# 372|-> static char *socket_state_to_str(struct lsof_context *ctx, unsigned int ss);
# 373| #endif /* defined(HASSOSTATE) */
# 374| static char *ethernet_proto_to_str(unsigned int pr);
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/dialects/linux/dsock.c: scope_hint: In function 'prt_uxs'
lsof-4.99.6-rh/lib/dialects/linux/dsock.c:1076:9: warning[-Wunused-variable]: unused variable 'i'
# 1076 | int i; /* temporary index */
# | ^
# 1074| struct lproc *ep; /* socket endpoint process */
# 1075| struct lfile *ef; /* socket endpoint file */
# 1076|-> int i; /* temporary index */
# 1077| int len; /* string length */
# 1078| char nma[1024]; /* character buffer */
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/dialects/linux/dsock.c: scope_hint: In function ‘prt_uxs’
lsof-4.99.6-rh/lib/dialects/linux/dsock.c:1076:9: warning[-Wunused-variable]: unused variable ‘i’
# 1076 | int i; /* temporary index */
# | ^
# 1074| struct lproc *ep; /* socket endpoint process */
# 1075| struct lfile *ef; /* socket endpoint file */
# 1076|-> int i; /* temporary index */
# 1077| int len; /* string length */
# 1078| char nma[1024]; /* character buffer */
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/dialects/linux/dsock.c: scope_hint: In function 'prt_nets_common'
lsof-4.99.6-rh/lib/dialects/linux/dsock.c:1244:9: warning[-Wunused-variable]: unused variable 'i'
# 1244 | int i; /* temporary index */
# | ^
# 1242| struct lproc *ep; /* socket endpoint process */
# 1243| struct lfile *ef; /* socket endpoint file */
# 1244|-> int i; /* temporary index */
# 1245| char nma[1024]; /* character buffer */
# 1246| pxinfo_t *pp; /* previous pipe info of socket */
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/dialects/linux/dsock.c: scope_hint: In function ‘prt_nets_common’
lsof-4.99.6-rh/lib/dialects/linux/dsock.c:1244:9: warning[-Wunused-variable]: unused variable ‘i’
# 1244 | int i; /* temporary index */
# | ^
# 1242| struct lproc *ep; /* socket endpoint process */
# 1243| struct lfile *ef; /* socket endpoint file */
# 1244|-> int i; /* temporary index */
# 1245| char nma[1024]; /* character buffer */
# 1246| pxinfo_t *pp; /* previous pipe info of socket */
Error: CPPCHECK_WARNING (CWE-401):
lsof-4.99.6-rh/lib/dialects/linux/dsock.c:2386: error[memleakOnRealloc]: Common realloc mistake: 'la' nulled but not freed upon failure
# 2384| len = strlen(ta);
# 2385| plen = strlen(la);
# 2386|-> if (!(la = (char *)realloc((MALLOC_P *)la,
# 2387| plen + len + 2))) {
# 2388| (void)fprintf(
Error: CPPCHECK_WARNING (CWE-401):
lsof-4.99.6-rh/lib/dialects/linux/dsock.c:2417: error[memleakOnRealloc]: Common realloc mistake: 'ra' nulled but not freed upon failure
# 2415| len = strlen(ta);
# 2416| plen = strlen(ra);
# 2417|-> if (!(ra = (char *)realloc((MALLOC_P *)ra,
# 2418| plen + len + 2))) {
# 2419| (void)fprintf(
Error: COMPILER_WARNING:
lsof-4.99.6-rh/lib/dialects/linux/dsock.c: scope_hint: In function 'get_sctpaddrs'
lsof-4.99.6-rh/lib/dialects/linux/dsock.c:2486:15: warning[-Wstringop-truncation]: 'strncpy' specified bound depends on the length of the source argument
# 2486 | (void)strncpy(al ? (cp + al) : cp, fp[i], tl);
# | ^
lsof-4.99.6-rh/lib/dialects/linux/dsock.c:2470:54: note: length computed here
# 2470 | if ((i >= nf) || !fp[i] || !*fp[i] || !(tl = strlen(fp[i])))
# | ^~~~~~~~~~~~~
# 2484| if (al)
# 2485| *(cp + al - 1) = ',';
# 2486|-> (void)strncpy(al ? (cp + al) : cp, fp[i], tl);
# 2487| al += (tl + 1);
# 2488| *(cp + al - 1) = '\0';
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/lsof.c:254:10: warning[-Wunused-variable]: unused variable 'buf'
# 254 | char buf[64];
# | ^~~
# 252| size_t sel_procs = 0;
# 253| char *cp;
# 254|-> char buf[64];
# 255| int s;
# 256| struct str_lst *str;
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/lsof.c:254:10: warning[-Wunused-variable]: unused variable ‘buf’
# 254 | char buf[64];
# | ^~~
# 252| size_t sel_procs = 0;
# 253| char *cp;
# 254|-> char buf[64];
# 255| int s;
# 256| struct str_lst *str;
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/lsof.c: scope_hint: In function 'lsof_gather'
lsof-4.99.6-rh/lib/lsof.c:255:9: warning[-Wunused-variable]: unused variable 's'
# 255 | int s;
# | ^
# 253| char *cp;
# 254| char buf[64];
# 255|-> int s;
# 256| struct str_lst *str;
# 257| struct sfile *sfp;
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/lsof.c: scope_hint: In function ‘lsof_gather’
lsof-4.99.6-rh/lib/lsof.c:255:9: warning[-Wunused-variable]: unused variable ‘s’
# 255 | int s;
# | ^
# 253| char *cp;
# 254| char buf[64];
# 255|-> int s;
# 256| struct str_lst *str;
# 257| struct sfile *sfp;
Error: CPPCHECK_WARNING (CWE-476):
lsof-4.99.6-rh/lib/lsof.c:305: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: user_procs
# 303| struct lsof_process *user_procs =
# 304| (struct lsof_process *)malloc(sizeof(struct lsof_process) * sel_procs);
# 305|-> memset(user_procs, 0, sizeof(struct lsof_process) * sel_procs);
# 306|
# 307| for (pi = 0, upi = 0; pi < ctx->procs_size; pi++) {
Error: GCC_ANALYZER_WARNING (CWE-688):
lsof-4.99.6-rh/lib/lsof.c:305:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'user_procs' where non-null expected
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following 'false' branch (when 'result' is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:285:8: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/lsof.c:293:5: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:304:32: acquire_memory: this call could return NULL
lsof-4.99.6-rh/lib/lsof.c:305:5: danger: argument 1 ('user_procs') from [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4) could be NULL where non-null expected
# 303| struct lsof_process *user_procs =
# 304| (struct lsof_process *)malloc(sizeof(struct lsof_process) * sel_procs);
# 305|-> memset(user_procs, 0, sizeof(struct lsof_process) * sel_procs);
# 306|
# 307| for (pi = 0, upi = 0; pi < ctx->procs_size; pi++) {
Error: GCC_ANALYZER_WARNING (CWE-688):
lsof-4.99.6-rh/lib/lsof.c:305:5: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘user_procs’ where non-null expected
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:285:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/lsof.c:293:5: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:304:32: acquire_memory: this call could return NULL
lsof-4.99.6-rh/lib/lsof.c:305:5: danger: argument 1 (‘user_procs’) from [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4) could be NULL where non-null expected
# 303| struct lsof_process *user_procs =
# 304| (struct lsof_process *)malloc(sizeof(struct lsof_process) * sel_procs);
# 305|-> memset(user_procs, 0, sizeof(struct lsof_process) * sel_procs);
# 306|
# 307| for (pi = 0, upi = 0; pi < ctx->procs_size; pi++) {
Error: GCC_ANALYZER_WARNING (CWE-688):
lsof-4.99.6-rh/lib/lsof.c:346:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'malloc(num_files * 88)' where non-null expected
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following 'false' branch (when 'result' is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:285:8: branch_true: following 'true' branch...
lsof-4.99.6-rh/lib/lsof.c:286:9: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following 'true' branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following 'true' branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:338:33: branch_false: following 'false' branch (when 'lf' is NULL)...
lsof-4.99.6-rh/lib/lsof.c:344:44: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:344:44: acquire_memory: this call could return NULL
lsof-4.99.6-rh/lib/lsof.c:346:13: danger: argument 1 ('malloc(num_files * 88)') from [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10) could be NULL where non-null expected
# 344| p->files = (struct lsof_file *)malloc(sizeof(struct lsof_file) *
# 345| num_files);
# 346|-> memset(p->files, 0, sizeof(struct lsof_file) * num_files);
# 347| p->num_files = num_files;
# 348| for (fi = 0, lf = lp->file; lf; lf = lf_next) {
Error: GCC_ANALYZER_WARNING (CWE-688):
lsof-4.99.6-rh/lib/lsof.c:346:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘malloc(num_files * 88)’ where non-null expected
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:285:8: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:286:9: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:338:33: branch_false: following ‘false’ branch (when ‘lf’ is NULL)...
lsof-4.99.6-rh/lib/lsof.c:344:44: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:344:44: acquire_memory: this call could return NULL
lsof-4.99.6-rh/lib/lsof.c:346:13: danger: argument 1 (‘malloc(num_files * 88)’) from [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10) could be NULL where non-null expected
# 344| p->files = (struct lsof_file *)malloc(sizeof(struct lsof_file) *
# 345| num_files);
# 346|-> memset(p->files, 0, sizeof(struct lsof_file) * num_files);
# 347| p->num_files = num_files;
# 348| for (fi = 0, lf = lp->file; lf; lf = lf_next) {
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:352:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:352:21: danger: out-of-bounds write from byte 0 till byte 7 but region ends at byte 0
# 350| /* Copy fields from lfile */
# 351| f = &p->files[fi++];
# 352|-> f->flags = 0;
# 353|
# 354| /* FD column */
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:355:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:355:21: danger: out-of-bounds write from byte 8 till byte 11 but region ends at byte 0
# 353|
# 354| /* FD column */
# 355|-> f->fd_type = lf->fd_type;
# 356| f->fd_num = lf->fd_num;
# 357| f->access = lf->access;
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:356:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:356:21: danger: out-of-bounds write from byte 12 till byte 15 but region ends at byte 0
# 354| /* FD column */
# 355| f->fd_type = lf->fd_type;
# 356|-> f->fd_num = lf->fd_num;
# 357| f->access = lf->access;
# 358| f->lock = lf->lock;
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:357:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:357:21: danger: out-of-bounds write from byte 16 till byte 19 but region ends at byte 0
# 355| f->fd_type = lf->fd_type;
# 356| f->fd_num = lf->fd_num;
# 357|-> f->access = lf->access;
# 358| f->lock = lf->lock;
# 359|
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:358:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:358:21: danger: out-of-bounds write from byte 20 till byte 23 but region ends at byte 0
# 356| f->fd_num = lf->fd_num;
# 357| f->access = lf->access;
# 358|-> f->lock = lf->lock;
# 359|
# 360| /* TYPE column */
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:361:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:361:21: danger: out-of-bounds write from byte 24 till byte 27 but region ends at byte 0
# 359|
# 360| /* TYPE column */
# 361|-> f->file_type = lf->type;
# 362| f->unknown_file_type_number = lf->unknown_file_type_number;
# 363|
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:362:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:362:21: danger: out-of-bounds write from byte 28 till byte 31 but region ends at byte 0
# 360| /* TYPE column */
# 361| f->file_type = lf->type;
# 362|-> f->unknown_file_type_number = lf->unknown_file_type_number;
# 363|
# 364| /* DEVICE column */
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:365:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:365:21: danger: out-of-bounds write from byte 32 till byte 39 but region ends at byte 0
# 363|
# 364| /* DEVICE column */
# 365|-> f->dev = lf->dev;
# 366| if (lf->dev_def) {
# 367| f->flags |= LSOF_FILE_FLAG_DEV_VALID;
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:367:25: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:366:24: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:367:25: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:367:25: danger: out-of-bounds write from byte 0 till byte 7 but region ends at byte 0
# 365| f->dev = lf->dev;
# 366| if (lf->dev_def) {
# 367|-> f->flags |= LSOF_FILE_FLAG_DEV_VALID;
# 368| }
# 369| f->rdev = lf->rdev;
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:369:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:366:24: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/lsof.c:369:31: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:369:21: danger: out-of-bounds write from byte 40 till byte 47 but region ends at byte 0
# 367| f->flags |= LSOF_FILE_FLAG_DEV_VALID;
# 368| }
# 369|-> f->rdev = lf->rdev;
# 370| if (lf->rdev_def) {
# 371| f->flags |= LSOF_FILE_FLAG_RDEV_VALID;
Error: GCC_ANALYZER_WARNING (CWE-126):
lsof-4.99.6-rh/lib/lsof.c:371:25: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:366:24: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/lsof.c:369:31: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:370:24: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:371:25: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:371:25: danger: out-of-bounds read from byte 0 till byte 7 but region ends at byte 0
# 369| f->rdev = lf->rdev;
# 370| if (lf->rdev_def) {
# 371|-> f->flags |= LSOF_FILE_FLAG_RDEV_VALID;
# 372| }
# 373|
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:371:25: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:366:24: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/lsof.c:369:31: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:370:24: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:371:25: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:371:25: danger: out-of-bounds write from byte 0 till byte 7 but region ends at byte 0
# 369| f->rdev = lf->rdev;
# 370| if (lf->rdev_def) {
# 371|-> f->flags |= LSOF_FILE_FLAG_RDEV_VALID;
# 372| }
# 373|
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:375:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:375:21: danger: out-of-bounds write from byte 48 till byte 55 but region ends at byte 0
# 373|
# 374| /* SIZE, SIZE/OFF, OFFSET column */
# 375|-> f->size = lf->sz;
# 376| if (lf->sz_def) {
# 377| f->flags |= LSOF_FILE_FLAG_SIZE_VALID;
Error: GCC_ANALYZER_WARNING (CWE-126):
lsof-4.99.6-rh/lib/lsof.c:377:25: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:376:24: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:377:25: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:377:25: danger: out-of-bounds read from byte 0 till byte 7 but region ends at byte 0
# 375| f->size = lf->sz;
# 376| if (lf->sz_def) {
# 377|-> f->flags |= LSOF_FILE_FLAG_SIZE_VALID;
# 378| }
# 379| f->offset = lf->off;
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:377:25: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:376:24: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:377:25: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:377:25: danger: out-of-bounds write from byte 0 till byte 7 but region ends at byte 0
# 375| f->size = lf->sz;
# 376| if (lf->sz_def) {
# 377|-> f->flags |= LSOF_FILE_FLAG_SIZE_VALID;
# 378| }
# 379| f->offset = lf->off;
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:379:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:379:21: danger: out-of-bounds write from byte 56 till byte 63 but region ends at byte 0
# 377| f->flags |= LSOF_FILE_FLAG_SIZE_VALID;
# 378| }
# 379|-> f->offset = lf->off;
# 380| if (lf->off_def) {
# 381| f->flags |= LSOF_FILE_FLAG_OFFSET_VALID;
Error: GCC_ANALYZER_WARNING (CWE-126):
lsof-4.99.6-rh/lib/lsof.c:381:25: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:380:24: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:381:25: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:381:25: danger: out-of-bounds read from byte 0 till byte 7 but region ends at byte 0
# 379| f->offset = lf->off;
# 380| if (lf->off_def) {
# 381|-> f->flags |= LSOF_FILE_FLAG_OFFSET_VALID;
# 382| }
# 383|
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:381:25: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:380:24: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:381:25: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:381:25: danger: out-of-bounds write from byte 0 till byte 7 but region ends at byte 0
# 379| f->offset = lf->off;
# 380| if (lf->off_def) {
# 381|-> f->flags |= LSOF_FILE_FLAG_OFFSET_VALID;
# 382| }
# 383|
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:385:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:385:21: danger: out-of-bounds write from byte 64 till byte 71 but region ends at byte 0
# 383|
# 384| /* NLINK column */
# 385|-> f->num_links = lf->nlink;
# 386| if (lf->nlink_def) {
# 387| f->flags |= LSOF_FILE_FLAG_NUM_LINKS_VALID;
Error: GCC_ANALYZER_WARNING (CWE-126):
lsof-4.99.6-rh/lib/lsof.c:387:25: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:386:24: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:387:25: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:387:25: danger: out-of-bounds read from byte 0 till byte 7 but region ends at byte 0
# 385| f->num_links = lf->nlink;
# 386| if (lf->nlink_def) {
# 387|-> f->flags |= LSOF_FILE_FLAG_NUM_LINKS_VALID;
# 388| }
# 389|
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:387:25: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:386:24: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:387:25: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:387:25: danger: out-of-bounds write from byte 0 till byte 7 but region ends at byte 0
# 385| f->num_links = lf->nlink;
# 386| if (lf->nlink_def) {
# 387|-> f->flags |= LSOF_FILE_FLAG_NUM_LINKS_VALID;
# 388| }
# 389|
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:391:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:391:21: danger: out-of-bounds write from byte 72 till byte 79 but region ends at byte 0
# 389|
# 390| /* NODE column */
# 391|-> f->inode = lf->inode;
# 392| if (lf->inp_ty == 1 || lf->inp_ty == 3) {
# 393| f->flags |= LSOF_FILE_FLAG_INODE_VALID;
Error: GCC_ANALYZER_WARNING (CWE-126):
lsof-4.99.6-rh/lib/lsof.c:393:25: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:392:24: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:393:25: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:393:25: danger: out-of-bounds read from byte 0 till byte 7 but region ends at byte 0
# 391| f->inode = lf->inode;
# 392| if (lf->inp_ty == 1 || lf->inp_ty == 3) {
# 393|-> f->flags |= LSOF_FILE_FLAG_INODE_VALID;
# 394| }
# 395|
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:393:25: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:392:24: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:393:25: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:393:25: danger: out-of-bounds write from byte 0 till byte 7 but region ends at byte 0
# 391| f->inode = lf->inode;
# 392| if (lf->inp_ty == 1 || lf->inp_ty == 3) {
# 393|-> f->flags |= LSOF_FILE_FLAG_INODE_VALID;
# 394| }
# 395|
Error: GCC_ANALYZER_WARNING (CWE-122):
lsof-4.99.6-rh/lib/lsof.c:397:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer overflow
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:309:15: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:310:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/lib/lsof.c:312:29: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:348:41: branch_true: following ‘true’ branch (when ‘lf’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:349:21: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:397:21: danger: out-of-bounds write from byte 80 till byte 87 but region ends at byte 0
# 395|
# 396| /* NAME column */
# 397|-> f->name = lf->nm;
# 398| lf->nm = NULL;
# 399| }
Error: CPPCHECK_WARNING (CWE-476):
lsof-4.99.6-rh/lib/lsof.c:431: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
# 429| ctx->cur_proc = NULL;
# 430|
# 431|-> res->processes = user_procs;
# 432| res->num_processes = sel_procs;
# 433|
Error: GCC_ANALYZER_WARNING (CWE-476):
lsof-4.99.6-rh/lib/lsof.c:431:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL 'res'
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following 'false' branch (when 'result' is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:285:8: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/lsof.c:293:5: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:302:31: acquire_memory: this call could return NULL
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/lsof.c:428:5: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:431:5: danger: 'res' could be NULL: unchecked value from [(5)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/4)
# 429| ctx->cur_proc = NULL;
# 430|
# 431|-> res->processes = user_procs;
# 432| res->num_processes = sel_procs;
# 433|
Error: GCC_ANALYZER_WARNING (CWE-476):
lsof-4.99.6-rh/lib/lsof.c:431:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘res’
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:285:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/lsof.c:293:5: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:302:31: acquire_memory: this call could return NULL
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/lsof.c:428:5: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:431:5: danger: ‘res’ could be NULL: unchecked value from [(5)](sarif:/runs/0/results/52/codeFlows/0/threadFlows/0/locations/4)
# 429| ctx->cur_proc = NULL;
# 430|
# 431|-> res->processes = user_procs;
# 432| res->num_processes = sel_procs;
# 433|
Error: CPPCHECK_WARNING (CWE-476):
lsof-4.99.6-rh/lib/lsof.c:432: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: res
# 430|
# 431| res->processes = user_procs;
# 432|-> res->num_processes = sel_procs;
# 433|
# 434| ctx->procs_size = ctx->procs_cap = 0;
Error: CPPCHECK_WARNING (CWE-476):
lsof-4.99.6-rh/lib/lsof.c:655: warning[nullPointerOutOfMemory]: If memory allocation fails, then there is a possible null pointer dereference: selections
# 653| selections = (struct lsof_selection *)malloc(
# 654| sizeof(struct lsof_selection) * num_selections);
# 655|-> memset(selections, 0,
# 656| sizeof(struct lsof_selection) * num_selections);
# 657| res->selections = selections;
Error: GCC_ANALYZER_WARNING (CWE-688):
lsof-4.99.6-rh/lib/lsof.c:655:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL 'selections' where non-null expected
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following 'false' branch (when 'result' is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:285:8: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/lsof.c:293:5: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/lsof.c:428:5: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:438:20: branch_true: following 'true' branch (when 'pass != 2')...
lsof-4.99.6-rh/lib/lsof.c:442:14: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:452:21: branch_false: following 'false' branch...
lsof-4.99.6-rh/lib/lsof.c:462:14: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:652:12: branch_true: following 'true' branch (when 'pass == 0')...
lsof-4.99.6-rh/lib/lsof.c:653:51: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:653:51: acquire_memory: this call could return NULL
lsof-4.99.6-rh/lib/lsof.c:655:13: danger: argument 1 ('selections') from [(13)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/12) could be NULL where non-null expected
# 653| selections = (struct lsof_selection *)malloc(
# 654| sizeof(struct lsof_selection) * num_selections);
# 655|-> memset(selections, 0,
# 656| sizeof(struct lsof_selection) * num_selections);
# 657| res->selections = selections;
Error: GCC_ANALYZER_WARNING (CWE-688):
lsof-4.99.6-rh/lib/lsof.c:655:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘selections’ where non-null expected
lsof-4.99.6-rh/lib/lsof.c:273:8: branch_false: following ‘false’ branch (when ‘result’ is non-NULL)...
lsof-4.99.6-rh/lib/lsof.c:276:17: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:285:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/lsof.c:293:5: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:307:27: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/lsof.c:428:5: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:438:20: branch_true: following ‘true’ branch (when ‘pass != 2’)...
lsof-4.99.6-rh/lib/lsof.c:442:14: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:452:21: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/lib/lsof.c:462:14: branch_false: ...to here
lsof-4.99.6-rh/lib/lsof.c:652:12: branch_true: following ‘true’ branch (when ‘pass == 0’)...
lsof-4.99.6-rh/lib/lsof.c:653:51: branch_true: ...to here
lsof-4.99.6-rh/lib/lsof.c:653:51: acquire_memory: this call could return NULL
lsof-4.99.6-rh/lib/lsof.c:655:13: danger: argument 1 (‘selections’) from [(13)](sarif:/runs/0/results/53/codeFlows/0/threadFlows/0/locations/12) could be NULL where non-null expected
# 653| selections = (struct lsof_selection *)malloc(
# 654| sizeof(struct lsof_selection) * num_selections);
# 655|-> memset(selections, 0,
# 656| sizeof(struct lsof_selection) * num_selections);
# 657| res->selections = selections;
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/lsof.c:672:21: warning[-Wunused-variable]: unused variable 'int_lst'
# 672 | struct int_lst *int_lst, *int_lst_next;
# | ^~~~~~~
# 670| int i;
# 671| struct str_lst *str_lst, *str_lst_next;
# 672|-> struct int_lst *int_lst, *int_lst_next;
# 673| struct mounts *mnt, *mnt_next;
# 674| if (!ctx) {
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/lsof.c:672:21: warning[-Wunused-variable]: unused variable ‘int_lst’
# 672 | struct int_lst *int_lst, *int_lst_next;
# | ^~~~~~~
# 670| int i;
# 671| struct str_lst *str_lst, *str_lst_next;
# 672|-> struct int_lst *int_lst, *int_lst_next;
# 673| struct mounts *mnt, *mnt_next;
# 674| if (!ctx) {
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/lsof.c: scope_hint: In function 'lsof_destroy'
lsof-4.99.6-rh/lib/lsof.c:672:31: warning[-Wunused-variable]: unused variable 'int_lst_next'
# 672 | struct int_lst *int_lst, *int_lst_next;
# | ^~~~~~~~~~~~
# 670| int i;
# 671| struct str_lst *str_lst, *str_lst_next;
# 672|-> struct int_lst *int_lst, *int_lst_next;
# 673| struct mounts *mnt, *mnt_next;
# 674| if (!ctx) {
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/lsof.c: scope_hint: In function ‘lsof_destroy’
lsof-4.99.6-rh/lib/lsof.c:672:31: warning[-Wunused-variable]: unused variable ‘int_lst_next’
# 672 | struct int_lst *int_lst, *int_lst_next;
# | ^~~~~~~~~~~~
# 670| int i;
# 671| struct str_lst *str_lst, *str_lst_next;
# 672|-> struct int_lst *int_lst, *int_lst_next;
# 673| struct mounts *mnt, *mnt_next;
# 674| if (!ctx) {
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/lsof.c: scope_hint: In function 'lsof_select_pid_pgid'
lsof-4.99.6-rh/lib/lsof.c:942:12: warning[-Wunused-variable]: unused variable 'j'
# 942 | int i, j;
# | ^
# 940| int *incl_num, int *excl_num, int exclude,
# 941| int is_pid) {
# 942|-> int i, j;
# 943| if (!ctx || ctx->frozen) {
# 944| return LSOF_ERROR_INVALID_ARGUMENT;
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/lsof.c: scope_hint: In function ‘lsof_select_pid_pgid’
lsof-4.99.6-rh/lib/lsof.c:942:12: warning[-Wunused-variable]: unused variable ‘j’
# 942 | int i, j;
# | ^
# 940| int *incl_num, int *excl_num, int exclude,
# 941| int is_pid) {
# 942|-> int i, j;
# 943| if (!ctx || ctx->frozen) {
# 944| return LSOF_ERROR_INVALID_ARGUMENT;
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/lsof.c: scope_hint: In function 'lsof_select_uid_login'
lsof-4.99.6-rh/lib/lsof.c:1020:12: warning[-Wunused-variable]: unused variable 'j'
# 1020 | int i, j;
# | ^
# 1018| enum lsof_error lsof_select_uid_login(struct lsof_context *ctx, uint32_t uid,
# 1019| char *login, int exclude) {
# 1020|-> int i, j;
# 1021| MALLOC_S len;
# 1022| char *lp;
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/lsof.c: scope_hint: In function ‘lsof_select_uid_login’
lsof-4.99.6-rh/lib/lsof.c:1020:12: warning[-Wunused-variable]: unused variable ‘j’
# 1020 | int i, j;
# | ^
# 1018| enum lsof_error lsof_select_uid_login(struct lsof_context *ctx, uint32_t uid,
# 1019| char *login, int exclude) {
# 1020|-> int i, j;
# 1021| MALLOC_S len;
# 1022| char *lp;
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/misc.c: scope_hint: In function 'closefrom_shim'
lsof-4.99.6-rh/lib/misc.c:221:9: warning[-Wunused-variable]: unused variable 'i'
# 221 | int i;
# | ^
# 219| */
# 220| void closefrom_shim(struct lsof_context *ctx, int low) {
# 221|-> int i;
# 222| #if defined(HAS_CLOSEFROM)
# 223| (void)closefrom(low);
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/misc.c: scope_hint: In function ‘closefrom_shim’
lsof-4.99.6-rh/lib/misc.c:221:9: warning[-Wunused-variable]: unused variable ‘i’
# 221 | int i;
# | ^
# 219| */
# 220| void closefrom_shim(struct lsof_context *ctx, int low) {
# 221|-> int i;
# 222| #if defined(HAS_CLOSEFROM)
# 223| (void)closefrom(low);
Error: COMPILER_WARNING:
lsof-4.99.6-rh/lib/print.c: scope_hint: In function 'printiproto'
lsof-4.99.6-rh/lib/print.c:1117:57: warning[-Wformat-truncation=]: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 8
# 1117 | (void)snpf(Lf->iproto, sizeof(Lf->iproto), "%d?", p);
# | ^~
lsof-4.99.6-rh/lib/print.c:1117:56: note: directive argument in the range [-2147483648, 2147483646]
# 1117 | (void)snpf(Lf->iproto, sizeof(Lf->iproto), "%d?", p);
# | ^~~~~
/usr/include/bits/stdio2.h:68:10: note: '__snprintf_chk' output between 3 and 13 bytes into a destination of size 8
# 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 69 | __glibc_objsize (__s), __fmt,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 70 | __va_arg_pack ());
# | ~~~~~~~~~~~~~~~~~
# 1115| }
# 1116| if (m > p)
# 1117|-> (void)snpf(Lf->iproto, sizeof(Lf->iproto), "%d?", p);
# 1118| else
# 1119| (void)snpf(Lf->iproto, sizeof(Lf->iproto), "*%d?", p % (m / 10));
Error: COMPILER_WARNING:
lsof-4.99.6-rh/lib/print.c: scope_hint: In function 'printiproto'
lsof-4.99.6-rh/lib/print.c:1119:58: warning[-Wformat-truncation=]: '%d' directive output may be truncated writing between 1 and 9 bytes into a region of size 7
# 1119 | (void)snpf(Lf->iproto, sizeof(Lf->iproto), "*%d?", p % (m / 10));
# | ^~
lsof-4.99.6-rh/lib/print.c:1119:56: note: directive argument in the range [0, 214748363]
# 1119 | (void)snpf(Lf->iproto, sizeof(Lf->iproto), "*%d?", p % (m / 10));
# | ^~~~~~
/usr/include/bits/stdio2.h:68:10: note: '__snprintf_chk' output between 4 and 12 bytes into a destination of size 8
# 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 69 | __glibc_objsize (__s), __fmt,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 70 | __va_arg_pack ());
# | ~~~~~~~~~~~~~~~~~
# 1117| (void)snpf(Lf->iproto, sizeof(Lf->iproto), "%d?", p);
# 1118| else
# 1119|-> (void)snpf(Lf->iproto, sizeof(Lf->iproto), "*%d?", p % (m / 10));
# 1120| }
# 1121| }
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/proc.c: scope_hint: In function 'prt_pinfo'
lsof-4.99.6-rh/lib/proc.c:988:9: warning[-Wunused-variable]: unused variable 'i'
# 988 | int i; /* temporary index */
# | ^
# 986| struct lproc *ep; /* pipe endpoint process */
# 987| struct lfile *ef; /* pipe endpoint file */
# 988|-> int i; /* temporary index */
# 989| char nma[1024]; /* name addition buffer */
# 990| char fd[FDLEN];
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/proc.c: scope_hint: In function ‘prt_pinfo’
lsof-4.99.6-rh/lib/proc.c:988:9: warning[-Wunused-variable]: unused variable ‘i’
# 988 | int i; /* temporary index */
# | ^
# 986| struct lproc *ep; /* pipe endpoint process */
# 987| struct lfile *ef; /* pipe endpoint file */
# 988|-> int i; /* temporary index */
# 989| char nma[1024]; /* name addition buffer */
# 990| char fd[FDLEN];
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/proc.c: scope_hint: In function 'prt_psxmqinfo'
lsof-4.99.6-rh/lib/proc.c:1087:9: warning[-Wunused-variable]: unused variable 'i'
# 1087 | int i; /* temporary index */
# | ^
# 1085| struct lproc *ep; /* posix mq endpoint process */
# 1086| struct lfile *ef; /* posix mq endpoint file */
# 1087|-> int i; /* temporary index */
# 1088| char nma[1024]; /* name addition buffer */
# 1089| char fd[FDLEN];
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/proc.c: scope_hint: In function ‘prt_psxmqinfo’
lsof-4.99.6-rh/lib/proc.c:1087:9: warning[-Wunused-variable]: unused variable ‘i’
# 1087 | int i; /* temporary index */
# | ^
# 1085| struct lproc *ep; /* posix mq endpoint process */
# 1086| struct lfile *ef; /* posix mq endpoint file */
# 1087|-> int i; /* temporary index */
# 1088| char nma[1024]; /* name addition buffer */
# 1089| char fd[FDLEN];
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/proc.c: scope_hint: In function 'prt_evtfdinfo'
lsof-4.99.6-rh/lib/proc.c:1186:9: warning[-Wunused-variable]: unused variable 'i'
# 1186 | int i; /* temporary index */
# | ^
# 1184| struct lproc *ep; /* eventfd endpoint process */
# 1185| struct lfile *ef; /* eventfd endpoint file */
# 1186|-> int i; /* temporary index */
# 1187| char nma[1024]; /* name addition buffer */
# 1188| char fd[FDLEN];
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/proc.c: scope_hint: In function ‘prt_evtfdinfo’
lsof-4.99.6-rh/lib/proc.c:1186:9: warning[-Wunused-variable]: unused variable ‘i’
# 1186 | int i; /* temporary index */
# | ^
# 1184| struct lproc *ep; /* eventfd endpoint process */
# 1185| struct lfile *ef; /* eventfd endpoint file */
# 1186|-> int i; /* temporary index */
# 1187| char nma[1024]; /* name addition buffer */
# 1188| char fd[FDLEN];
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/proc.c: scope_hint: In function 'prt_ptyinfo'
lsof-4.99.6-rh/lib/proc.c:1299:9: warning[-Wunused-variable]: unused variable 'i'
# 1299 | int i; /* temporary index */
# | ^
# 1297| struct lproc *ep; /* pseudoterminal endpoint process */
# 1298| struct lfile *ef; /* pseudoterminal endpoint file */
# 1299|-> int i; /* temporary index */
# 1300| char nma[1024]; /* name addition buffer */
# 1301| char fd[FDLEN];
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/lib/proc.c: scope_hint: In function ‘prt_ptyinfo’
lsof-4.99.6-rh/lib/proc.c:1299:9: warning[-Wunused-variable]: unused variable ‘i’
# 1299 | int i; /* temporary index */
# | ^
# 1297| struct lproc *ep; /* pseudoterminal endpoint process */
# 1298| struct lfile *ef; /* pseudoterminal endpoint file */
# 1299|-> int i; /* temporary index */
# 1300| char nma[1024]; /* name addition buffer */
# 1301| char fd[FDLEN];
Error: COMPILER_WARNING:
lsof-4.99.6-rh/lib/proc.c: scope_hint: In function 'fd_to_string'
lsof-4.99.6-rh/lib/proc.c:1333:37: warning[-Wformat-truncation=]: '%d' directive output may be truncated writing between 1 and 11 bytes into a region of size 8
# 1333 | (void)snpf(buf, FDLEN, "%d", fd_num);
# | ^~
lsof-4.99.6-rh/lib/proc.c:1333:36: note: directive argument in the range [-2147483648, 9999]
# 1333 | (void)snpf(buf, FDLEN, "%d", fd_num);
# | ^~~~
/usr/include/bits/stdio2.h:68:10: note: '__snprintf_chk' output between 2 and 12 bytes into a destination of size 8
# 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 69 | __glibc_objsize (__s), __fmt,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 70 | __va_arg_pack ());
# | ~~~~~~~~~~~~~~~~~
# 1331| /* strlen("TYPE") == 4, try to match width */
# 1332| if (fd_num < 10000)
# 1333|-> (void)snpf(buf, FDLEN, "%d", fd_num);
# 1334| else
# 1335| (void)snpf(buf, FDLEN, "*%03d", fd_num % 1000);
Error: COMPILER_WARNING:
lsof-4.99.6-rh/lib/proc.c: scope_hint: In function ‘fd_to_string’
lsof-4.99.6-rh/lib/proc.c:1333:37: warning[-Wformat-truncation=]: ‘%d’ directive output may be truncated writing between 1 and 11 bytes into a region of size 8
# 1333 | (void)snpf(buf, FDLEN, "%d", fd_num);
# | ^~
lsof-4.99.6-rh/lib/proc.c:1333:36: note: directive argument in the range [-2147483648, 9999]
# 1333 | (void)snpf(buf, FDLEN, "%d", fd_num);
# | ^~~~
/usr/include/bits/stdio2.h:68:10: note: ‘__snprintf_chk’ output between 2 and 12 bytes into a destination of size 8
# 68 | return __builtin___snprintf_chk (__s, __n, __USE_FORTIFY_LEVEL - 1,
# | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 69 | __glibc_objsize (__s), __fmt,
# | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 70 | __va_arg_pack ());
# | ~~~~~~~~~~~~~~~~~
# 1331| /* strlen("TYPE") == 4, try to match width */
# 1332| if (fd_num < 10000)
# 1333|-> (void)snpf(buf, FDLEN, "%d", fd_num);
# 1334| else
# 1335| (void)snpf(buf, FDLEN, "*%03d", fd_num % 1000);
Error: GCC_ANALYZER_WARNING (CWE-401):
lsof-4.99.6-rh/src/arg.c:942:27: warning[-Wanalyzer-malloc-leak]: leak of ‘opendir(dn)’
lsof-4.99.6-rh/src/arg.c:841:5: enter_function: entry to ‘enter_dir’
lsof-4.99.6-rh/src/arg.c:863:8: branch_false: following ‘false’ branch (when ‘d’ is non-NULL)...
lsof-4.99.6-rh/src/arg.c:863:16: branch_false: ...to here
lsof-4.99.6-rh/src/arg.c:869:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/arg.c:871:9: branch_false: ...to here
lsof-4.99.6-rh/src/arg.c:871:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/arg.c:884:10: branch_false: ...to here
lsof-4.99.6-rh/src/arg.c:884:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/arg.c:900:5: branch_false: ...to here
lsof-4.99.6-rh/src/arg.c:910:10: call_function: calling ‘ck_file_arg’ from ‘enter_dir’
lsof-4.99.6-rh/src/arg.c:910:10: return_function: returning to ‘enter_dir’ from ‘ck_file_arg’
lsof-4.99.6-rh/src/arg.c:910:8: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/src/arg.c:911:9: branch_true: ...to here
lsof-4.99.6-rh/src/arg.c:917:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/src/arg.c:918:20: branch_true: ...to here
lsof-4.99.6-rh/src/arg.c:918:12: branch_false: following ‘false’ branch (when ‘dn’ is non-NULL)...
lsof-4.99.6-rh/src/arg.c:920:9: branch_false: ...to here
lsof-4.99.6-rh/src/arg.c:925:21: acquire_memory: allocated here
lsof-4.99.6-rh/src/arg.c:925:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/arg.c:937:15: branch_false: ...to here
lsof-4.99.6-rh/src/arg.c:943:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/src/arg.c:945:16: branch_true: ...to here
lsof-4.99.6-rh/src/arg.c:945:16: branch_true: following ‘true’ branch (when ‘fp’ is NULL)...
lsof-4.99.6-rh/src/arg.c:946:30: branch_true: ...to here
lsof-4.99.6-rh/src/arg.c:942:27: danger: ‘opendir(dn)’ leaks here; was allocated at [(47)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/46)
# 940| * Define space for possible addition to the directory path.
# 941| */
# 942|-> fpli = (MALLOC_S)(dnl + sl + EDDEFFNL + 1);
# 943| if ((int)fpli > (int)fpl) {
# 944| fpl = fpli;
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/src/arg.c:1126:21: warning[-Wunused-variable]: unused variable ‘j’
# 1126 | int err, i, id, j, mx, n, ni, nx, x;
# | ^
# 1124| {
# 1125| char *cp;
# 1126|-> int err, i, id, j, mx, n, ni, nx, x;
# 1127| struct int_lst *s;
# 1128|
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/src/arg.c:1126:24: warning[-Wunused-variable]: unused variable ‘mx’
# 1126 | int err, i, id, j, mx, n, ni, nx, x;
# | ^~
# 1124| {
# 1125| char *cp;
# 1126|-> int err, i, id, j, mx, n, ni, nx, x;
# 1127| struct int_lst *s;
# 1128|
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/src/arg.c:1126:28: warning[-Wunused-variable]: unused variable ‘n’
# 1126 | int err, i, id, j, mx, n, ni, nx, x;
# | ^
# 1124| {
# 1125| char *cp;
# 1126|-> int err, i, id, j, mx, n, ni, nx, x;
# 1127| struct int_lst *s;
# 1128|
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/src/arg.c:1126:31: warning[-Wunused-variable]: unused variable ‘ni’
# 1126 | int err, i, id, j, mx, n, ni, nx, x;
# | ^~
# 1124| {
# 1125| char *cp;
# 1126|-> int err, i, id, j, mx, n, ni, nx, x;
# 1127| struct int_lst *s;
# 1128|
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/src/arg.c:1126:35: warning[-Wunused-variable]: unused variable ‘nx’
# 1126 | int err, i, id, j, mx, n, ni, nx, x;
# | ^~
# 1124| {
# 1125| char *cp;
# 1126|-> int err, i, id, j, mx, n, ni, nx, x;
# 1127| struct int_lst *s;
# 1128|
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/src/arg.c: scope_hint: In function ‘enter_id’
lsof-4.99.6-rh/src/arg.c:1127:21: warning[-Wunused-variable]: unused variable ‘s’
# 1127 | struct int_lst *s;
# | ^
# 1125| char *cp;
# 1126| int err, i, id, j, mx, n, ni, nx, x;
# 1127|-> struct int_lst *s;
# 1128|
# 1129| if (!p) {
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/src/arg.c:1941:11: warning[-Wunused-variable]: unused variable ‘cp’
# 1941 | char *cp;
# | ^~
# 1939| char *s) /* string to enter */
# 1940| {
# 1941|-> char *cp;
# 1942| short x;
# 1943| MALLOC_S len;
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/src/arg.c:1943:14: warning[-Wunused-variable]: unused variable ‘len’
# 1943 | MALLOC_S len;
# | ^~~
# 1941| char *cp;
# 1942| short x;
# 1943|-> MALLOC_S len;
# 1944| struct str_lst *lpt;
# 1945|
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/src/arg.c: scope_hint: In function ‘enter_cmd’
lsof-4.99.6-rh/src/arg.c:1944:21: warning[-Wunused-variable]: unused variable ‘lpt’
# 1944 | struct str_lst *lpt;
# | ^~~
# 1942| short x;
# 1943| MALLOC_S len;
# 1944|-> struct str_lst *lpt;
# 1945|
# 1946| if (!s || *s == '-' || *s == '+') {
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/src/arg.c:1971:14: warning[-Wunused-variable]: unused variable ‘len’
# 1971 | MALLOC_S len;
# | ^~~
# 1969| int err, i, j, lnml, nn;
# 1970| unsigned char excl;
# 1971|-> MALLOC_S len;
# 1972| char lnm[LOGINML + 1], *lp;
# 1973| struct passwd *pw;
Error: COMPILER_WARNING (CWE-563):
lsof-4.99.6-rh/src/arg.c: scope_hint: In function ‘enter_uid’
lsof-4.99.6-rh/src/arg.c:1972:29: warning[-Wunused-variable]: unused variable ‘lp’
# 1972 | char lnm[LOGINML + 1], *lp;
# | ^~
# 1970| unsigned char excl;
# 1971| MALLOC_S len;
# 1972|-> char lnm[LOGINML + 1], *lp;
# 1973| struct passwd *pw;
# 1974| char *s, *st;
Error: GCC_ANALYZER_WARNING (CWE-476):
lsof-4.99.6-rh/src/main.c:1460:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘slp’
lsof-4.99.6-rh/src/main.c:54:5: enter_function: entry to ‘main’
lsof-4.99.6-rh/src/main.c:128:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/main.c:130:8: branch_false: ...to here
lsof-4.99.6-rh/src/main.c:237:17: call_function: calling ‘GetOpt’ from ‘main’
lsof-4.99.6-rh/src/main.c:237:17: return_function: returning to ‘main’ from ‘GetOpt’
lsof-4.99.6-rh/src/main.c:237:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/main.c:1008:14: branch_false: ...to here
lsof-4.99.6-rh/src/main.c:1146:9: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/main.c:1150:9: branch_false: ...to here
lsof-4.99.6-rh/src/main.c:1150:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/main.c:1154:9: branch_false: ...to here
lsof-4.99.6-rh/src/main.c:1154:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/main.c:1156:9: branch_false: ...to here
lsof-4.99.6-rh/src/main.c:1156:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/main.c:1158:9: branch_false: ...to here
lsof-4.99.6-rh/src/main.c:1158:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/main.c:1160:9: branch_false: ...to here
lsof-4.99.6-rh/src/main.c:1160:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/main.c:1162:9: branch_false: ...to here
lsof-4.99.6-rh/src/main.c:1168:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/main.c:1176:9: branch_false: ...to here
lsof-4.99.6-rh/src/main.c:1176:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/main.c:1178:9: branch_false: ...to here
lsof-4.99.6-rh/src/main.c:1178:8: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/src/main.c:1179:13: branch_true: ...to here
lsof-4.99.6-rh/src/main.c:1193:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/main.c:1214:14: branch_false: ...to here
lsof-4.99.6-rh/src/main.c:1259:18: call_function: calling ‘sv_fmt_str’ from ‘main’
lsof-4.99.6-rh/src/main.c:1259:18: return_function: returning to ‘main’ from ‘sv_fmt_str’
lsof-4.99.6-rh/src/main.c:1261:18: call_function: calling ‘sv_fmt_str’ from ‘main’
lsof-4.99.6-rh/src/main.c:1261:18: return_function: returning to ‘main’ from ‘sv_fmt_str’
lsof-4.99.6-rh/src/main.c:1263:19: call_function: calling ‘sv_fmt_str’ from ‘main’
lsof-4.99.6-rh/src/main.c:1263:19: return_function: returning to ‘main’ from ‘sv_fmt_str’
lsof-4.99.6-rh/src/main.c:1265:18: call_function: calling ‘sv_fmt_str’ from ‘main’
lsof-4.99.6-rh/src/main.c:1265:18: return_function: returning to ‘main’ from ‘sv_fmt_str’
lsof-4.99.6-rh/src/main.c:1267:19: call_function: calling ‘sv_fmt_str’ from ‘main’
lsof-4.99.6-rh/src/main.c:1267:19: return_function: returning to ‘main’ from ‘sv_fmt_str’
lsof-4.99.6-rh/src/main.c:1269:18: call_function: calling ‘sv_fmt_str’ from ‘main’
lsof-4.99.6-rh/src/main.c:1269:18: return_function: returning to ‘main’ from ‘sv_fmt_str’
lsof-4.99.6-rh/src/main.c:1275:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/main.c:1284:9: branch_false: ...to here
lsof-4.99.6-rh/src/main.c:1295:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/main.c:1315:18: branch_false: ...to here
lsof-4.99.6-rh/src/main.c:1315:12: branch_true: following ‘true’ branch (when ‘n != 0’)...
lsof-4.99.6-rh/src/main.c:1333:17: branch_true: ...to here
lsof-4.99.6-rh/src/main.c:1458:44: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/src/main.c:1458:44: branch_true: ...to here
lsof-4.99.6-rh/src/main.c:1459:33: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/src/main.c:1460:26: branch_true: ...to here
lsof-4.99.6-rh/src/main.c:1460:26: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/src/main.c:1460:44: branch_true: ...to here
lsof-4.99.6-rh/src/main.c:1460:26: danger: dereference of NULL ‘slp + (long unsigned int)i * 8’
# 1458| for (lf = Lf, print_init(ctx); PrPass < 2; PrPass++) {
# 1459| for (i = n = 0; i < Nlproc; i++) {
# 1460|-> Lp = (Nlproc > 1) ? slp[i] : &Lproc[i];
# 1461| if (Lp->pss) {
# 1462| if (print_proc(ctx))
Error: GCC_ANALYZER_WARNING (CWE-787):
lsof-4.99.6-rh/src/print.c:467:18: warning[-Wanalyzer-out-of-bounds]: buffer overflow
lsof-4.99.6-rh/src/print.c:1793:5: enter_function: entry to ‘print_proc’
lsof-4.99.6-rh/src/print.c:1803:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/print.c:1805:9: branch_false: ...to here
lsof-4.99.6-rh/src/print.c:1805:8: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/print.c:1827:9: branch_false: ...to here
lsof-4.99.6-rh/src/print.c:1827:8: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/src/print.c:1828:19: branch_true: ...to here
lsof-4.99.6-rh/src/print.c:1828:29: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/src/print.c:1829:17: branch_true: ...to here
lsof-4.99.6-rh/src/print.c:1832:12: branch_false: following ‘false’ branch...
lsof-4.99.6-rh/src/print.c:1835:15: branch_false: ...to here
lsof-4.99.6-rh/src/print.c:1880:25: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/src/print.c:1881:14: branch_true: ...to here
lsof-4.99.6-rh/src/print.c:1888:12: branch_true: following ‘true’ branch...
lsof-4.99.6-rh/src/print.c:1889:13: branch_true: ...to here
lsof-4.99.6-rh/src/print.c:1889:13: call_function: calling ‘print_file’ from ‘print_proc’
# 465|
# 466| for (h = 0; h < nh; h++) {
# 467|-> if (!(Pth[h] = (struct porttab **)calloc(
# 468| PORTHASHBUCKETS, sizeof(struct porttab *)))) {
# 469| (void)fprintf(