util-linux-2.40.4-7.fc43

List of Findings

Error: GCC_ANALYZER_WARNING (CWE-910): [#def1]
util-linux-2.40.4/./include/c.h:438:9: warning[-Wanalyzer-fd-use-after-close]: ‘write’ on closed file descriptor ‘2’
util-linux-2.40.4/lib/pager.c:161:13: enter_function: entry to ‘wait_for_pager’
util-linux-2.40.4/lib/pager.c:168:9: release_resource: closed here
util-linux-2.40.4/lib/pager.c:169:9: call_function: inlined call to ‘finish_command’ from ‘wait_for_pager’
#  436|   static inline void ul_sig_warn(const char *mesg)
#  437|   {
#  438|-> 	ul_err_write(program_invocation_short_name);
#  439|   	ul_err_write(": ");
#  440|   	ul_err_write(mesg);

Error: GCC_ANALYZER_WARNING (CWE-910): [#def2]
util-linux-2.40.4/./include/c.h:439:9: warning[-Wanalyzer-fd-use-after-close]: ‘write’ on closed file descriptor ‘2’
util-linux-2.40.4/lib/pager.c:161:13: enter_function: entry to ‘wait_for_pager’
util-linux-2.40.4/lib/pager.c:168:9: release_resource: closed here
util-linux-2.40.4/lib/pager.c:169:9: call_function: inlined call to ‘finish_command’ from ‘wait_for_pager’
#  437|   {
#  438|   	ul_err_write(program_invocation_short_name);
#  439|-> 	ul_err_write(": ");
#  440|   	ul_err_write(mesg);
#  441|   	ul_err_write("\n");

Error: GCC_ANALYZER_WARNING (CWE-910): [#def3]
util-linux-2.40.4/./include/c.h:440:9: warning[-Wanalyzer-fd-use-after-close]: ‘write’ on closed file descriptor ‘2’
util-linux-2.40.4/lib/pager.c:161:13: enter_function: entry to ‘wait_for_pager’
util-linux-2.40.4/lib/pager.c:168:9: release_resource: closed here
util-linux-2.40.4/lib/pager.c:169:9: call_function: inlined call to ‘finish_command’ from ‘wait_for_pager’
#  438|   	ul_err_write(program_invocation_short_name);
#  439|   	ul_err_write(": ");
#  440|-> 	ul_err_write(mesg);
#  441|   	ul_err_write("\n");
#  442|   }

Error: GCC_ANALYZER_WARNING (CWE-910): [#def4]
util-linux-2.40.4/./include/c.h:441:9: warning[-Wanalyzer-fd-use-after-close]: ‘write’ on closed file descriptor ‘2’
util-linux-2.40.4/lib/pager.c:161:13: enter_function: entry to ‘wait_for_pager’
util-linux-2.40.4/lib/pager.c:168:9: release_resource: closed here
util-linux-2.40.4/lib/pager.c:169:9: call_function: inlined call to ‘finish_command’ from ‘wait_for_pager’
#  439|   	ul_err_write(": ");
#  440|   	ul_err_write(mesg);
#  441|-> 	ul_err_write("\n");
#  442|   }
#  443|   

Error: GCC_ANALYZER_WARNING (CWE-416): [#def5]
util-linux-2.40.4/./include/list.h:53:9: warning[-Wanalyzer-use-after-free]: use after 'free' of 'child'
util-linux-2.40.4/libsmartcols/src/line.c:242:5: enter_function: entry to 'scols_line_add_child'
util-linux-2.40.4/libsmartcols/src/line.c:244:12: branch_false: following 'false' branch...
util-linux-2.40.4/libsmartcols/src/line.c:247:9: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/line.c:248:9: call_function: calling 'scols_ref_line' from 'scols_line_add_child'
util-linux-2.40.4/libsmartcols/src/line.c:248:9: return_function: returning to 'scols_line_add_child' from 'scols_ref_line'
util-linux-2.40.4/libsmartcols/src/line.c:249:9: call_function: calling 'scols_ref_line' from 'scols_line_add_child'
util-linux-2.40.4/libsmartcols/src/line.c:249:9: return_function: returning to 'scols_line_add_child' from 'scols_ref_line'
util-linux-2.40.4/libsmartcols/src/line.c:252:12: branch_true: following 'true' branch...
util-linux-2.40.4/libsmartcols/src/line.c:253:17: branch_true: ...to here
util-linux-2.40.4/libsmartcols/src/line.c:253:17: call_function: calling 'scols_line_remove_child' from 'scols_line_add_child'
util-linux-2.40.4/libsmartcols/src/line.c:253:17: return_function: returning to 'scols_line_add_child' from 'scols_line_remove_child'
util-linux-2.40.4/libsmartcols/src/line.c:256:9: call_function: inlined call to 'list_add_tail' from 'scols_line_add_child'
#   51|   {
#   52|   	next->prev = add;
#   53|-> 	add->next = next;
#   54|   	add->prev = prev;
#   55|   	prev->next = add;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def6]
util-linux-2.40.4/./include/list.h:55:9: warning[-Wanalyzer-malloc-leak]: leak of ‘new_counter_spec(optarg)’
util-linux-2.40.4/misc-utils/lsfd.c:2242:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/lsfd.c:2292:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
util-linux-2.40.4/misc-utils/lsfd.c:2293:17: branch_true: ...to here
util-linux-2.40.4/misc-utils/lsfd.c:2337:50: call_function: calling ‘new_counter_spec’ from ‘main’
util-linux-2.40.4/misc-utils/lsfd.c:2337:50: return_function: returning to ‘main’ from ‘new_counter_spec’
util-linux-2.40.4/misc-utils/lsfd.c:2338:25: call_function: inlined call to ‘list_add_tail’ from ‘main’
#   53|   	add->next = next;
#   54|   	add->prev = prev;
#   55|-> 	prev->next = add;
#   56|   }
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def7]
util-linux-2.40.4/./include/list.h:55:9: warning[-Wanalyzer-malloc-leak]: leak of ‘new_miscdev(minor, & name)’
util-linux-2.40.4/misc-utils/lsfd-cdev.c:137:13: enter_function: entry to ‘read_misc’
util-linux-2.40.4/misc-utils/lsfd-cdev.c:143:16: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/lsfd-cdev.c:146:21: branch_true: ...to here
util-linux-2.40.4/misc-utils/lsfd-cdev.c:146:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd-cdev.c:149:27: branch_false: ...to here
util-linux-2.40.4/misc-utils/lsfd-cdev.c:149:27: call_function: calling ‘new_miscdev’ from ‘read_misc’
util-linux-2.40.4/misc-utils/lsfd-cdev.c:149:27: return_function: returning to ‘read_misc’ from ‘new_miscdev’
util-linux-2.40.4/misc-utils/lsfd-cdev.c:150:17: call_function: inlined call to ‘list_add_tail’ from ‘read_misc’
#   53|   	add->next = next;
#   54|   	add->prev = prev;
#   55|-> 	prev->next = add;
#   56|   }
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def8]
util-linux-2.40.4/./include/list.h:55:9: warning[-Wanalyzer-malloc-leak]: leak of ‘new_nodev(minor,  filesystem)’
util-linux-2.40.4/misc-utils/lsfd.c:1680:13: enter_function: entry to ‘read_process’
util-linux-2.40.4/misc-utils/lsfd.c:1689:16: call_function: calling ‘new_proc’ from ‘read_process’
util-linux-2.40.4/misc-utils/lsfd.c:1689:16: return_function: returning to ‘read_process’ from ‘new_proc’
util-linux-2.40.4/misc-utils/lsfd.c:1691:40: call_function: calling ‘xstrdup’ from ‘read_process’
util-linux-2.40.4/misc-utils/lsfd.c:1691:40: return_function: returning to ‘read_process’ from ‘xstrdup’
util-linux-2.40.4/misc-utils/lsfd.c:1694:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd.c:1712:13: branch_false: ...to here
util-linux-2.40.4/misc-utils/lsfd.c:1717:9: call_function: calling ‘collect_execve_file’ from ‘read_process’
util-linux-2.40.4/misc-utils/lsfd.c:1717:9: return_function: returning to ‘read_process’ from ‘collect_execve_file’
util-linux-2.40.4/misc-utils/lsfd.c:1719:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/lsfd.c:1721:44: branch_true: ...to here
util-linux-2.40.4/misc-utils/lsfd.c:1721:17: call_function: calling ‘collect_fs_files’ from ‘read_process’
util-linux-2.40.4/misc-utils/lsfd.c:1721:17: return_function: returning to ‘read_process’ from ‘collect_fs_files’
util-linux-2.40.4/misc-utils/lsfd.c:1741:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd.c:1745:13: branch_false: ...to here
util-linux-2.40.4/misc-utils/lsfd.c:1747:20: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/lsfd.c:1748:25: branch_true: ...to here
util-linux-2.40.4/misc-utils/lsfd.c:1748:25: call_function: calling ‘read_mountinfo’ from ‘read_process’
#   53|   	add->next = next;
#   54|   	add->prev = prev;
#   55|-> 	prev->next = add;
#   56|   }
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def9]
util-linux-2.40.4/./include/list.h:55:9: warning[-Wanalyzer-malloc-leak]: leak of ‘new_partition(__dev, & name)’
util-linux-2.40.4/misc-utils/lsfd-bdev.c:107:13: enter_function: entry to ‘read_partitions’
util-linux-2.40.4/misc-utils/lsfd-bdev.c:113:16: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/lsfd-bdev.c:116:21: branch_true: ...to here
util-linux-2.40.4/misc-utils/lsfd-bdev.c:116:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd-bdev.c:118:29: branch_false: ...to here
util-linux-2.40.4/misc-utils/lsfd-bdev.c:118:29: call_function: calling ‘new_partition’ from ‘read_partitions’
util-linux-2.40.4/misc-utils/lsfd-bdev.c:118:29: return_function: returning to ‘read_partitions’ from ‘new_partition’
util-linux-2.40.4/misc-utils/lsfd-bdev.c:119:17: call_function: inlined call to ‘list_add_tail’ from ‘read_partitions’
#   53|   	add->next = next;
#   54|   	add->prev = prev;
#   55|-> 	prev->next = add;
#   56|   }
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def10]
util-linux-2.40.4/./include/list.h:55:9: warning[-Wanalyzer-malloc-leak]: leak of ‘read_ttydrv(&line)’
util-linux-2.40.4/misc-utils/lsfd-cdev.c:220:13: enter_function: entry to ‘read_tty_drivers’
util-linux-2.40.4/misc-utils/lsfd-cdev.c:224:16: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/lsfd-cdev.c:225:41: branch_true: ...to here
util-linux-2.40.4/misc-utils/lsfd-cdev.c:225:41: call_function: calling ‘read_ttydrv’ from ‘read_tty_drivers’
util-linux-2.40.4/misc-utils/lsfd-cdev.c:225:41: return_function: returning to ‘read_tty_drivers’ from ‘read_ttydrv’
util-linux-2.40.4/misc-utils/lsfd-cdev.c:226:20: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/lsfd-cdev.c:227:25: branch_true: ...to here
util-linux-2.40.4/misc-utils/lsfd-cdev.c:227:25: call_function: inlined call to ‘list_add_tail’ from ‘read_tty_drivers’
#   53|   	add->next = next;
#   54|   	add->prev = prev;
#   55|-> 	prev->next = add;
#   56|   }
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def11]
util-linux-2.40.4/./include/list.h:55:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 24)’
util-linux-2.40.4/misc-utils/kill.c:483:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/kill.c:496:16: call_function: calling ‘parse_arguments’ from ‘main’
#   53|   	add->next = next;
#   54|   	add->prev = prev;
#   55|-> 	prev->next = add;
#   56|   }
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def12]
util-linux-2.40.4/./include/list.h:55:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 32)’
util-linux-2.40.4/misc-utils/logger.c:1106:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/logger.c:1171:16: branch_true: following ‘true’ branch (when ‘ch != -1’)...
util-linux-2.40.4/misc-utils/logger.c:1173:17: branch_true: ...to here
util-linux-2.40.4/misc-utils/logger.c:1260:30: call_function: calling ‘valid_structured_data_id’ from ‘main’
util-linux-2.40.4/misc-utils/logger.c:1260:30: return_function: returning to ‘main’ from ‘valid_structured_data_id’
util-linux-2.40.4/misc-utils/logger.c:1260:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/logger.c:1262:25: branch_false: ...to here
util-linux-2.40.4/misc-utils/logger.c:1262:25: call_function: calling ‘add_structured_data_id’ from ‘main’
#   53|   	add->next = next;
#   54|   	add->prev = prev;
#   55|-> 	prev->next = add;
#   56|   }
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def13]
util-linux-2.40.4/./include/list.h:55:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 48)’
util-linux-2.40.4/sys-utils/prlimit.c:491:5: enter_function: entry to ‘main’
util-linux-2.40.4/sys-utils/prlimit.c:542:15: branch_true: following ‘true’ branch (when ‘opt != -1’)...
util-linux-2.40.4/sys-utils/prlimit.c:545:17: branch_true: ...to here
util-linux-2.40.4/sys-utils/prlimit.c:547:25: call_function: calling ‘add_prlim’ from ‘main’
#   53|   	add->next = next;
#   54|   	add->prev = prev;
#   55|-> 	prev->next = add;
#   56|   }
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def14]
util-linux-2.40.4/./include/list.h:55:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 56)’
util-linux-2.40.4/text-utils/hexdump-parse.c:478:26: enter_function: entry to ‘color_fmt’
util-linux-2.40.4/text-utils/hexdump-parse.c:484:20: call_function: calling ‘xmalloc’ from ‘color_fmt’
util-linux-2.40.4/text-utils/hexdump-parse.c:484:20: return_function: returning to ‘color_fmt’ from ‘xmalloc’
util-linux-2.40.4/text-utils/hexdump-parse.c:485:23: call_function: calling ‘xcalloc’ from ‘color_fmt’
util-linux-2.40.4/text-utils/hexdump-parse.c:485:23: return_function: returning to ‘color_fmt’ from ‘xcalloc’
util-linux-2.40.4/text-utils/hexdump-parse.c:492:16: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:495:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:500:23: branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:500:23: call_function: calling ‘xstrndup’ from ‘color_fmt’
util-linux-2.40.4/text-utils/hexdump-parse.c:500:23: return_function: returning to ‘color_fmt’ from ‘xstrndup’
util-linux-2.40.4/text-utils/hexdump-parse.c:505:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:509:21: branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:509:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:551:25: branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:555:20: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:558:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:562:29: branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:562:28: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:563:33: branch_true: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:568:36: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:571:36: branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:571:36: branch_false: following ‘false’ branch...
 branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:575:40: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:576:46: branch_true: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:576:46: call_function: calling ‘xcalloc’ from ‘color_fmt’
util-linux-2.40.4/text-utils/hexdump-parse.c:576:46: return_function: returning to ‘color_fmt’ from ‘xcalloc’
util-linux-2.40.4/text-utils/hexdump-parse.c:582:41: call_function: inlined call to ‘list_add_tail’ from ‘color_fmt’
#   53|   	add->next = next;
#   54|   	add->prev = prev;
#   55|-> 	prev->next = add;
#   56|   }
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def15]
util-linux-2.40.4/./include/list.h:55:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(24)’
util-linux-2.40.4/misc-utils/lsclocks.c:516:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/lsclocks.c:569:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
util-linux-2.40.4/misc-utils/lsclocks.c:570:17: branch_true: ...to here
util-linux-2.40.4/misc-utils/lsclocks.c:591:38: call_function: calling ‘xmalloc’ from ‘main’
util-linux-2.40.4/misc-utils/lsclocks.c:591:38: return_function: returning to ‘main’ from ‘xmalloc’
util-linux-2.40.4/misc-utils/lsclocks.c:593:25: call_function: inlined call to ‘list_add’ from ‘main’
#   53|   	add->next = next;
#   54|   	add->prev = prev;
#   55|-> 	prev->next = add;
#   56|   }
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def16]
util-linux-2.40.4/./include/list.h:55:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(32)’
util-linux-2.40.4/misc-utils/lsfd-unkn.c:872:13: enter_function: entry to ‘add_inode’
util-linux-2.40.4/misc-utils/lsfd-unkn.c:874:44: call_function: calling ‘xmalloc’ from ‘add_inode’
util-linux-2.40.4/misc-utils/lsfd-unkn.c:874:44: return_function: returning to ‘add_inode’ from ‘xmalloc’
util-linux-2.40.4/misc-utils/lsfd-unkn.c:880:9: call_function: inlined call to ‘list_add_tail’ from ‘add_inode’
#   53|   	add->next = next;
#   54|   	add->prev = prev;
#   55|-> 	prev->next = add;
#   56|   }
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def17]
util-linux-2.40.4/./include/list.h:81:9: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cxt'
util-linux-2.40.4/libfdisk/src/wipe.c:57:5: enter_function: entry to 'fdisk_set_wipe_area'
util-linux-2.40.4/libfdisk/src/wipe.c:64:12: branch_false: following 'false' branch...
util-linux-2.40.4/libfdisk/src/wipe.c:67:14: branch_false: ...to here
util-linux-2.40.4/libfdisk/src/wipe.c:67:14: call_function: calling 'fdisk_get_wipe_area' from 'fdisk_set_wipe_area'
util-linux-2.40.4/libfdisk/src/wipe.c:67:14: return_function: returning to 'fdisk_set_wipe_area' from 'fdisk_get_wipe_area'
util-linux-2.40.4/libfdisk/src/wipe.c:70:12: branch_false: following 'false' branch (when 'enable != 0')...
util-linux-2.40.4/libfdisk/src/wipe.c:83:12: branch_false: ...to here
util-linux-2.40.4/libfdisk/src/wipe.c:83:12: branch_false: following 'false' branch...
util-linux-2.40.4/libfdisk/src/wipe.c:86:14: branch_false: ...to here
util-linux-2.40.4/libfdisk/src/wipe.c:87:12: branch_false: following 'false' branch (when 'wp' is non-NULL)...
util-linux-2.40.4/libfdisk/src/wipe.c:90:9: branch_false: ...to here
util-linux-2.40.4/libfdisk/src/wipe.c:96:9: call_function: inlined call to 'list_add_tail' from 'fdisk_set_wipe_area'
#   79|   _INLINE_ void list_add_tail(struct list_head *add, struct list_head *head)
#   80|   {
#   81|-> 	__list_add(add, head->prev, head);
#   82|   }
#   83|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def18]
util-linux-2.40.4/./include/list.h:311:17: warning[-Wanalyzer-null-dereference]: dereference of NULL 'list'
util-linux-2.40.4/libsmartcols/src/calculate.c:413:5: enter_function: entry to '__scols_calculate'
util-linux-2.40.4/libsmartcols/src/calculate.c:462:12: branch_false: following 'false' branch...
util-linux-2.40.4/libsmartcols/src/calculate.c:468:25: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/calculate.c:496:16: branch_true: following 'true' branch...
util-linux-2.40.4/libsmartcols/src/calculate.c:500:20: branch_true: ...to here
util-linux-2.40.4/libsmartcols/src/calculate.c:500:20: branch_true: following 'true' branch (when 'sorted == 0')...
util-linux-2.40.4/libsmartcols/src/calculate.c:501:25: branch_true: ...to here
util-linux-2.40.4/libsmartcols/src/calculate.c:502:25: call_function: inlined call to 'sort_columns' from '__scols_calculate'
#  309|   		(*cmp)(tail->next, tail->next, data);
#  310|   
#  311|-> 		tail->next->prev = tail;
#  312|   		tail = tail->next;
#  313|   	} while (tail->next);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def19]
util-linux-2.40.4/./include/strutils.h:240:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(*<unknown>)’
util-linux-2.40.4/disk-utils/partx.c:797:5: enter_function: entry to ‘main’
util-linux-2.40.4/disk-utils/partx.c:922:13: branch_true: following ‘true’ branch...
util-linux-2.40.4/disk-utils/partx.c:923:17: branch_true: ...to here
util-linux-2.40.4/disk-utils/partx.c:932:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/partx.c:942:23: branch_false: ...to here
util-linux-2.40.4/disk-utils/partx.c:942:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/disk-utils/partx.c:947:30: branch_true: ...to here
util-linux-2.40.4/disk-utils/partx.c:949:20: branch_false: following ‘false’ branch (when the strings are non-equal)...
util-linux-2.40.4/disk-utils/partx.c:954:49: branch_false: ...to here
util-linux-2.40.4/disk-utils/partx.c:954:37: call_function: calling ‘xstrdup’ from ‘main’
util-linux-2.40.4/disk-utils/partx.c:954:37: return_function: returning to ‘main’ from ‘xstrdup’
util-linux-2.40.4/disk-utils/partx.c:956:53: call_function: calling ‘startswith’ from ‘main’
util-linux-2.40.4/disk-utils/partx.c:956:53: return_function: returning to ‘main’ from ‘startswith’
util-linux-2.40.4/./include/strutils.h:240:13: danger: ‘xstrdup(*<unknown>)’ leaks here; was allocated at [(14)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/13)
#  238|   	size_t sz = prefix ? strlen(prefix) : 0;
#  239|   
#  240|->         if (s && sz && strncmp(s, prefix, sz) == 0)
#  241|                   return s + sz;
#  242|   	return NULL;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def20]
util-linux-2.40.4/./include/xalloc.h:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((*valuelen >> 1) + 1)’
util-linux-2.40.4/misc-utils/uuidgen.c:50:14: enter_function: entry to ‘unhex’
util-linux-2.40.4/misc-utils/uuidgen.c:55:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/uuidgen.c:61:26: branch_false: ...to here
util-linux-2.40.4/misc-utils/uuidgen.c:61:18: call_function: calling ‘xmalloc’ from ‘unhex’
util-linux-2.40.4/misc-utils/uuidgen.c:61:18: return_function: returning to ‘unhex’ from ‘xmalloc’
util-linux-2.40.4/misc-utils/uuidgen.c:63:25: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/uuidgen.c:64:26: branch_true: ...to here
util-linux-2.40.4/misc-utils/uuidgen.c:65:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/uuidgen.c:67:26: branch_false: ...to here
util-linux-2.40.4/./include/xalloc.h:34:13: danger: ‘xmalloc((*valuelen >> 1) + 1)’ leaks here; was allocated at [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5)
#   32|   	void *ret = malloc(size);
#   33|   
#   34|-> 	if (!ret && size)
#   35|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   36|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def21]
util-linux-2.40.4/./include/xalloc.h:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(32)’
util-linux-2.40.4/sys-utils/setpriv-landlock.c:128:6: enter_function: entry to ‘parse_landlock_rule’
util-linux-2.40.4/sys-utils/setpriv-landlock.c:130:44: call_function: calling ‘xmalloc’ from ‘parse_landlock_rule’
util-linux-2.40.4/sys-utils/setpriv-landlock.c:130:44: return_function: returning to ‘parse_landlock_rule’ from ‘xmalloc’
util-linux-2.40.4/sys-utils/setpriv-landlock.c:135:20: call_function: calling ‘startswith’ from ‘parse_landlock_rule’
util-linux-2.40.4/sys-utils/setpriv-landlock.c:135:20: return_function: returning to ‘parse_landlock_rule’ from ‘startswith’
util-linux-2.40.4/./include/xalloc.h:34:13: danger: ‘xmalloc(32)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#   32|   	void *ret = malloc(size);
#   33|   
#   34|-> 	if (!ret && size)
#   35|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   36|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def22]
util-linux-2.40.4/./include/xalloc.h:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(4096)’
util-linux-2.40.4/disk-utils/fsck.cramfs.c:676:5: enter_function: entry to ‘main’
util-linux-2.40.4/disk-utils/fsck.cramfs.c:724:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/fsck.cramfs.c:728:24: branch_false: ...to here
util-linux-2.40.4/disk-utils/fsck.cramfs.c:730:9: call_function: calling ‘test_super’ from ‘main’
util-linux-2.40.4/disk-utils/fsck.cramfs.c:730:9: return_function: returning to ‘main’ from ‘test_super’
util-linux-2.40.4/disk-utils/fsck.cramfs.c:731:9: call_function: calling ‘test_crc’ from ‘main’
#   32|   	void *ret = malloc(size);
#   33|   
#   34|-> 	if (!ret && size)
#   35|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   36|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def23]
util-linux-2.40.4/./include/xalloc.h:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(72)’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1648:27: enter_function: entry to ‘raw6_xinfo_scan_line’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1662:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1672:13: branch_false: ...to here
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1672:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1675:15: branch_false: ...to here
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1675:15: call_function: calling ‘xmalloc’ from ‘raw6_xinfo_scan_line’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1675:15: return_function: returning to ‘raw6_xinfo_scan_line’ from ‘xmalloc’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1681:25: branch_true: following ‘true’ branch (when ‘i != 4’)...
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1682:50: branch_true: ...to here
util-linux-2.40.4/./include/xalloc.h:34:13: danger: ‘xmalloc(72)’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#   32|   	void *ret = malloc(size);
#   33|   
#   34|-> 	if (!ret && size)
#   35|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   36|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def24]
util-linux-2.40.4/./include/xalloc.h:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(len + 257)’
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:703:5: enter_function: entry to ‘main’
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:800:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:804:23: branch_false: ...to here
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:810:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:812:14: branch_false: ...to here
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:813:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:816:13: branch_false: ...to here
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:816:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:819:22: branch_false: ...to here
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:819:22: call_function: calling ‘xcalloc’ from ‘main’
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:819:22: return_function: returning to ‘main’ from ‘xcalloc’
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:824:28: call_function: calling ‘parse_directory’ from ‘main’
#   32|   	void *ret = malloc(size);
#   33|   
#   34|-> 	if (!ret && size)
#   35|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   36|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
util-linux-2.40.4/./include/xalloc.h:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(len)’
util-linux-2.40.4/sys-utils/readprofile.c:121:5: enter_function: entry to ‘main’
util-linux-2.40.4/sys-utils/readprofile.c:212:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/readprofile.c:237:23: branch_false: ...to here
util-linux-2.40.4/sys-utils/readprofile.c:237:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/readprofile.c:238:29: branch_false: ...to here
util-linux-2.40.4/sys-utils/readprofile.c:237:13: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/readprofile.c:239:17: branch_false: ...to here
util-linux-2.40.4/sys-utils/readprofile.c:237:13: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/readprofile.c:241:12: branch_false: ...to here
util-linux-2.40.4/sys-utils/readprofile.c:241:12: branch_false: following ‘false’ branch (when ‘len != 0’)...
util-linux-2.40.4/sys-utils/readprofile.c:244:15: branch_false: ...to here
util-linux-2.40.4/sys-utils/readprofile.c:244:15: call_function: calling ‘xmalloc’ from ‘main’
util-linux-2.40.4/sys-utils/readprofile.c:244:15: return_function: returning to ‘main’ from ‘xmalloc’
util-linux-2.40.4/./include/xalloc.h:34:13: danger: ‘xmalloc(len)’ leaks here; was allocated at [(14)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/13)
#   32|   	void *ret = malloc(size);
#   33|   
#   34|-> 	if (!ret && size)
#   35|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   36|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def26]
util-linux-2.40.4/./include/xalloc.h:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrndup(a, (long unsigned int)(p2 - a))’
util-linux-2.40.4/text-utils/hexdump-parse.c:228:6: enter_function: entry to ‘rewrite_rules’
util-linux-2.40.4/text-utils/hexdump-parse.c:238:9: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:245:17: branch_true: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:246:24: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:247:30: branch_true: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:247:30: call_function: calling ‘xcalloc’ from ‘rewrite_rules’
util-linux-2.40.4/text-utils/hexdump-parse.c:247:30: return_function: returning to ‘rewrite_rules’ from ‘xcalloc’
util-linux-2.40.4/text-utils/hexdump-parse.c:257:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:267:29: branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:270:44: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:283:25: branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:294:33: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:295:41: branch_true: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:403:28: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:404:36: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:408:45: branch_true: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:410:44: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:411:65: call_function: calling ‘xstrndup’ from ‘rewrite_rules’
util-linux-2.40.4/text-utils/hexdump-parse.c:411:65: return_function: returning to ‘rewrite_rules’ from ‘xstrndup’
util-linux-2.40.4/text-utils/hexdump-parse.c:411:65: call_function: calling ‘color_fmt’ from ‘rewrite_rules’
#   32|   	void *ret = malloc(size);
#   33|   
#   34|-> 	if (!ret && size)
#   35|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   36|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def27]
util-linux-2.40.4/./include/xalloc.h:56:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
util-linux-2.40.4/sys-utils/irq-common.c:529:24: enter_function: entry to ‘get_scols_table’
util-linux-2.40.4/sys-utils/irq-common.c:543:16: call_function: calling ‘get_irqinfo’ from ‘get_scols_table’
#   54|   void *xreallocarray(void *ptr, const size_t nelems, const size_t size)
#   55|   {
#   56|-> 	void *ret = reallocarray(ptr, nelems, size);
#   57|   
#   58|   	if (!ret && size && nelems)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
util-linux-2.40.4/./include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘open_pidfds(n_pids,  parse_pids(n_pids,  argv + (long unsigned int)parse_options(argc,  argv) * 8))’
util-linux-2.40.4/misc-utils/waitpid.c:223:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/waitpid.c:234:12: branch_false: following ‘false’ branch (when ‘n_pids != 0’)...
util-linux-2.40.4/misc-utils/waitpid.c:237:13: branch_false: ...to here
util-linux-2.40.4/misc-utils/waitpid.c:241:23: call_function: calling ‘parse_pids’ from ‘main’
util-linux-2.40.4/misc-utils/waitpid.c:241:23: return_function: returning to ‘main’ from ‘parse_pids’
util-linux-2.40.4/misc-utils/waitpid.c:243:18: call_function: calling ‘open_pidfds’ from ‘main’
util-linux-2.40.4/misc-utils/waitpid.c:243:18: return_function: returning to ‘main’ from ‘open_pidfds’
util-linux-2.40.4/./include/xalloc.h:70:13: danger: ‘open_pidfds(n_pids,  parse_pids(n_pids,  argv + (long unsigned int)parse_options(argc,  argv) * 8))’ leaks here; was allocated at [(18)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/17)
#   68|   	void *ret = calloc(nelems, size);
#   69|   
#   70|-> 	if (!ret && size && nelems)
#   71|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   72|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
util-linux-2.40.4/./include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘parse_pids(n_pids,  argv + (long unsigned int)parse_options(argc,  argv) * 8)’
util-linux-2.40.4/misc-utils/waitpid.c:223:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/waitpid.c:234:12: branch_false: following ‘false’ branch (when ‘n_pids != 0’)...
util-linux-2.40.4/misc-utils/waitpid.c:237:13: branch_false: ...to here
util-linux-2.40.4/misc-utils/waitpid.c:241:23: call_function: calling ‘parse_pids’ from ‘main’
util-linux-2.40.4/misc-utils/waitpid.c:241:23: return_function: returning to ‘main’ from ‘parse_pids’
util-linux-2.40.4/misc-utils/waitpid.c:243:18: call_function: calling ‘open_pidfds’ from ‘main’
util-linux-2.40.4/misc-utils/waitpid.c:243:18: return_function: returning to ‘main’ from ‘open_pidfds’
util-linux-2.40.4/./include/xalloc.h:70:13: danger: ‘parse_pids(n_pids,  argv + (long unsigned int)parse_options(argc,  argv) * 8)’ leaks here; was allocated at [(8)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/7)
#   68|   	void *ret = calloc(nelems, size);
#   69|   
#   70|-> 	if (!ret && size && nelems)
#   71|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   72|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
util-linux-2.40.4/./include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 112)’
util-linux-2.40.4/login-utils/lslogins.c:1484:5: enter_function: entry to ‘main’
util-linux-2.40.4/login-utils/lslogins.c:1489:40: call_function: calling ‘xcalloc’ from ‘main’
util-linux-2.40.4/login-utils/lslogins.c:1489:40: return_function: returning to ‘main’ from ‘xcalloc’
util-linux-2.40.4/login-utils/lslogins.c:1554:9: call_function: inlined call to ‘err_columns_index’ from ‘main’
util-linux-2.40.4/login-utils/lslogins.c:1554:9: branch_false: ...to here
util-linux-2.40.4/login-utils/lslogins.c:1555:9: call_function: inlined call to ‘err_columns_index’ from ‘main’
util-linux-2.40.4/login-utils/lslogins.c:1555:9: branch_false: ...to here
util-linux-2.40.4/login-utils/lslogins.c:1676:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/lslogins.c:1682:19: branch_false: ...to here
util-linux-2.40.4/./include/xalloc.h:70:13: danger: ‘xcalloc(1, 112)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#   68|   	void *ret = calloc(nelems, size);
#   69|   
#   70|-> 	if (!ret && size && nelems)
#   71|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   72|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def31]
util-linux-2.40.4/./include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 216)’
util-linux-2.40.4/sys-utils/lscpu.c:1206:5: enter_function: entry to ‘main’
util-linux-2.40.4/sys-utils/lscpu.c:1249:15: call_function: inlined call to ‘lscpu_new_context’ from ‘main’
util-linux-2.40.4/sys-utils/lscpu.c:1249:15: call_function: inlined call to ‘lscpu_new_context’ from ‘main’
util-linux-2.40.4/sys-utils/lscpu.c:1326:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/lscpu.c:1335:12: branch_false: ...to here
util-linux-2.40.4/sys-utils/lscpu.c:1335:12: branch_false: following ‘false’ branch (when ‘cpu_modifier_specified == 0’)...
util-linux-2.40.4/sys-utils/lscpu.c:1343:13: branch_false: ...to here
util-linux-2.40.4/./include/xalloc.h:70:13: danger: ‘xcalloc(1, 216)’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#   68|   	void *ret = calloc(nelems, size);
#   69|   
#   70|-> 	if (!ret && size && nelems)
#   71|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   72|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def32]
util-linux-2.40.4/./include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 24)’
util-linux-2.40.4/misc-utils/kill.c:483:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/kill.c:496:16: call_function: calling ‘parse_arguments’ from ‘main’
#   68|   	void *ret = calloc(nelems, size);
#   69|   
#   70|-> 	if (!ret && size && nelems)
#   71|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   72|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def33]
util-linux-2.40.4/./include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 240)’
util-linux-2.40.4/misc-utils/hardlink.c:828:12: enter_function: entry to ‘inserter’
util-linux-2.40.4/misc-utils/hardlink.c:841:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/hardlink.c:853:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/hardlink.c:861:34: branch_false: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:871:15: call_function: calling ‘xcalloc’ from ‘inserter’
util-linux-2.40.4/misc-utils/hardlink.c:871:15: return_function: returning to ‘inserter’ from ‘xcalloc’
util-linux-2.40.4/misc-utils/hardlink.c:872:22: call_function: calling ‘xcalloc’ from ‘inserter’
util-linux-2.40.4/misc-utils/hardlink.c:872:22: return_function: returning to ‘inserter’ from ‘xcalloc’
util-linux-2.40.4/./include/xalloc.h:70:13: danger: ‘xcalloc(1, 240)’ leaks here; was allocated at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#   68|   	void *ret = calloc(nelems, size);
#   69|   
#   70|-> 	if (!ret && size && nelems)
#   71|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   72|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
util-linux-2.40.4/./include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 72)’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:194:13: enter_function: entry to ‘load_sock_xinfo_with_fd’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:197:17: call_function: calling ‘load_sock_xinfo_no_nsswitch’ from ‘load_sock_xinfo_with_fd’
#   68|   	void *ret = calloc(nelems, size);
#   69|   
#   70|-> 	if (!ret && size && nelems)
#   71|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   72|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
util-linux-2.40.4/./include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 8)’
util-linux-2.40.4/sys-utils/lsipc.c:1105:5: enter_function: entry to ‘main’
util-linux-2.40.4/sys-utils/lsipc.c:1110:37: call_function: calling ‘xcalloc’ from ‘main’
util-linux-2.40.4/sys-utils/lsipc.c:1110:37: return_function: returning to ‘main’ from ‘xcalloc’
util-linux-2.40.4/sys-utils/lsipc.c:1267:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/sys-utils/lsipc.c:1269:21: branch_true: ...to here
util-linux-2.40.4/./include/xalloc.h:70:13: danger: ‘xcalloc(1, 8)’ leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#   68|   	void *ret = calloc(nelems, size);
#   69|   
#   70|-> 	if (!ret && size && nelems)
#   71|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   72|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def36]
util-linux-2.40.4/./include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(n_pids, 4)’
util-linux-2.40.4/misc-utils/waitpid.c:223:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/waitpid.c:234:12: branch_false: following ‘false’ branch (when ‘n_pids != 0’)...
util-linux-2.40.4/misc-utils/waitpid.c:237:13: branch_false: ...to here
util-linux-2.40.4/misc-utils/waitpid.c:241:23: call_function: calling ‘parse_pids’ from ‘main’
util-linux-2.40.4/misc-utils/waitpid.c:241:23: return_function: returning to ‘main’ from ‘parse_pids’
util-linux-2.40.4/misc-utils/waitpid.c:243:18: call_function: calling ‘open_pidfds’ from ‘main’
#   68|   	void *ret = calloc(nelems, size);
#   69|   
#   70|-> 	if (!ret && size && nelems)
#   71|   		err(XALLOC_EXIT_CODE, "cannot allocate %zu bytes", size);
#   72|   	return ret;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def37]
util-linux-2.40.4/./include/xalloc.h:176:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc(sz)’ where non-null expected
util-linux-2.40.4/term-utils/wall.c:324:14: enter_function: entry to ‘makemsg’
util-linux-2.40.4/term-utils/wall.c:330:16: call_function: calling ‘xmalloc’ from ‘makemsg’
util-linux-2.40.4/term-utils/wall.c:330:16: return_function: returning to ‘makemsg’ from ‘xmalloc’
util-linux-2.40.4/term-utils/wall.c:332:12: branch_true: following ‘true’ branch (when ‘print_banner == 1’)...
util-linux-2.40.4/term-utils/wall.c:333:34: branch_true: ...to here
util-linux-2.40.4/term-utils/wall.c:333:34: call_function: calling ‘xgethostname’ from ‘makemsg’
#  174|   
#  175|   	name = xmalloc(sizeof(char) * sz);
#  176|-> 	if (gethostname(name, sz) != 0) {
#  177|   		free(name);
#  178|   		return NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def38]
util-linux-2.40.4/disk-utils/fdformat.c:127:45: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xmalloc((long unsigned int)track_size) + (sizetype)count’
util-linux-2.40.4/disk-utils/fdformat.c:175:5: enter_function: entry to ‘main’
util-linux-2.40.4/disk-utils/fdformat.c:201:16: branch_true: following ‘true’ branch (when ‘ch != -1’)...
util-linux-2.40.4/disk-utils/fdformat.c:202:17: branch_true: ...to here
util-linux-2.40.4/disk-utils/fdformat.c:227:12: branch_false: following ‘false’ branch (when ‘argc > 0’)...
util-linux-2.40.4/disk-utils/fdformat.c:231:13: branch_false: ...to here
util-linux-2.40.4/disk-utils/fdformat.c:231:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/fdformat.c:233:14: branch_false: ...to here
util-linux-2.40.4/disk-utils/fdformat.c:233:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/fdformat.c:236:16: branch_false: ...to here
util-linux-2.40.4/disk-utils/fdformat.c:237:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/fdformat.c:239:13: branch_false: ...to here
util-linux-2.40.4/disk-utils/fdformat.c:239:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/fdformat.c:244:42: branch_false: ...to here
util-linux-2.40.4/disk-utils/fdformat.c:246:12: branch_false: following ‘false’ branch (when ‘has_user_defined_track_to != 0’)...
util-linux-2.40.4/disk-utils/fdformat.c:249:27: branch_false: ...to here
util-linux-2.40.4/disk-utils/fdformat.c:249:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/fdformat.c:251:12: branch_false: ...to here
util-linux-2.40.4/disk-utils/fdformat.c:251:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/fdformat.c:253:12: branch_false: ...to here
util-linux-2.40.4/disk-utils/fdformat.c:253:12: branch_false: following ‘false’ branch (when ‘track_to >= track_from’)...
util-linux-2.40.4/disk-utils/fdformat.c:256:9: branch_false: ...to here
util-linux-2.40.4/disk-utils/fdformat.c:256:9: call_function: calling ‘format_disk’ from ‘main’
util-linux-2.40.4/disk-utils/fdformat.c:256:9: return_function: returning to ‘main’ from ‘format_disk’
util-linux-2.40.4/disk-utils/fdformat.c:258:12: branch_true: following ‘true’ branch (when ‘verify != 0’)...
util-linux-2.40.4/disk-utils/fdformat.c:259:17: branch_true: ...to here
util-linux-2.40.4/disk-utils/fdformat.c:259:17: call_function: calling ‘verify_disk’ from ‘main’
#  125|   				}
#  126|   				for (count = 0; count < track_size; count++)
#  127|-> 					if (data[count] != FD_FILL_BYTE) {
#  128|   						if (retries_left) {
#  129|   							format_begin(ctrl);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def39]
util-linux-2.40.4/disk-utils/fdformat.c:127:45: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xmalloc((long unsigned int)track_size)’
util-linux-2.40.4/disk-utils/fdformat.c:81:13: enter_function: entry to ‘verify_disk’
util-linux-2.40.4/disk-utils/fdformat.c:89:16: call_function: calling ‘xmalloc’ from ‘verify_disk’
util-linux-2.40.4/disk-utils/fdformat.c:89:16: return_function: returning to ‘verify_disk’ from ‘xmalloc’
util-linux-2.40.4/disk-utils/fdformat.c:97:42: branch_true: following ‘true’ branch...
util-linux-2.40.4/disk-utils/fdformat.c:98:22: branch_true: ...to here
util-linux-2.40.4/disk-utils/fdformat.c:98:40: branch_true: following ‘true’ branch...
util-linux-2.40.4/disk-utils/fdformat.c:101:25: branch_true: ...to here
util-linux-2.40.4/disk-utils/fdformat.c:126:49: branch_true: following ‘true’ branch (when ‘count < track_size’)...
util-linux-2.40.4/disk-utils/fdformat.c:127:49: branch_true: ...to here
util-linux-2.40.4/disk-utils/fdformat.c:127:45: danger: ‘xmalloc((long unsigned int)track_size) + (sizetype)count’ could be NULL: unchecked value from [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#  125|   				}
#  126|   				for (count = 0; count < track_size; count++)
#  127|-> 					if (data[count] != FD_FILL_BYTE) {
#  128|   						if (retries_left) {
#  129|   							format_begin(ctrl);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def40]
util-linux-2.40.4/disk-utils/fdisk.c:657:12: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
util-linux-2.40.4/disk-utils/fdisk.c:646:12: branch_false: following ‘false’ branch (when ‘len != 0’)...
util-linux-2.40.4/disk-utils/fdisk.c:649:16: branch_false: ...to here
util-linux-2.40.4/disk-utils/fdisk.c:649:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/disk-utils/fdisk.c:651:23: branch_true: ...to here
util-linux-2.40.4/disk-utils/fdisk.c:651:23: acquire_memory: allocated here
util-linux-2.40.4/disk-utils/fdisk.c:652:20: branch_false: following ‘false’ branch (when ‘str’ is non-NULL)...
util-linux-2.40.4/disk-utils/fdisk.c:656:14: branch_false: ...to here
util-linux-2.40.4/disk-utils/fdisk.c:657:12: branch_true: following ‘true’ branch...
 branch_true: ...to here
util-linux-2.40.4/disk-utils/fdisk.c:657:12: danger: ‘str’ leaks here; was allocated at [(5)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/4)
#  655|   
#  656|   	rc = strtosize(str, res);
#  657|-> 	if (rc)
#  658|   		return rc;
#  659|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def41]
util-linux-2.40.4/disk-utils/fdisk.c:822:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘p0’ where non-null expected
util-linux-2.40.4/disk-utils/fdisk.c:858:13: enter_function: entry to ‘dump_blkdev’
util-linux-2.40.4/disk-utils/fdisk.c:866:9: branch_true: following ‘true’ branch...
util-linux-2.40.4/disk-utils/fdisk.c:868:13: branch_true: ...to here
util-linux-2.40.4/disk-utils/fdisk.c:868:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/fdisk.c:871:38: branch_false: ...to here
util-linux-2.40.4/disk-utils/fdisk.c:871:38: call_function: calling ‘xmalloc’ from ‘dump_blkdev’
util-linux-2.40.4/disk-utils/fdisk.c:871:38: return_function: returning to ‘dump_blkdev’ from ‘xmalloc’
util-linux-2.40.4/disk-utils/fdisk.c:873:21: call_function: calling ‘read_all’ from ‘dump_blkdev’
util-linux-2.40.4/disk-utils/fdisk.c:873:21: return_function: returning to ‘dump_blkdev’ from ‘read_all’
util-linux-2.40.4/disk-utils/fdisk.c:873:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/fdisk.c:876:25: branch_false: ...to here
util-linux-2.40.4/disk-utils/fdisk.c:876:25: call_function: calling ‘dump_buffer’ from ‘dump_blkdev’
#  820|   
#  821|   	for (next = i + 16; next < sz; next += 16) {
#  822|-> 		if (memcmp(p0, buf + next, 16) != 0)
#  823|   			break;
#  824|   	}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def42]
util-linux-2.40.4/disk-utils/fdisk.c:841:33: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘buf’
util-linux-2.40.4/disk-utils/fdisk.c:858:13: enter_function: entry to ‘dump_blkdev’
util-linux-2.40.4/disk-utils/fdisk.c:866:9: branch_true: following ‘true’ branch...
util-linux-2.40.4/disk-utils/fdisk.c:868:13: branch_true: ...to here
util-linux-2.40.4/disk-utils/fdisk.c:868:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/fdisk.c:871:38: branch_false: ...to here
util-linux-2.40.4/disk-utils/fdisk.c:871:38: call_function: calling ‘xmalloc’ from ‘dump_blkdev’
util-linux-2.40.4/disk-utils/fdisk.c:871:38: return_function: returning to ‘dump_blkdev’ from ‘xmalloc’
util-linux-2.40.4/disk-utils/fdisk.c:873:21: call_function: calling ‘read_all’ from ‘dump_blkdev’
util-linux-2.40.4/disk-utils/fdisk.c:873:21: return_function: returning to ‘dump_blkdev’ from ‘read_all’
util-linux-2.40.4/disk-utils/fdisk.c:873:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/fdisk.c:876:25: branch_false: ...to here
util-linux-2.40.4/disk-utils/fdisk.c:876:25: call_function: calling ‘dump_buffer’ from ‘dump_blkdev’
#  839|   			printf("%08jx ", (intmax_t)base + i);
#  840|   		}
#  841|-> 		printf(" %02x", buf[i]);
#  842|   		if (l == 7)				/* words separator */
#  843|   			fputs(" ", stdout);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def43]
util-linux-2.40.4/disk-utils/fsck.c:992:28: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(fs_type)’
util-linux-2.40.4/disk-utils/fsck.c:1617:5: enter_function: entry to ‘main’
util-linux-2.40.4/disk-utils/fsck.c:1647:9: call_function: calling ‘parse_argv’ from ‘main’
#  990|   			s += 2;
#  991|   			negate = 1;
#  992|-> 		} else if (*s == '!') {
#  993|   			s++;
#  994|   			negate = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def44]
util-linux-2.40.4/disk-utils/fsck.c:1002:25: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(fs_type)’
util-linux-2.40.4/disk-utils/fsck.c:1617:5: enter_function: entry to ‘main’
util-linux-2.40.4/disk-utils/fsck.c:1647:9: call_function: calling ‘parse_argv’ from ‘main’
# 1000|   			s += 5;
# 1001|   		loop_special_case:
# 1002|-> 			cmp->type[num] = negate ? FS_TYPE_NEGOPT : FS_TYPE_OPT;
# 1003|   		} else {
# 1004|   			if (first_negate) {

Error: GCC_ANALYZER_WARNING (CWE-401): [#def45]
util-linux-2.40.4/disk-utils/fsck.c:1008:41: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(fs_type)’
util-linux-2.40.4/disk-utils/fsck.c:1617:5: enter_function: entry to ‘main’
util-linux-2.40.4/disk-utils/fsck.c:1647:9: call_function: calling ‘parse_argv’ from ‘main’
# 1006|   				first_negate = 0;
# 1007|   			}
# 1008|-> 			if ((negate && !cmp->negate) ||
# 1009|   			    (!negate && cmp->negate)) {
# 1010|   				errx(FSCK_EX_USAGE,

Error: GCC_ANALYZER_WARNING (CWE-688): [#def46]
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:342:21: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc(len + 257)’ where non-null expected
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:703:5: enter_function: entry to ‘main’
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:800:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:804:23: branch_false: ...to here
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:810:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:812:14: branch_false: ...to here
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:813:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:816:13: branch_false: ...to here
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:816:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:819:22: branch_false: ...to here
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:819:22: call_function: calling ‘xcalloc’ from ‘main’
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:819:22: return_function: returning to ‘main’ from ‘xcalloc’
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:824:28: call_function: calling ‘parse_directory’ from ‘main’
#  340|   		memcpy(endpath, dirent->d_name, namelen + 1);
#  341|   
#  342|-> 		if (lstat(path, &st) < 0) {
#  343|   			warn(_("stat of %s failed"), endpath);
#  344|   			warn_skip = 1;

Error: CPPCHECK_WARNING (CWE-190): [#def47]
util-linux-2.40.4/disk-utils/mkfs.cramfs.c:379: error[integerOverflow]: Signed integer overflow for expression '-(1<<24)'.
#  377|   		} else {
#  378|   			entry->size = st.st_rdev;
#  379|-> 			if (entry->size & -(1<<CRAMFS_SIZE_WIDTH))
#  380|   				warn_dev = 1;
#  381|   		}

Error: GCC_ANALYZER_WARNING (CWE-401): [#def48]
util-linux-2.40.4/lib/colors.c:393:12: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(name)'
util-linux-2.40.4/lib/colors.c:679:13: enter_function: entry to 'color_scheme_get_sequence'
util-linux-2.40.4/lib/colors.c:686:14: call_function: calling 'colors_get_scheme' from 'color_scheme_get_sequence'
#  391|   	cs->seq = seq;
#  392|   	cs->name = strdup(name);
#  393|-> 	if (!cs->name)
#  394|   		goto err;
#  395|   

Error: GCC_ANALYZER_WARNING: [#def49]
util-linux-2.40.4/lib/pager.c:303:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
util-linux-2.40.4/lib/pager.c:295:6: enter_function: entry to ‘pager_close’
util-linux-2.40.4/lib/pager.c:297:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
util-linux-2.40.4/lib/pager.c:300:9: call_function: inlined call to ‘wait_for_pager’ from ‘pager_close’
util-linux-2.40.4/lib/pager.c:300:9: call_function: inlined call to ‘wait_for_pager’ from ‘pager_close’
util-linux-2.40.4/lib/pager.c:303:9: danger: ‘1’ could be invalid
#  301|   
#  302|   	/* restore original output */
#  303|-> 	dup2(pager_process.org_out, STDOUT_FILENO);
#  304|   	dup2(pager_process.org_err, STDERR_FILENO);
#  305|   

Error: GCC_ANALYZER_WARNING: [#def50]
util-linux-2.40.4/lib/pager.c:304:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘2’
util-linux-2.40.4/lib/pager.c:295:6: enter_function: entry to ‘pager_close’
util-linux-2.40.4/lib/pager.c:297:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
util-linux-2.40.4/lib/pager.c:300:9: call_function: inlined call to ‘wait_for_pager’ from ‘pager_close’
util-linux-2.40.4/lib/pager.c:300:9: call_function: inlined call to ‘wait_for_pager’ from ‘pager_close’
util-linux-2.40.4/lib/pager.c:304:9: danger: ‘2’ could be invalid
#  302|   	/* restore original output */
#  303|   	dup2(pager_process.org_out, STDOUT_FILENO);
#  304|-> 	dup2(pager_process.org_err, STDERR_FILENO);
#  305|   
#  306|   	close(pager_process.org_out);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def51]
util-linux-2.40.4/lib/randutils.c:143:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'random_get_fd()'
util-linux-2.40.4/lib/randutils.c:105:5: enter_function: entry to 'ul_random_get_bytes'
util-linux-2.40.4/lib/randutils.c:112:16: branch_false: following 'false' branch (when 'n == 0')...
util-linux-2.40.4/lib/randutils.c:132:13: branch_false: ...to here
util-linux-2.40.4/lib/randutils.c:132:12: branch_true: following 'true' branch...
util-linux-2.40.4/lib/randutils.c:140:26: branch_true: ...to here
util-linux-2.40.4/lib/randutils.c:140:26: call_function: calling 'random_get_fd' from 'ul_random_get_bytes'
util-linux-2.40.4/lib/randutils.c:140:26: return_function: returning to 'ul_random_get_bytes' from 'random_get_fd'
util-linux-2.40.4/lib/randutils.c:143:20: danger: 'random_get_fd()' leaks here; was opened at [(8)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/7)
#  141|   
#  142|   		lose_counter = 0;
#  143|-> 		if (fd >= 0) {
#  144|   			while (n > 0) {
#  145|   				ssize_t x = read(fd, cp, n);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def52]
util-linux-2.40.4/lib/strutils.c:234:33: warning[-Wanalyzer-null-dereference]: dereference of NULL 'p'
util-linux-2.40.4/lib/strutils.c:230:23: branch_true: following 'true' branch...
util-linux-2.40.4/lib/strutils.c:232:12: branch_false: following 'false' branch (when 'end' is NULL)...
util-linux-2.40.4/lib/strutils.c:234:16: branch_false: ...to here
util-linux-2.40.4/lib/strutils.c:234:16: branch_true: following 'true' branch (when 'p > str')...
util-linux-2.40.4/lib/strutils.c:234:33: branch_true: ...to here
util-linux-2.40.4/lib/strutils.c:234:33: danger: dereference of NULL 'p'
#  232|   	if (end)
#  233|   		*end = p;
#  234|-> 	return p && p > str && !*p;
#  235|   }
#  236|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def53]
util-linux-2.40.4/lib/strutils.c:234:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
util-linux-2.40.4/lib/strutils.c:230:23: branch_true: following ‘true’ branch...
util-linux-2.40.4/lib/strutils.c:232:12: branch_false: following ‘false’ branch (when ‘end’ is NULL)...
util-linux-2.40.4/lib/strutils.c:234:16: branch_false: ...to here
util-linux-2.40.4/lib/strutils.c:234:16: branch_true: following ‘true’ branch (when ‘p > str’)...
util-linux-2.40.4/lib/strutils.c:234:33: branch_true: ...to here
util-linux-2.40.4/lib/strutils.c:234:33: danger: dereference of NULL ‘p’
#  232|   	if (end)
#  233|   		*end = p;
#  234|-> 	return p && p > str && !*p;
#  235|   }
#  236|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def54]
util-linux-2.40.4/lib/strutils.c:246:33: warning[-Wanalyzer-null-dereference]: dereference of NULL 'p'
util-linux-2.40.4/lib/strutils.c:241:23: branch_true: following 'true' branch...
util-linux-2.40.4/lib/strutils.c:243:12: branch_false: following 'false' branch (when 'end' is NULL)...
util-linux-2.40.4/lib/strutils.c:246:16: branch_false: ...to here
util-linux-2.40.4/lib/strutils.c:246:16: branch_true: following 'true' branch (when 'p > str')...
util-linux-2.40.4/lib/strutils.c:246:33: branch_true: ...to here
util-linux-2.40.4/lib/strutils.c:246:33: danger: dereference of NULL 'p'
#  244|   		*end = p;
#  245|   
#  246|-> 	return p && p > str && !*p;
#  247|   }
#  248|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def55]
util-linux-2.40.4/lib/strutils.c:246:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
util-linux-2.40.4/lib/strutils.c:241:23: branch_true: following ‘true’ branch...
util-linux-2.40.4/lib/strutils.c:243:12: branch_false: following ‘false’ branch (when ‘end’ is NULL)...
util-linux-2.40.4/lib/strutils.c:246:16: branch_false: ...to here
util-linux-2.40.4/lib/strutils.c:246:16: branch_true: following ‘true’ branch (when ‘p > str’)...
util-linux-2.40.4/lib/strutils.c:246:33: branch_true: ...to here
util-linux-2.40.4/lib/strutils.c:246:33: danger: dereference of NULL ‘p’
#  244|   		*end = p;
#  245|   
#  246|-> 	return p && p > str && !*p;
#  247|   }
#  248|   

Error: GCC_ANALYZER_WARNING (CWE-416): [#def56]
util-linux-2.40.4/libblkid/src/partitions/partitions.c:330:9: warning[-Wanalyzer-use-after-free]: use after 'free' of 'tab'
util-linux-2.40.4/libblkid/src/partitions/partitions.c:585:12: enter_function: entry to 'partitions_probe'
util-linux-2.40.4/libblkid/src/partitions/partitions.c:598:12: branch_true: following 'true' branch...
util-linux-2.40.4/libblkid/src/partitions/partitions.c:599:17: branch_true: ...to here
util-linux-2.40.4/libblkid/src/partitions/partitions.c:599:17: call_function: calling 'partitions_init_data' from 'partitions_probe'
#  328|   		return;
#  329|   
#  330|-> 	tab->nparts--;
#  331|   	if (tab->nparts <= 0) {
#  332|   		list_del(&tab->t_tabs);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def57]
util-linux-2.40.4/libblkid/src/topology/dm.c:118:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'dmpipe[0]'
util-linux-2.40.4/libblkid/src/topology/dm.c:44:12: branch_false: following 'false' branch...
util-linux-2.40.4/libblkid/src/topology/dm.c:46:14: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/dm.c:46:12: branch_false: following 'false' branch...
 branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/dm.c:49:21: branch_true: following 'true' branch (when 'i != 3')...
util-linux-2.40.4/libblkid/src/topology/dm.c:51:26: branch_true: ...to here
util-linux-2.40.4/libblkid/src/topology/dm.c:57:12: branch_false: following 'false' branch (when 'cmd' is non-NULL)...
util-linux-2.40.4/libblkid/src/topology/dm.c:59:13: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/dm.c:59:12: branch_false: following 'false' branch...
util-linux-2.40.4/libblkid/src/topology/dm.c:64:17: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/dm.c:123:17: branch_false: following 'false' branch...
 branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/dm.c:118:16: danger: 'dmpipe[0]' leaks here
#  116|   
#  117|   	fclose(stream);
#  118|-> 	return 0;
#  119|   
#  120|   nothing:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def58]
util-linux-2.40.4/libblkid/src/topology/dm.c:118:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'dmpipe[1]'
util-linux-2.40.4/libblkid/src/topology/dm.c:44:12: branch_false: following 'false' branch...
util-linux-2.40.4/libblkid/src/topology/dm.c:46:14: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/dm.c:46:12: branch_false: following 'false' branch...
 branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/dm.c:49:21: branch_true: following 'true' branch (when 'i != 3')...
util-linux-2.40.4/libblkid/src/topology/dm.c:51:26: branch_true: ...to here
util-linux-2.40.4/libblkid/src/topology/dm.c:57:12: branch_false: following 'false' branch (when 'cmd' is non-NULL)...
util-linux-2.40.4/libblkid/src/topology/dm.c:59:13: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/dm.c:59:12: branch_false: following 'false' branch...
util-linux-2.40.4/libblkid/src/topology/dm.c:64:17: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/dm.c:123:17: branch_false: following 'false' branch...
 branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/dm.c:118:16: danger: 'dmpipe[1]' leaks here
#  116|   
#  117|   	fclose(stream);
#  118|-> 	return 0;
#  119|   
#  120|   nothing:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def59]
util-linux-2.40.4/libblkid/src/topology/lvm.c:125:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'lvpipe[0]'
util-linux-2.40.4/libblkid/src/topology/lvm.c:49:12: branch_false: following 'false' branch...
util-linux-2.40.4/libblkid/src/topology/lvm.c:51:14: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:51:12: branch_false: following 'false' branch...
 branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:54:21: branch_true: following 'true' branch (when 'i != 3')...
util-linux-2.40.4/libblkid/src/topology/lvm.c:56:26: branch_true: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:62:12: branch_false: following 'false' branch (when 'cmd' is non-NULL)...
util-linux-2.40.4/libblkid/src/topology/lvm.c:65:19: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:66:12: branch_false: following 'false' branch...
util-linux-2.40.4/libblkid/src/topology/lvm.c:69:13: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:69:12: branch_false: following 'false' branch...
util-linux-2.40.4/libblkid/src/topology/lvm.c:74:17: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:129:12: branch_false: following 'false' branch (when 'stream' is NULL)...
util-linux-2.40.4/libblkid/src/topology/lvm.c:131:18: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:131:17: branch_false: following 'false' branch...
util-linux-2.40.4/libblkid/src/topology/lvm.c:133:13: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:133:12: branch_false: following 'false' branch...
 branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:125:16: danger: 'lvpipe[0]' leaks here
#  123|   	fclose(stream);
#  124|   	close(lvpipe[1]);
#  125|-> 	return 0;
#  126|   
#  127|   nothing:

Error: GCC_ANALYZER_WARNING (CWE-775): [#def60]
util-linux-2.40.4/libblkid/src/topology/lvm.c:125:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'lvpipe[1]'
util-linux-2.40.4/libblkid/src/topology/lvm.c:49:12: branch_false: following 'false' branch...
util-linux-2.40.4/libblkid/src/topology/lvm.c:51:14: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:51:12: branch_false: following 'false' branch...
 branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:54:21: branch_true: following 'true' branch (when 'i != 3')...
util-linux-2.40.4/libblkid/src/topology/lvm.c:56:26: branch_true: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:62:12: branch_false: following 'false' branch (when 'cmd' is non-NULL)...
util-linux-2.40.4/libblkid/src/topology/lvm.c:65:19: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:66:12: branch_false: following 'false' branch...
util-linux-2.40.4/libblkid/src/topology/lvm.c:69:13: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:69:12: branch_false: following 'false' branch...
util-linux-2.40.4/libblkid/src/topology/lvm.c:74:17: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:129:12: branch_false: following 'false' branch (when 'stream' is NULL)...
util-linux-2.40.4/libblkid/src/topology/lvm.c:131:18: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:131:17: branch_false: following 'false' branch...
util-linux-2.40.4/libblkid/src/topology/lvm.c:133:13: branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:133:12: branch_false: following 'false' branch...
 branch_false: ...to here
util-linux-2.40.4/libblkid/src/topology/lvm.c:125:16: danger: 'lvpipe[1]' leaks here
#  123|   	fclose(stream);
#  124|   	close(lvpipe[1]);
#  125|-> 	return 0;
#  126|   
#  127|   nothing:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def61]
util-linux-2.40.4/libmount/src/hook_idmap.c:457:25: warning[-Wanalyzer-malloc-leak]: leak of 'idmap'
util-linux-2.40.4/libmount/src/hook_idmap.c:371:12: enter_function: entry to 'hook_prepare_options'
util-linux-2.40.4/libmount/src/hook_idmap.c:384:12: branch_false: following 'false' branch...
util-linux-2.40.4/libmount/src/hook_idmap.c:387:15: branch_false: ...to here
util-linux-2.40.4/libmount/src/hook_idmap.c:388:12: branch_false: following 'false' branch...
util-linux-2.40.4/libmount/src/hook_idmap.c:391:17: branch_false: ...to here
util-linux-2.40.4/libmount/src/hook_idmap.c:392:12: branch_true: following 'true' branch...
util-linux-2.40.4/libmount/src/hook_idmap.c:393:25: branch_true: ...to here
util-linux-2.40.4/libmount/src/hook_idmap.c:394:13: branch_false: following 'false' branch...
util-linux-2.40.4/libmount/src/hook_idmap.c:397:14: branch_false: ...to here
util-linux-2.40.4/libmount/src/hook_idmap.c:397:14: call_function: calling 'new_hook_data' from 'hook_prepare_options'
util-linux-2.40.4/libmount/src/hook_idmap.c:397:14: return_function: returning to 'hook_prepare_options' from 'new_hook_data'
util-linux-2.40.4/libmount/src/hook_idmap.c:398:12: branch_false: following 'false' branch...
util-linux-2.40.4/libmount/src/hook_idmap.c:402:12: branch_false: ...to here
util-linux-2.40.4/libmount/src/hook_idmap.c:402:12: branch_false: following 'false' branch...
util-linux-2.40.4/libmount/src/hook_idmap.c:409:15: branch_false: ...to here
util-linux-2.40.4/libmount/src/hook_idmap.c:410:12: branch_false: following 'false' branch (when 'buf' is non-NULL)...
util-linux-2.40.4/libmount/src/hook_idmap.c:423:20: branch_false: ...to here
util-linux-2.40.4/libmount/src/hook_idmap.c:423:50: branch_true: following 'true' branch (when 'tok' is non-NULL)...
util-linux-2.40.4/libmount/src/hook_idmap.c:427:26: branch_true: ...to here
util-linux-2.40.4/libmount/src/hook_idmap.c:429:21: call_function: calling 'startswith' from 'hook_prepare_options'
util-linux-2.40.4/libmount/src/hook_idmap.c:429:21: return_function: returning to 'hook_prepare_options' from 'startswith'
util-linux-2.40.4/libmount/src/hook_idmap.c:429:20: branch_true: following 'true' branch...
util-linux-2.40.4/libmount/src/hook_idmap.c:432:25: branch_true: ...to here
util-linux-2.40.4/libmount/src/hook_idmap.c:454:20: branch_false: following 'false' branch (when 'rc == 3')...
util-linux-2.40.4/libmount/src/hook_idmap.c:457:25: branch_false: ...to here
util-linux-2.40.4/libmount/src/hook_idmap.c:457:25: acquire_memory: allocated here
util-linux-2.40.4/libmount/src/hook_idmap.c:458:20: branch_false: following 'false' branch (when 'idmap' is non-NULL)...
util-linux-2.40.4/libmount/src/hook_idmap.c:461:17: branch_false: ...to here
util-linux-2.40.4/libmount/src/hook_idmap.c:423:50: branch_true: following 'true' branch (when 'tok' is non-NULL)...
util-linux-2.40.4/libmount/src/hook_idmap.c:427:26: branch_true: ...to here
util-linux-2.40.4/libmount/src/hook_idmap.c:429:21: call_function: calling 'startswith' from 'hook_prepare_options'
util-linux-2.40.4/libmount/src/hook_idmap.c:429:21: return_function: returning to 'hook_prepare_options' from 'startswith'
util-linux-2.40.4/libmount/src/hook_idmap.c:429:20: branch_true: following 'true' branch...
util-linux-2.40.4/libmount/src/hook_idmap.c:432:25: branch_true: ...to here
util-linux-2.40.4/libmount/src/hook_idmap.c:454:20: branch_false: following 'false' branch (when 'rc == 3')...
util-linux-2.40.4/libmount/src/hook_idmap.c:457:25: branch_false: ...to here
util-linux-2.40.4/libmount/src/hook_idmap.c:457:25: danger: 'idmap' leaks here; was allocated at [(34)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/33)
#  455|   			goto err;
#  456|   
#  457|-> 		idmap = calloc(1, sizeof(*idmap));
#  458|   		if (!idmap)
#  459|   			goto err;

Error: GCC_ANALYZER_WARNING (CWE-416): [#def62]
util-linux-2.40.4/libmount/src/utils.c:506:31: warning[-Wanalyzer-use-after-free]: use after 'reallocarray' of 'p'
util-linux-2.40.4/libmount/src/utils.c:511:12: enter_function: entry to 'add_filesystem'
util-linux-2.40.4/libmount/src/utils.c:515:9: branch_true: following 'true' branch (when 'filesystems' is non-NULL)...
util-linux-2.40.4/libmount/src/utils.c:516:9: branch_true: ...to here
util-linux-2.40.4/libmount/src/utils.c:516:9: branch_true: following 'true' branch (when 'name' is non-NULL)...
util-linux-2.40.4/libmount/src/utils.c:518:13: branch_true: ...to here
util-linux-2.40.4/libmount/src/utils.c:530:28: release_memory: deallocated here
util-linux-2.40.4/libmount/src/utils.c:532:20: branch_true: following 'true' branch (when 'x' is NULL)...
util-linux-2.40.4/libmount/src/utils.c:533:25: branch_true: ...to here
util-linux-2.40.4/libmount/src/utils.c:543:9: call_function: calling 'mnt_free_filesystems' from 'add_filesystem'
#  504|   	if (!filesystems)
#  505|   		return;
#  506|-> 	for (p = filesystems; *p; p++)
#  507|   		free(*p);
#  508|   	free(filesystems);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def63]
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1283:11: warning[-Wanalyzer-malloc-leak]: leak of 'yyptr'
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1245:6: branch_false: following 'false' branch...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1309:6: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1309:6: branch_false: following 'false' branch (when 'yystate != 14')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1312:3: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1324:6: branch_false: following 'false' branch (when 'yyn != -8')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1330:6: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1330:6: branch_true: following 'true' branch (when 'yychar == -2')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1333:16: branch_true: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1342:11: branch_false: following 'false' branch (when 'yychar != 256')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1354:17: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1361:6: branch_false: following 'false' branch...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1364:6: branch_false: following 'false' branch (when 'yyn > 0')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1374:6: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1374:6: branch_false: following 'false' branch (when 'yyerrstatus == 0')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1381:3: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1245:6: branch_false: following 'false' branch...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1309:6: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1309:6: branch_false: following 'false' branch (when 'yystate != 14')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1312:3: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1324:6: branch_false: following 'false' branch (when 'yyn != -8')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1330:6: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1330:6: branch_true: following 'true' branch (when 'yychar == -2')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1333:16: branch_true: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1336:6: branch_false: following 'false' branch (when 'yychar > 0')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1342:11: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1342:11: branch_true: following 'true' branch (when 'yychar == 256')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1350:7: branch_true: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1688:10: branch_true: following 'true' branch (when 'yyn != -8')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1690:11: branch_true: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1691:14: branch_true: following 'true' branch...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1694:18: branch_true: following 'true' branch (when 'yyn > 0')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1712:3: branch_true: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1245:6: branch_true: following 'true' branch...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1251:28: branch_true: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1274:10: branch_false: following 'false' branch (when 'yystacksize <= 9999')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1276:7: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1283:11: acquire_memory: allocated here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1285:12: branch_false: following 'false' branch (when 'yyptr' is non-NULL)...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1287:9: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1290:12: branch_false: following 'false' branch...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1295:7: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1303:10: branch_false: following 'false' branch...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1309:6: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1309:6: branch_false: following 'false' branch (when 'yystate != 14')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1312:3: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1324:6: branch_false: following 'false' branch (when 'yyn != -8')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1330:6: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1361:6: branch_false: following 'false' branch...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1364:6: branch_false: following 'false' branch (when 'yyn > 0')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1374:6: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1245:6: branch_true: following 'true' branch...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1251:28: branch_true: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1274:10: branch_false: following 'false' branch (when 'yystacksize <= 9999')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1276:7: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1283:11: danger: 'yyptr' leaks here; was allocated at [(39)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/38)
# 1281|           yy_state_t *yyss1 = yyss;
# 1282|           union yyalloc *yyptr =
# 1283|->           YY_CAST (union yyalloc *,
# 1284|                      YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
# 1285|           if (! yyptr)

Error: GCC_ANALYZER_WARNING (CWE-457): [#def64]
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1287:9: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'yyss'
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1245:6: branch_true: following 'true' branch...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1251:28: branch_true: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1274:10: branch_false: following 'false' branch (when 'yystacksize <= 9999')...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1276:7: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1285:12: branch_false: following 'false' branch (when 'yyptr' is non-NULL)...
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1287:9: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-parser.c:1287:9: danger: use of uninitialized value 'yyss' here
# 1285|           if (! yyptr)
# 1286|             YYNOMEM;
# 1287|->         YYSTACK_RELOCATE (yyss_alloc, yyss);
# 1288|           YYSTACK_RELOCATE (yyvs_alloc, yyvs);
# 1289|   #  undef YYSTACK_RELOCATE

Error: GCC_ANALYZER_WARNING (CWE-401): [#def65]
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1453:12: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(64)'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1439:21: enter_function: entry to 'yy_create_buffer'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1443:24: call_function: inlined call to 'yyalloc' from 'yy_create_buffer'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1444:12: branch_false: following 'false' branch...
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1447:2: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1453:12: danger: 'malloc(64)' leaks here; was allocated at [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2)
# 1451|   	 * we need to put in 2 end-of-buffer characters.
# 1452|   	 */
# 1453|-> 	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 1454|   	if ( ! b->yy_ch_buf )
# 1455|   		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

Error: GCC_ANALYZER_WARNING (CWE-401): [#def66]
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1453:12: warning[-Wanalyzer-malloc-leak]: leak of 'yyalloc(64, yyscanner)'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1439:21: enter_function: entry to 'yy_create_buffer'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1443:24: call_function: calling 'yyalloc' from 'yy_create_buffer'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1443:24: return_function: returning to 'yy_create_buffer' from 'yyalloc'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1444:12: branch_false: following 'false' branch...
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1447:2: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1453:12: danger: 'yyalloc(64, yyscanner)' leaks here; was allocated at [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
# 1451|   	 * we need to put in 2 end-of-buffer characters.
# 1452|   	 */
# 1453|-> 	b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 1454|   	if ( ! b->yy_ch_buf )
# 1455|   		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );

Error: GCC_ANALYZER_WARNING (CWE-476): [#def67]
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1495:2: warning[-Wanalyzer-null-dereference]: dereference of NULL 'b'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1374:10: enter_function: entry to 'yyrestart'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1379:16: call_function: calling 'yyensure_buffer_stack' from 'yyrestart'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1379:16: return_function: returning to 'yyrestart' from 'yyensure_buffer_stack'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1381:27: call_function: calling 'yy_create_buffer' from 'yyrestart'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1381:27: return_function: returning to 'yyrestart' from 'yy_create_buffer'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1384:2: branch_false: following 'false' branch...
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1384:2: branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1384:2: call_function: calling 'yy_init_buffer' from 'yyrestart'
# 1493|   
# 1494|   	yy_flush_buffer( b , yyscanner);
# 1495|-> 
# 1496|   	b->yy_input_file = file;
# 1497|   	b->yy_fill_buffer = 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def68]
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1713:25: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(n)'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1697:17: enter_function: entry to 'yy_scan_bytes'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1706:24: call_function: inlined call to 'yyalloc' from 'yy_scan_bytes'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1707:12: branch_false: following 'false' branch...
 branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1715:6: call_function: calling 'yy_scan_buffer' from 'yy_scan_bytes'
# 1711|   	for ( i = 0; i < _yybytes_len; ++i )
# 1712|   		buf[i] = yybytes[i];
# 1713|-> 
# 1714|   	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 1715|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def69]
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1713:25: warning[-Wanalyzer-malloc-leak]: leak of 'yyalloc(n,  yyscanner)'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1697:17: enter_function: entry to 'yy_scan_bytes'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1706:24: call_function: calling 'yyalloc' from 'yy_scan_bytes'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1706:24: return_function: returning to 'yy_scan_bytes' from 'yyalloc'
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1707:12: branch_false: following 'false' branch...
 branch_false: ...to here
util-linux-2.40.4/libsmartcols/src/filter-scanner.c:1715:6: call_function: calling 'yy_scan_buffer' from 'yy_scan_bytes'
# 1711|   	for ( i = 0; i < _yybytes_len; ++i )
# 1712|   		buf[i] = yybytes[i];
# 1713|-> 
# 1714|   	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 1715|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def70]
util-linux-2.40.4/libsmartcols/src/print.c:491:71: warning[-Wanalyzer-null-dereference]: dereference of NULL 'data'
util-linux-2.40.4/libsmartcols/src/print.c:1057:12: enter_function: entry to 'print_tree_line'
util-linux-2.40.4/libsmartcols/src/print.c:1070:14: call_function: calling 'print_line' from 'print_tree_line'
#  489|   	case SCOLS_JSON_BOOLEAN_OPTIONAL:
#  490|   		/* name: true|false|null */
#  491|-> 		if (cl->json_type == SCOLS_JSON_BOOLEAN_OPTIONAL && (!*data || !strcmp(data, "-"))) {
#  492|   			ul_jsonwrt_value_null(&tb->json, name);
#  493|   		} else {

Error: GCC_ANALYZER_WARNING (CWE-476): [#def71]
util-linux-2.40.4/libsmartcols/src/print.c:495:42: warning[-Wanalyzer-null-dereference]: dereference of NULL 'data'
util-linux-2.40.4/libsmartcols/src/print.c:1057:12: enter_function: entry to 'print_tree_line'
util-linux-2.40.4/libsmartcols/src/print.c:1070:14: call_function: calling 'print_line' from 'print_tree_line'
#  493|   		} else {
#  494|   			ul_jsonwrt_value_boolean(&tb->json, name,
#  495|-> 					!*data ? 0 :
#  496|   					*data == '0' ? 0 :
#  497|   					*data == 'N' || *data == 'n' ? 0 : 1);

Error: COMPILER_WARNING: [#def72]
util-linux-2.40.4/libuuid/src/unparse.c:40:41: warning[-Wunterminated-string-initialization]: initializer-string for array of 'char' truncates NUL terminator but destination lacks 'nonstring' attribute (17 chars into 16 available)
#   40 | static char const hexdigits_lower[16] = "0123456789abcdef";
#      |                                         ^~~~~~~~~~~~~~~~~~
#   38|   #include "uuidP.h"
#   39|   
#   40|-> static char const hexdigits_lower[16] = "0123456789abcdef";
#   41|   static char const hexdigits_upper[16] = "0123456789ABCDEF";
#   42|   

Error: COMPILER_WARNING: [#def73]
util-linux-2.40.4/libuuid/src/unparse.c:41:41: warning[-Wunterminated-string-initialization]: initializer-string for array of 'char' truncates NUL terminator but destination lacks 'nonstring' attribute (17 chars into 16 available)
#   41 | static char const hexdigits_upper[16] = "0123456789ABCDEF";
#      |                                         ^~~~~~~~~~~~~~~~~~
#   39|   
#   40|   static char const hexdigits_lower[16] = "0123456789abcdef";
#   41|-> static char const hexdigits_upper[16] = "0123456789ABCDEF";
#   42|   
#   43|   static void uuid_fmt(const uuid_t uuid, char *buf, char const *restrict fmt)

Error: GCC_ANALYZER_WARNING (CWE-401): [#def74]
util-linux-2.40.4/login-utils/chfn.c:216:1: warning[-Wanalyzer-malloc-leak]: leak of ‘gecos’
util-linux-2.40.4/login-utils/chfn.c:396:5: enter_function: entry to ‘main’
util-linux-2.40.4/login-utils/chfn.c:414:9: call_function: calling ‘parse_argv’ from ‘main’
util-linux-2.40.4/login-utils/chfn.c:414:9: return_function: returning to ‘main’ from ‘parse_argv’
util-linux-2.40.4/login-utils/chfn.c:415:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/login-utils/chfn.c:416:26: branch_true: ...to here
util-linux-2.40.4/login-utils/chfn.c:417:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/chfn.c:420:32: branch_false: ...to here
util-linux-2.40.4/login-utils/chfn.c:427:9: call_function: calling ‘parse_passwd’ from ‘main’
#  214|   	 *  not be changed by this version of chfn.  */
#  215|   	ctl->oldf.other = strsep(&gecos, ",");
#  216|-> }
#  217|   
#  218|   /*

Error: GCC_ANALYZER_WARNING (CWE-775): [#def75]
util-linux-2.40.4/login-utils/last.c:194:13: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "r")’
util-linux-2.40.4/login-utils/last.c:955:5: enter_function: entry to ‘main’
util-linux-2.40.4/login-utils/last.c:1005:16: branch_false: following ‘false’ branch (when ‘c == -1’)...
util-linux-2.40.4/login-utils/last.c:1078:13: branch_false: ...to here
util-linux-2.40.4/login-utils/last.c:1081:12: branch_true: following ‘true’ branch (when ‘files’ is NULL)...
util-linux-2.40.4/login-utils/last.c:1082:25: branch_true: ...to here
util-linux-2.40.4/login-utils/last.c:1082:25: call_function: calling ‘xmalloc’ from ‘main’
util-linux-2.40.4/login-utils/last.c:1082:25: return_function: returning to ‘main’ from ‘xmalloc’
util-linux-2.40.4/login-utils/last.c:1083:35: call_function: calling ‘xstrdup’ from ‘main’
util-linux-2.40.4/login-utils/last.c:1083:35: return_function: returning to ‘main’ from ‘xstrdup’
util-linux-2.40.4/login-utils/last.c:1086:21: branch_true: following ‘true’ branch (when ‘i < nfiles’)...
util-linux-2.40.4/login-utils/last.c:1087:17: branch_true: ...to here
util-linux-2.40.4/login-utils/last.c:1088:17: call_function: calling ‘process_wtmp_file’ from ‘main’
#  192|   	off_t o;
#  193|   
#  194|-> 	if (quit == NULL && u != NULL) {
#  195|   		/*
#  196|   		 *	Normal read.

Error: GCC_ANALYZER_WARNING (CWE-401): [#def76]
util-linux-2.40.4/login-utils/last.c:194:13: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "r")’
util-linux-2.40.4/login-utils/last.c:955:5: enter_function: entry to ‘main’
util-linux-2.40.4/login-utils/last.c:1005:16: branch_false: following ‘false’ branch (when ‘c == -1’)...
util-linux-2.40.4/login-utils/last.c:1078:13: branch_false: ...to here
util-linux-2.40.4/login-utils/last.c:1081:12: branch_true: following ‘true’ branch (when ‘files’ is NULL)...
util-linux-2.40.4/login-utils/last.c:1082:25: branch_true: ...to here
util-linux-2.40.4/login-utils/last.c:1082:25: call_function: calling ‘xmalloc’ from ‘main’
util-linux-2.40.4/login-utils/last.c:1082:25: return_function: returning to ‘main’ from ‘xmalloc’
util-linux-2.40.4/login-utils/last.c:1083:35: call_function: calling ‘xstrdup’ from ‘main’
util-linux-2.40.4/login-utils/last.c:1083:35: return_function: returning to ‘main’ from ‘xstrdup’
util-linux-2.40.4/login-utils/last.c:1086:21: branch_true: following ‘true’ branch (when ‘i < nfiles’)...
util-linux-2.40.4/login-utils/last.c:1087:17: branch_true: ...to here
util-linux-2.40.4/login-utils/last.c:1088:17: call_function: calling ‘process_wtmp_file’ from ‘main’
#  192|   	off_t o;
#  193|   
#  194|-> 	if (quit == NULL && u != NULL) {
#  195|   		/*
#  196|   		 *	Normal read.

Error: GCC_ANALYZER_WARNING (CWE-476): [#def77]
util-linux-2.40.4/login-utils/last.c:1028:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘files’
util-linux-2.40.4/login-utils/last.c:955:5: enter_function: entry to ‘main’
util-linux-2.40.4/login-utils/last.c:1005:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
util-linux-2.40.4/login-utils/last.c:1008:17: branch_true: ...to here
util-linux-2.40.4/login-utils/last.c:1008:17: call_function: calling ‘err_exclusive_options’ from ‘main’
util-linux-2.40.4/login-utils/last.c:1008:17: return_function: returning to ‘main’ from ‘err_exclusive_options’
util-linux-2.40.4/login-utils/last.c:1026:28: branch_true: following ‘true’ branch (when ‘files’ is NULL)...
util-linux-2.40.4/login-utils/last.c:1027:41: branch_true: ...to here
util-linux-2.40.4/login-utils/last.c:1027:41: call_function: calling ‘xmalloc’ from ‘main’
util-linux-2.40.4/login-utils/last.c:1027:41: return_function: returning to ‘main’ from ‘xmalloc’
util-linux-2.40.4/login-utils/last.c:1028:43: call_function: calling ‘xstrdup’ from ‘main’
util-linux-2.40.4/login-utils/last.c:1028:43: return_function: returning to ‘main’ from ‘xstrdup’
util-linux-2.40.4/login-utils/last.c:1028:25: danger: ‘files + nfiles * 8’ could be NULL: unchecked value from [(17)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/16)
# 1026|   			if (!files)
# 1027|   				files = xmalloc(sizeof(char *) * argc);
# 1028|-> 			files[nfiles++] = xstrdup(optarg);
# 1029|   			break;
# 1030|   		case 'd':

Error: GCC_ANALYZER_WARNING (CWE-476): [#def78]
util-linux-2.40.4/login-utils/login.c:239:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘environ’
util-linux-2.40.4/login-utils/login.c:1316:13: enter_function: entry to ‘initialize’
util-linux-2.40.4/login-utils/login.c:1337:9: call_function: calling ‘xasprintf’ from ‘initialize’
util-linux-2.40.4/login-utils/login.c:1337:9: return_function: returning to ‘initialize’ from ‘xasprintf’
util-linux-2.40.4/login-utils/login.c:1349:9: call_function: calling ‘process_title_init’ from ‘initialize’
#  237|   
#  238|   	for (i = 0; envp[i] != NULL; i++)
#  239|-> 		environ[i] = xstrdup(envp[i]);
#  240|   	environ[i] = NULL;
#  241|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def79]
util-linux-2.40.4/login-utils/login.c:240:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘environ’
util-linux-2.40.4/login-utils/login.c:1316:13: enter_function: entry to ‘initialize’
util-linux-2.40.4/login-utils/login.c:1337:9: call_function: calling ‘xasprintf’ from ‘initialize’
util-linux-2.40.4/login-utils/login.c:1337:9: return_function: returning to ‘initialize’ from ‘xasprintf’
util-linux-2.40.4/login-utils/login.c:1349:9: call_function: calling ‘process_title_init’ from ‘initialize’
#  238|   	for (i = 0; envp[i] != NULL; i++)
#  239|   		environ[i] = xstrdup(envp[i]);
#  240|-> 	environ[i] = NULL;
#  241|   
#  242|   	if (i > 0)

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def80]
util-linux-2.40.4/login-utils/login.c:455:17: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘i’
util-linux-2.40.4/login-utils/login.c:510:13: enter_function: entry to ‘init_tty’
util-linux-2.40.4/login-utils/login.c:530:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/login.c:530:13: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/login.c:532:14: branch_false: ...to here
util-linux-2.40.4/login-utils/login.c:530:13: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/login.c:530:13: branch_false: ...to here
util-linux-2.40.4/login-utils/login.c:530:13: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/login.c:549:13: branch_false: ...to here
util-linux-2.40.4/login-utils/login.c:555:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/login.c:559:17: branch_false: ...to here
util-linux-2.40.4/login-utils/login.c:562:13: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/login.c:570:14: branch_false: ...to here
util-linux-2.40.4/login-utils/login.c:570:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/login.c:577:9: branch_false: ...to here
util-linux-2.40.4/login-utils/login.c:577:9: release_resource: first ‘close’ here
util-linux-2.40.4/login-utils/login.c:586:9: call_function: calling ‘open_tty’ from ‘init_tty’
#  453|   
#  454|   	for (i = 0; i < fd; i++)
#  455|-> 		close(i);
#  456|   	for (i = 0; i < 3; i++)
#  457|   		if (fd != i)

Error: GCC_ANALYZER_WARNING: [#def81]
util-linux-2.40.4/login-utils/login.c:458:25: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘i’
util-linux-2.40.4/login-utils/login.c:439:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/login.c:444:14: branch_false: ...to here
util-linux-2.40.4/login-utils/login.c:444:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/login.c:450:17: branch_false: ...to here
util-linux-2.40.4/login-utils/login.c:454:21: branch_true: following ‘true’ branch...
util-linux-2.40.4/login-utils/login.c:455:17: branch_true: ...to here
util-linux-2.40.4/login-utils/login.c:455:17: release_resource: closed here
util-linux-2.40.4/login-utils/login.c:454:21: branch_false: following ‘false’ branch...
 branch_false: ...to here
util-linux-2.40.4/login-utils/login.c:456:21: branch_true: following ‘true’ branch (when ‘i != 3’)...
util-linux-2.40.4/login-utils/login.c:457:20: branch_true: ...to here
util-linux-2.40.4/login-utils/login.c:457:20: branch_true: following ‘true’ branch...
util-linux-2.40.4/login-utils/login.c:458:25: branch_true: ...to here
util-linux-2.40.4/login-utils/login.c:458:25: danger: ‘i’ could be invalid
#  456|   	for (i = 0; i < 3; i++)
#  457|   		if (fd != i)
#  458|-> 			dup2(fd, i);
#  459|   	if (fd >= 3)
#  460|   		close(fd);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def82]
util-linux-2.40.4/login-utils/lslogins.c:509:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ary’
util-linux-2.40.4/login-utils/lslogins.c:502:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/lslogins.c:507:20: branch_false: ...to here
util-linux-2.40.4/login-utils/lslogins.c:507:20: branch_false: following ‘false’ branch (when ‘i != imax’)...
util-linux-2.40.4/login-utils/lslogins.c:509:20: branch_false: ...to here
util-linux-2.40.4/login-utils/lslogins.c:509:20: release_memory: ‘ary’ is NULL
util-linux-2.40.4/login-utils/lslogins.c:509:17: danger: dereference of NULL ‘ary + i * 384’
#  507|   		if (i == imax)
#  508|   			ary = xreallocarray(ary, imax *= 2, sizeof(struct utmpx));
#  509|-> 		ary[i] = *u;
#  510|   	}
#  511|   

Error: GCC_ANALYZER_WARNING: [#def83]
util-linux-2.40.4/login-utils/sulogin.c:723:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘0’
util-linux-2.40.4/login-utils/sulogin.c:693:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/sulogin.c:695:13: branch_false: ...to here
util-linux-2.40.4/login-utils/sulogin.c:695:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/sulogin.c:698:19: branch_false: ...to here
util-linux-2.40.4/login-utils/sulogin.c:704:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/login-utils/sulogin.c:705:28: branch_true: ...to here
util-linux-2.40.4/login-utils/sulogin.c:715:20: branch_true: following ‘true’ branch (when ‘fd > 0’)...
util-linux-2.40.4/login-utils/sulogin.c:715:41: branch_true: ...to here
util-linux-2.40.4/login-utils/sulogin.c:715:41: release_resource: closed here
util-linux-2.40.4/login-utils/sulogin.c:716:20: branch_false: following ‘false’ branch (when ‘fd == 1’)...
util-linux-2.40.4/login-utils/sulogin.c:719:17: branch_false: ...to here
util-linux-2.40.4/login-utils/sulogin.c:723:9: danger: ‘0’ could be invalid
#  721|   	}
#  722|   notty:
#  723|-> 	dup2(fd, STDIN_FILENO);
#  724|   	dup2(fd, STDOUT_FILENO);
#  725|   	dup2(fd, STDERR_FILENO);

Error: GCC_ANALYZER_WARNING: [#def84]
util-linux-2.40.4/login-utils/sulogin.c:724:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
util-linux-2.40.4/login-utils/sulogin.c:693:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/sulogin.c:695:13: branch_false: ...to here
util-linux-2.40.4/login-utils/sulogin.c:695:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/sulogin.c:698:19: branch_false: ...to here
util-linux-2.40.4/login-utils/sulogin.c:704:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/login-utils/sulogin.c:705:28: branch_true: ...to here
util-linux-2.40.4/login-utils/sulogin.c:715:20: branch_true: following ‘true’ branch (when ‘fd > 0’)...
util-linux-2.40.4/login-utils/sulogin.c:715:41: branch_true: ...to here
util-linux-2.40.4/login-utils/sulogin.c:716:20: branch_true: following ‘true’ branch (when ‘fd != 1’)...
util-linux-2.40.4/login-utils/sulogin.c:716:41: branch_true: ...to here
util-linux-2.40.4/login-utils/sulogin.c:716:41: release_resource: closed here
util-linux-2.40.4/login-utils/sulogin.c:717:20: branch_false: following ‘false’ branch (when ‘fd <= 2’)...
util-linux-2.40.4/login-utils/sulogin.c:719:17: branch_false: ...to here
util-linux-2.40.4/login-utils/sulogin.c:724:9: danger: ‘1’ could be invalid
#  722|   notty:
#  723|   	dup2(fd, STDIN_FILENO);
#  724|-> 	dup2(fd, STDOUT_FILENO);
#  725|   	dup2(fd, STDERR_FILENO);
#  726|   	con->fd = STDIN_FILENO;

Error: GCC_ANALYZER_WARNING: [#def85]
util-linux-2.40.4/login-utils/sulogin.c:725:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘2’
util-linux-2.40.4/login-utils/sulogin.c:693:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/sulogin.c:695:13: branch_false: ...to here
util-linux-2.40.4/login-utils/sulogin.c:695:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/login-utils/sulogin.c:698:19: branch_false: ...to here
util-linux-2.40.4/login-utils/sulogin.c:704:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/login-utils/sulogin.c:705:28: branch_true: ...to here
util-linux-2.40.4/login-utils/sulogin.c:715:20: branch_true: following ‘true’ branch (when ‘fd > 0’)...
util-linux-2.40.4/login-utils/sulogin.c:715:41: branch_true: ...to here
util-linux-2.40.4/login-utils/sulogin.c:716:20: branch_true: following ‘true’ branch (when ‘fd != 1’)...
util-linux-2.40.4/login-utils/sulogin.c:716:41: branch_true: ...to here
util-linux-2.40.4/login-utils/sulogin.c:717:20: branch_true: following ‘true’ branch (when ‘fd > 2’)...
util-linux-2.40.4/login-utils/sulogin.c:717:41: branch_true: ...to here
util-linux-2.40.4/login-utils/sulogin.c:717:41: release_resource: closed here
util-linux-2.40.4/login-utils/sulogin.c:725:9: danger: ‘2’ could be invalid
#  723|   	dup2(fd, STDIN_FILENO);
#  724|   	dup2(fd, STDOUT_FILENO);
#  725|-> 	dup2(fd, STDERR_FILENO);
#  726|   	con->fd = STDIN_FILENO;
#  727|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def86]
util-linux-2.40.4/misc-utils/blkid.c:859:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc((long unsigned int)(argc - optind), 8)’
util-linux-2.40.4/misc-utils/blkid.c:665:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/blkid.c:832:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/blkid.c:836:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/blkid.c:837:35: branch_true: ...to here
util-linux-2.40.4/misc-utils/blkid.c:837:27: call_function: calling ‘xcalloc’ from ‘main’
util-linux-2.40.4/misc-utils/blkid.c:837:27: return_function: returning to ‘main’ from ‘xcalloc’
util-linux-2.40.4/misc-utils/blkid.c:838:24: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/blkid.c:839:42: branch_true: ...to here
util-linux-2.40.4/misc-utils/blkid.c:842:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/blkid.c:844:34: branch_false: ...to here
util-linux-2.40.4/misc-utils/blkid.c:859:25: danger: dereference of NULL ‘xcalloc((long unsigned int)(argc - optind), 8) + (long unsigned int)numdev * 8’
#  857|   				continue;
#  858|   
#  859|-> 			devices[numdev++] = dev;
#  860|   		}
#  861|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def87]
util-linux-2.40.4/misc-utils/cal.c:1016:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc((long unsigned int)*ctl.months_in_row, 208)’
util-linux-2.40.4/misc-utils/cal.c:1047:13: enter_function: entry to ‘yearly’
util-linux-2.40.4/misc-utils/cal.c:1061:9: call_function: calling ‘monthly’ from ‘yearly’
# 1014|   
# 1015|   	for (i = 0; i < ctl->months_in_row - 1; i++)
# 1016|-> 		ms[i].next = &ms[i + 1];
# 1017|   
# 1018|   	rows = (ctl->num_months - 1) / ctl->months_in_row;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def88]
util-linux-2.40.4/misc-utils/getopt.c:133:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xmalloc(strlen(arg) * 4 + 3)’
util-linux-2.40.4/misc-utils/getopt.c:113:13: enter_function: entry to ‘print_normalized’
util-linux-2.40.4/misc-utils/getopt.c:130:15: call_function: calling ‘xmalloc’ from ‘print_normalized’
util-linux-2.40.4/misc-utils/getopt.c:130:15: return_function: returning to ‘print_normalized’ from ‘xmalloc’
util-linux-2.40.4/misc-utils/getopt.c:133:14: danger: ‘xmalloc(strlen(arg) * 4 + 3)’ could be NULL: unchecked value from [(4)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/3)
#  131|   	bufptr = buf;
#  132|   
#  133|-> 	for (*bufptr++ = '\''; *argptr; argptr++) {
#  134|   		if (ctl->shell == TCSH) {
#  135|   			switch (*argptr) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def89]
util-linux-2.40.4/misc-utils/getopt.c:418:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ctl.optstr’ where non-null expected
util-linux-2.40.4/misc-utils/getopt.c:367:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/getopt.c:400:12: branch_false: following ‘false’ branch (when ‘argc != 1’)...
util-linux-2.40.4/misc-utils/getopt.c:412:9: branch_false: ...to here
util-linux-2.40.4/misc-utils/getopt.c:412:9: call_function: calling ‘add_longopt’ from ‘main’
util-linux-2.40.4/misc-utils/getopt.c:412:9: return_function: returning to ‘main’ from ‘add_longopt’
util-linux-2.40.4/misc-utils/getopt.c:417:30: call_function: calling ‘xmalloc’ from ‘main’
util-linux-2.40.4/misc-utils/getopt.c:417:30: return_function: returning to ‘main’ from ‘xmalloc’
util-linux-2.40.4/misc-utils/getopt.c:418:17: danger: argument 1 (‘xmalloc(strlen(argv[1]) + 1)’) from [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10) could be NULL where non-null expected
#argument 1 of ‘__builtin_strcpy’ must be non-null
#  416|   		ctl.quote = 0;
#  417|   		ctl.optstr = xmalloc(strlen(argv[1]) + 1);
#  418|-> 		strcpy(ctl.optstr, argv[1] + strspn(argv[1], "-+"));
#  419|   		argv[1] = argv[0];
#  420|   		return generate_output(&ctl, argv + 1, argc - 1);

Error: CPPCHECK_WARNING (CWE-401): [#def90]
util-linux-2.40.4/misc-utils/getopt.c:449: error[memleak]: Memory leak: ctl.name
#  447|   			break;
#  448|   		case 'T':
#  449|-> 			return TEST_EXIT_CODE;
#  450|   		case 'u':
#  451|   			ctl.quote = 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def91]
util-linux-2.40.4/misc-utils/hardlink.c:515:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xmalloc((long unsigned int)n * 8)’
util-linux-2.40.4/misc-utils/hardlink.c:1048:13: enter_function: entry to ‘visitor’
util-linux-2.40.4/misc-utils/hardlink.c:1056:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1059:16: branch_true: following ‘true’ branch (when ‘master’ is non-NULL)...
util-linux-2.40.4/misc-utils/hardlink.c:1063:21: branch_true: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1063:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/hardlink.c:1065:21: branch_false: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1065:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1069:26: call_function: inlined call to ‘count_nodes’ from ‘visitor’
util-linux-2.40.4/misc-utils/hardlink.c:1070:20: branch_false: following ‘false’ branch (when ‘ct != 0’)...
util-linux-2.40.4/misc-utils/hardlink.c:1074:26: branch_false: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1086:44: branch_true: following ‘true’ branch (when ‘other’ is non-NULL)...
util-linux-2.40.4/misc-utils/hardlink.c:1089:29: branch_true: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1089:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/hardlink.c:1092:25: branch_false: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1092:25: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/hardlink.c:1093:25: branch_true: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1093:25: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/hardlink.c:1095:30: branch_true: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1095:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/hardlink.c:1099:30: branch_false: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1099:30: call_function: calling ‘file_may_link_to’ from ‘visitor’
#  513|   
#  514|   	for (i = 0; i < n; i++) {
#  515|-> 		table[i] = names;
#  516|   		names += strlen(names) + 1;
#  517|   	}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def92]
util-linux-2.40.4/misc-utils/hardlink.c:519:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc((long unsigned int)n * 8)’ where non-null expected
util-linux-2.40.4/misc-utils/hardlink.c:1048:13: enter_function: entry to ‘visitor’
util-linux-2.40.4/misc-utils/hardlink.c:1056:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1059:16: branch_true: following ‘true’ branch (when ‘master’ is non-NULL)...
util-linux-2.40.4/misc-utils/hardlink.c:1063:21: branch_true: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1063:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/hardlink.c:1065:21: branch_false: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1065:20: branch_false: following ‘false’ branch...
 branch_false: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1069:26: call_function: inlined call to ‘count_nodes’ from ‘visitor’
util-linux-2.40.4/misc-utils/hardlink.c:1070:20: branch_false: following ‘false’ branch (when ‘ct != 0’)...
util-linux-2.40.4/misc-utils/hardlink.c:1074:26: branch_false: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1086:44: branch_true: following ‘true’ branch (when ‘other’ is non-NULL)...
util-linux-2.40.4/misc-utils/hardlink.c:1089:29: branch_true: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1089:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/hardlink.c:1092:25: branch_false: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1092:25: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/hardlink.c:1093:25: branch_true: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1093:25: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/hardlink.c:1095:30: branch_true: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1095:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/hardlink.c:1099:30: branch_false: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:1099:30: call_function: calling ‘file_may_link_to’ from ‘visitor’
#  517|   	}
#  518|   
#  519|-> 	qsort(table, n, sizeof(char *), cmp_xattr_name_ptrs);
#  520|   
#  521|   	return table;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def93]
util-linux-2.40.4/misc-utils/hardlink.c:875:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xcalloc(1, strlen(fpath) + 17)’
util-linux-2.40.4/misc-utils/hardlink.c:828:12: enter_function: entry to ‘inserter’
util-linux-2.40.4/misc-utils/hardlink.c:841:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/hardlink.c:853:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/hardlink.c:861:34: branch_false: ...to here
util-linux-2.40.4/misc-utils/hardlink.c:871:15: call_function: calling ‘xcalloc’ from ‘inserter’
util-linux-2.40.4/misc-utils/hardlink.c:871:15: return_function: returning to ‘inserter’ from ‘xcalloc’
util-linux-2.40.4/misc-utils/hardlink.c:872:22: call_function: calling ‘xcalloc’ from ‘inserter’
util-linux-2.40.4/misc-utils/hardlink.c:872:22: return_function: returning to ‘inserter’ from ‘xcalloc’
util-linux-2.40.4/misc-utils/hardlink.c:875:9: danger: ‘xcalloc(1, strlen(fpath) + 17)’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/7/codeFlows/0/threadFlows/0/locations/12)
#  873|   
#  874|   	fil->st = *sb;
#  875|-> 	fil->links->basename = ftwbuf->base;
#  876|   	fil->links->dirname = rootbasesz;
#  877|   	fil->links->next = NULL;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def94]
util-linux-2.40.4/misc-utils/look.c:337:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’
util-linux-2.40.4/misc-utils/look.c:170:1: enter_function: entry to ‘look’
util-linux-2.40.4/misc-utils/look.c:176:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/look.c:177:30: branch_true: ...to here
util-linux-2.40.4/misc-utils/look.c:186:21: call_function: calling ‘xmalloc’ from ‘look’
util-linux-2.40.4/misc-utils/look.c:186:21: return_function: returning to ‘look’ from ‘xmalloc’
util-linux-2.40.4/misc-utils/look.c:188:17: call_function: calling ‘binary_search’ from ‘look’
#  335|   		if (!dflag || isalnum(*s2) || isblank(*s2))
#  336|   		{
#  337|-> 			*p++ = *s2;
#  338|   			i--;
#  339|   		}

Error: GCC_ANALYZER_WARNING (CWE-476): [#def95]
util-linux-2.40.4/misc-utils/look.c:342:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’
util-linux-2.40.4/misc-utils/look.c:170:1: enter_function: entry to ‘look’
util-linux-2.40.4/misc-utils/look.c:176:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/look.c:177:30: branch_true: ...to here
util-linux-2.40.4/misc-utils/look.c:186:21: call_function: calling ‘xmalloc’ from ‘look’
util-linux-2.40.4/misc-utils/look.c:186:21: return_function: returning to ‘look’ from ‘xmalloc’
util-linux-2.40.4/misc-utils/look.c:188:17: call_function: calling ‘binary_search’ from ‘look’
#  340|   		s2++;
#  341|   	}
#  342|-> 	*p = 0;
#  343|   
#  344|   	/* and compare */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def96]
util-linux-2.40.4/misc-utils/lsblk-devtree.c:536:16: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘a’
util-linux-2.40.4/misc-utils/lsblk-devtree.c:541:5: enter_function: entry to ‘lsblk_devtree_deduplicate_devices’
util-linux-2.40.4/misc-utils/lsblk-devtree.c:547:9: call_function: calling ‘list_sort’ from ‘lsblk_devtree_deduplicate_devices’
#  534|   			    *bx = list_entry(b, struct lsblk_device, ls_devices);
#  535|   
#  536|-> 	return cmp_numbers(makedev(ax->maj, ax->min),
#  537|   			   makedev(bx->maj, bx->min));
#  538|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def97]
util-linux-2.40.4/misc-utils/lsblk-properties.c:199:9: warning[-Wanalyzer-malloc-leak]: leak of ‘*prop.label’
util-linux-2.40.4/misc-utils/lsblk-properties.c:347:23: enter_function: entry to ‘lsblk_device_get_properties’
util-linux-2.40.4/misc-utils/lsblk-properties.c:352:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/lsblk-properties.c:353:24: branch_true: ...to here
util-linux-2.40.4/misc-utils/lsblk-properties.c:353:24: call_function: calling ‘get_properties_by_file’ from ‘lsblk_device_get_properties’
#  197|   		*p = '\0';
#  198|   
#  199|-> 	*value = xstrdup(v);
#  200|   	return 1;
#  201|   }

Error: GCC_ANALYZER_WARNING (CWE-401): [#def98]
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:705:17: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 152)’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:194:13: enter_function: entry to ‘load_sock_xinfo_with_fd’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:197:17: call_function: calling ‘load_sock_xinfo_no_nsswitch’ from ‘load_sock_xinfo_with_fd’
#  703|   
#  704|   		DBG(ENDPOINTS, ul_debug("   path: %s", ux->path));
#  705|-> 		add_sock_info(&ux->sock);
#  706|   	}
#  707|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def99]
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1944:17: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 40)’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1906:13: enter_function: entry to ‘load_xinfo_from_proc_netlink’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1912:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1915:13: branch_false: ...to here
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1915:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1917:15: branch_false: ...to here
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1917:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1921:16: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1928:21: branch_true: ...to here
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1928:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1932:21: branch_false: ...to here
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1932:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1935:22: branch_false: ...to here
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1935:22: call_function: calling ‘xcalloc’ from ‘load_xinfo_from_proc_netlink’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1935:22: return_function: returning to ‘load_xinfo_from_proc_netlink’ from ‘xcalloc’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:1944:17: danger: ‘xcalloc(1, 40)’ leaks here; was allocated at [(16)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/15)
# 1942|   		nl->groups = groups;
# 1943|   
# 1944|-> 		add_sock_info(&nl->sock);
# 1945|   	}
# 1946|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def100]
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:2346:17: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 32)’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:2311:13: enter_function: entry to ‘load_xinfo_from_proc_packet’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:2317:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:2320:13: branch_false: ...to here
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:2320:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:2322:15: branch_false: ...to here
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:2322:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:2326:16: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:2333:21: branch_true: ...to here
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:2333:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:2337:23: branch_false: ...to here
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:2337:23: call_function: calling ‘xcalloc’ from ‘load_xinfo_from_proc_packet’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:2337:23: return_function: returning to ‘load_xinfo_from_proc_packet’ from ‘xcalloc’
util-linux-2.40.4/misc-utils/lsfd-sock-xinfo.c:2346:17: danger: ‘xcalloc(1, 32)’ leaks here; was allocated at [(14)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/13)
# 2344|   		pkt->iface = iface;
# 2345|   
# 2346|-> 		add_sock_info(&pkt->sock);
# 2347|   	}
# 2348|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def101]
util-linux-2.40.4/misc-utils/lsfd.c:703:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xcalloc(1, *class.size)’
util-linux-2.40.4/misc-utils/lsfd.c:1680:13: enter_function: entry to ‘read_process’
util-linux-2.40.4/misc-utils/lsfd.c:1689:16: call_function: calling ‘new_proc’ from ‘read_process’
util-linux-2.40.4/misc-utils/lsfd.c:1689:16: return_function: returning to ‘read_process’ from ‘new_proc’
util-linux-2.40.4/misc-utils/lsfd.c:1691:40: call_function: calling ‘xstrdup’ from ‘read_process’
util-linux-2.40.4/misc-utils/lsfd.c:1691:40: return_function: returning to ‘read_process’ from ‘xstrdup’
util-linux-2.40.4/misc-utils/lsfd.c:1694:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd.c:1712:13: branch_false: ...to here
util-linux-2.40.4/misc-utils/lsfd.c:1717:9: call_function: calling ‘collect_execve_file’ from ‘read_process’
#  701|   	assert(class);
#  702|   	file = xcalloc(1, class->size);
#  703|-> 	file->class = class;
#  704|   
#  705|   	file->proc = proc;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def102]
util-linux-2.40.4/misc-utils/lsfd.c:718:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xcalloc(1, *old_10(D)->class.size)’
util-linux-2.40.4/misc-utils/lsfd.c:1680:13: enter_function: entry to ‘read_process’
util-linux-2.40.4/misc-utils/lsfd.c:1689:16: call_function: calling ‘new_proc’ from ‘read_process’
util-linux-2.40.4/misc-utils/lsfd.c:1689:16: return_function: returning to ‘read_process’ from ‘new_proc’
util-linux-2.40.4/misc-utils/lsfd.c:1691:40: call_function: calling ‘xstrdup’ from ‘read_process’
util-linux-2.40.4/misc-utils/lsfd.c:1691:40: return_function: returning to ‘read_process’ from ‘xstrdup’
util-linux-2.40.4/misc-utils/lsfd.c:1694:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/lsfd.c:1712:13: branch_false: ...to here
util-linux-2.40.4/misc-utils/lsfd.c:1717:9: call_function: calling ‘collect_execve_file’ from ‘read_process’
#  716|   
#  717|   	INIT_LIST_HEAD(&file->files);
#  718|-> 	file->proc = old->proc;
#  719|   	list_add_tail(&file->files, &old->proc->files);
#  720|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def103]
util-linux-2.40.4/misc-utils/lsfd.c:1816:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
util-linux-2.40.4/misc-utils/lsfd.c:2242:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/lsfd.c:2247:16: release_memory: ‘filter_expr’ is NULL
util-linux-2.40.4/misc-utils/lsfd.c:2292:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
util-linux-2.40.4/misc-utils/lsfd.c:2293:17: branch_true: ...to here
util-linux-2.40.4/misc-utils/lsfd.c:2292:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
util-linux-2.40.4/misc-utils/lsfd.c:2293:17: branch_true: ...to here
util-linux-2.40.4/misc-utils/lsfd.c:2313:25: call_function: calling ‘parse_pids’ from ‘main’
# 1814|   	       && (isspace((unsigned char)*next) || *next == ','))
# 1815|   		next++;
# 1816|-> 	if (*next != '\0')
# 1817|   		parse_pids(next, pids, count);
# 1818|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def104]
util-linux-2.40.4/misc-utils/lsfd.c:1816:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘outarg’
util-linux-2.40.4/misc-utils/lsfd.c:2242:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/lsfd.c:2247:16: release_memory: ‘filter_expr’ is NULL
util-linux-2.40.4/misc-utils/lsfd.c:2292:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
util-linux-2.40.4/misc-utils/lsfd.c:2293:17: branch_true: ...to here
util-linux-2.40.4/misc-utils/lsfd.c:2313:25: call_function: calling ‘parse_pids’ from ‘main’
# 1814|   	       && (isspace((unsigned char)*next) || *next == ','))
# 1815|   		next++;
# 1816|-> 	if (*next != '\0')
# 1817|   		parse_pids(next, pids, count);
# 1818|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def105]
util-linux-2.40.4/misc-utils/lslocks.c:304:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
util-linux-2.40.4/misc-utils/lslocks.c:853:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/lslocks.c:937:12: branch_false: following ‘false’ branch (when ‘collist == 0’)...
util-linux-2.40.4/misc-utils/lslocks.c:940:9: branch_false: ...to here
util-linux-2.40.4/misc-utils/lslocks.c:955:12: branch_false: following ‘false’ branch (when ‘outarg’ is NULL)...
util-linux-2.40.4/misc-utils/lslocks.c:959:9: branch_false: ...to here
util-linux-2.40.4/misc-utils/lslocks.c:965:9: call_function: calling ‘get_pids_locks’ from ‘main’
util-linux-2.40.4/misc-utils/lslocks.c:965:9: return_function: returning to ‘main’ from ‘get_pids_locks’
util-linux-2.40.4/misc-utils/lslocks.c:966:14: call_function: calling ‘get_proc_locks’ from ‘main’
#  302|   		l->mandatory == m->mandatory &&
#  303|   		l->blocked == m->blocked &&
#  304|-> 		strcmp(l->type, m->type) == 0 &&
#  305|   		strcmp(l->mode, m->mode) == 0);
#  306|   }

Error: GCC_ANALYZER_WARNING (CWE-775): [#def106]
util-linux-2.40.4/misc-utils/mcookie.c:117:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
util-linux-2.40.4/misc-utils/mcookie.c:138:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/mcookie.c:188:9: call_function: calling ‘randomness_from_files’ from ‘main’
#  115|   		int fd;
#  116|   
#  117|-> 		if (*fname == '-' && !*(fname + 1))
#  118|   			fd = STDIN_FILENO;
#  119|   		else

Error: GCC_ANALYZER_WARNING (CWE-775): [#def107]
util-linux-2.40.4/misc-utils/mcookie.c:136:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
util-linux-2.40.4/misc-utils/mcookie.c:138:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/mcookie.c:188:9: call_function: calling ‘randomness_from_files’ from ‘main’
#  134|   		}
#  135|   	}
#  136|-> }
#  137|   
#  138|   int main(int argc, char **argv)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def108]
util-linux-2.40.4/misc-utils/mcookie.c:168:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ctl.files’
util-linux-2.40.4/misc-utils/mcookie.c:138:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/mcookie.c:160:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
util-linux-2.40.4/misc-utils/mcookie.c:161:17: branch_true: ...to here
util-linux-2.40.4/misc-utils/mcookie.c:166:28: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/mcookie.c:167:45: branch_true: ...to here
util-linux-2.40.4/misc-utils/mcookie.c:167:45: call_function: calling ‘xmalloc’ from ‘main’
util-linux-2.40.4/misc-utils/mcookie.c:167:45: return_function: returning to ‘main’ from ‘xmalloc’
util-linux-2.40.4/misc-utils/mcookie.c:168:25: danger: ‘ctl.files + ctl.nfiles * 8’ could be NULL: unchecked value from [(10)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/9)
#  166|   			if (!ctl.files)
#  167|   				ctl.files = xmalloc(sizeof(char *) * argc);
#  168|-> 			ctl.files[ctl.nfiles++] = optarg;
#  169|   			break;
#  170|   		case 'm':

Error: GCC_ANALYZER_WARNING (CWE-688): [#def109]
util-linux-2.40.4/misc-utils/namei.c:145:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc(len + 4)’ where non-null expected
util-linux-2.40.4/misc-utils/namei.c:399:1: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/namei.c:448:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/namei.c:453:18: branch_false: ...to here
util-linux-2.40.4/misc-utils/namei.c:454:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/namei.c:456:18: branch_false: ...to here
util-linux-2.40.4/misc-utils/namei.c:457:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
util-linux-2.40.4/misc-utils/namei.c:460:15: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/namei.c:461:34: branch_true: ...to here
util-linux-2.40.4/misc-utils/namei.c:468:22: call_function: calling ‘add_namei’ from ‘main’
#  143|   	memcpy(path + len, DOTDOTDIR, sizeof(DOTDOTDIR));
#  144|   
#  145|-> 	if (stat(path, st))
#  146|   		err(EXIT_FAILURE, _("stat of %s failed"), path);
#  147|   	free(path);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def110]
util-linux-2.40.4/misc-utils/rename.c:91:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘q’
util-linux-2.40.4/misc-utils/rename.c:68:12: enter_function: entry to ‘string_replace’
util-linux-2.40.4/misc-utils/rename.c:73:21: call_function: calling ‘find_initial_replace’ from ‘string_replace’
util-linux-2.40.4/misc-utils/rename.c:73:21: return_function: returning to ‘string_replace’ from ‘find_initial_replace’
util-linux-2.40.4/misc-utils/rename.c:74:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
util-linux-2.40.4/misc-utils/rename.c:87:20: call_function: calling ‘xmalloc’ from ‘string_replace’
util-linux-2.40.4/misc-utils/rename.c:87:20: return_function: returning to ‘string_replace’ from ‘xmalloc’
util-linux-2.40.4/misc-utils/rename.c:89:16: branch_true: following ‘true’ branch (when ‘count != 0’)...
 branch_true: ...to here
util-linux-2.40.4/misc-utils/rename.c:90:24: branch_true: following ‘true’ branch (when ‘p < where’)...
util-linux-2.40.4/misc-utils/rename.c:91:33: branch_true: ...to here
util-linux-2.40.4/misc-utils/rename.c:91:25: danger: ‘q’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
#   89|   	while (count--) {
#   90|   		while (p < where)
#   91|-> 			*q++ = *p++;
#   92|   		p = to;
#   93|   		while (*p)

Error: GCC_ANALYZER_WARNING (CWE-476): [#def111]
util-linux-2.40.4/misc-utils/rename.c:94:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘q’
util-linux-2.40.4/misc-utils/rename.c:68:12: enter_function: entry to ‘string_replace’
util-linux-2.40.4/misc-utils/rename.c:73:21: call_function: calling ‘find_initial_replace’ from ‘string_replace’
util-linux-2.40.4/misc-utils/rename.c:73:21: return_function: returning to ‘string_replace’ from ‘find_initial_replace’
util-linux-2.40.4/misc-utils/rename.c:74:12: branch_false: following ‘false’ branch...
 branch_false: ...to here
util-linux-2.40.4/misc-utils/rename.c:87:20: call_function: calling ‘xmalloc’ from ‘string_replace’
util-linux-2.40.4/misc-utils/rename.c:87:20: return_function: returning to ‘string_replace’ from ‘xmalloc’
util-linux-2.40.4/misc-utils/rename.c:89:16: branch_true: following ‘true’ branch (when ‘count != 0’)...
 branch_true: ...to here
util-linux-2.40.4/misc-utils/rename.c:90:24: branch_false: following ‘false’ branch (when ‘p >= where’)...
 branch_false: ...to here
util-linux-2.40.4/misc-utils/rename.c:93:24: branch_true: following ‘true’ branch...
util-linux-2.40.4/misc-utils/rename.c:94:33: branch_true: ...to here
util-linux-2.40.4/misc-utils/rename.c:94:25: danger: ‘q’ could be NULL: unchecked value from [(13)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/12)
#   92|   		p = to;
#   93|   		while (*p)
#   94|-> 			*q++ = *p++;
#   95|   		if (fromlen > 0) {
#   96|   			p = where + fromlen;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def112]
util-linux-2.40.4/misc-utils/rename.c:104:17: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘q’
util-linux-2.40.4/misc-utils/rename.c:142:12: enter_function: entry to ‘do_symlink’
util-linux-2.40.4/misc-utils/rename.c:159:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/rename.c:163:14: branch_false: ...to here
util-linux-2.40.4/misc-utils/rename.c:163:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/rename.c:167:26: branch_false: ...to here
util-linux-2.40.4/misc-utils/rename.c:167:18: call_function: calling ‘xmalloc’ from ‘do_symlink’
util-linux-2.40.4/misc-utils/rename.c:167:18: return_function: returning to ‘do_symlink’ from ‘xmalloc’
util-linux-2.40.4/misc-utils/rename.c:170:12: branch_false: following ‘false’ branch (when ‘ssz >= 0’)...
util-linux-2.40.4/misc-utils/rename.c:175:15: branch_false: ...to here
util-linux-2.40.4/misc-utils/rename.c:177:13: call_function: calling ‘string_replace’ from ‘do_symlink’
#  102|   	}
#  103|   	while (*p)
#  104|-> 		*q++ = *p++;
#  105|   	*q = 0;
#  106|   	return 0;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def113]
util-linux-2.40.4/misc-utils/rename.c:105:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘q’
util-linux-2.40.4/misc-utils/rename.c:142:12: enter_function: entry to ‘do_symlink’
util-linux-2.40.4/misc-utils/rename.c:159:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/rename.c:163:14: branch_false: ...to here
util-linux-2.40.4/misc-utils/rename.c:163:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/rename.c:167:26: branch_false: ...to here
util-linux-2.40.4/misc-utils/rename.c:167:18: call_function: calling ‘xmalloc’ from ‘do_symlink’
util-linux-2.40.4/misc-utils/rename.c:167:18: return_function: returning to ‘do_symlink’ from ‘xmalloc’
util-linux-2.40.4/misc-utils/rename.c:170:12: branch_false: following ‘false’ branch (when ‘ssz >= 0’)...
util-linux-2.40.4/misc-utils/rename.c:175:15: branch_false: ...to here
util-linux-2.40.4/misc-utils/rename.c:177:13: call_function: calling ‘string_replace’ from ‘do_symlink’
#  103|   	while (*p)
#  104|   		*q++ = *p++;
#  105|-> 	*q = 0;
#  106|   	return 0;
#  107|   }

Error: GCC_ANALYZER_WARNING (CWE-688): [#def114]
util-linux-2.40.4/misc-utils/rename.c:169:15: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc((long unsigned int)(sb.st_size + 1))’ where non-null expected
util-linux-2.40.4/misc-utils/rename.c:142:12: enter_function: entry to ‘do_symlink’
util-linux-2.40.4/misc-utils/rename.c:159:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/rename.c:163:14: branch_false: ...to here
util-linux-2.40.4/misc-utils/rename.c:163:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/misc-utils/rename.c:167:26: branch_false: ...to here
util-linux-2.40.4/misc-utils/rename.c:167:18: call_function: calling ‘xmalloc’ from ‘do_symlink’
util-linux-2.40.4/misc-utils/rename.c:167:18: return_function: returning to ‘do_symlink’ from ‘xmalloc’
util-linux-2.40.4/misc-utils/rename.c:169:15: danger: argument 2 (‘xmalloc((long unsigned int)(sb.st_size + 1))’) from [(8)](sarif:/runs/0/results/4/codeFlows/0/threadFlows/0/locations/7) could be NULL where non-null expected
#  167|   	target = xmalloc(sb.st_size + 1);
#  168|   
#  169|-> 	ssz = readlink(s, target, sb.st_size + 1);
#  170|   	if (ssz < 0) {
#  171|   		warn(_("%s: readlink failed"), s);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def115]
util-linux-2.40.4/misc-utils/waitpid.c:54:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc(n_strings, 4)’
util-linux-2.40.4/misc-utils/waitpid.c:223:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/waitpid.c:234:12: branch_false: following ‘false’ branch (when ‘n_pids != 0’)...
util-linux-2.40.4/misc-utils/waitpid.c:237:13: branch_false: ...to here
util-linux-2.40.4/misc-utils/waitpid.c:241:23: call_function: calling ‘parse_pids’ from ‘main’
#   52|   
#   53|   	for (size_t i = 0; i < n_strings; i++)
#   54|-> 		pids[i] = strtopid_or_err(strings[i], _("failed to parse pid"));
#   55|   
#   56|   	return pids;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def116]
util-linux-2.40.4/misc-utils/waitpid.c:64:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc(n_pids, 4)’
util-linux-2.40.4/misc-utils/waitpid.c:223:5: enter_function: entry to ‘main’
util-linux-2.40.4/misc-utils/waitpid.c:234:12: branch_false: following ‘false’ branch (when ‘n_pids != 0’)...
util-linux-2.40.4/misc-utils/waitpid.c:237:13: branch_false: ...to here
util-linux-2.40.4/misc-utils/waitpid.c:241:23: call_function: calling ‘parse_pids’ from ‘main’
util-linux-2.40.4/misc-utils/waitpid.c:241:23: return_function: returning to ‘main’ from ‘parse_pids’
util-linux-2.40.4/misc-utils/waitpid.c:243:18: call_function: calling ‘open_pidfds’ from ‘main’
#   62|   
#   63|   	for (size_t i = 0; i < n_pids; i++) {
#   64|-> 		pidfds[i] = pidfd_open(pids[i], 0);
#   65|   		if (pidfds[i] == -1) {
#   66|   			if (allow_exited && errno == ESRCH) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def117]
util-linux-2.40.4/sys-utils/blkpr.c:166:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 2)’
util-linux-2.40.4/sys-utils/blkpr.c:162:14: acquire_resource: opened here
util-linux-2.40.4/sys-utils/blkpr.c:163:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/blkpr.c:166:9: branch_false: ...to here
util-linux-2.40.4/sys-utils/blkpr.c:166:9: danger: ‘open(path, 2)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  164|   		err(EXIT_FAILURE, _("cannot open %s"), path);
#  165|   
#  166|-> 	switch (op) {
#  167|   	case IOC_PR_REGISTER:
#  168|   		pr_reg.old_key = oldkey;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def118]
util-linux-2.40.4/sys-utils/hwclock-rtc.c:419:22: warning[-Wanalyzer-null-argument]: use of NULL ‘alias’ where non-null expected
util-linux-2.40.4/sys-utils/hwclock-rtc.c:479:5: enter_function: entry to ‘set_param_rtc’
util-linux-2.40.4/sys-utils/hwclock-rtc.c:483:27: call_function: calling ‘xstrdup’ from ‘set_param_rtc’
util-linux-2.40.4/sys-utils/hwclock-rtc.c:483:27: return_function: returning to ‘set_param_rtc’ from ‘xstrdup’
util-linux-2.40.4/sys-utils/hwclock-rtc.c:487:13: call_function: calling ‘resolve_rtc_param_alias’ from ‘set_param_rtc’
#  417|   
#  418|   	while (param->name) {
#  419|-> 		if (!strcmp(alias, param->name)) {
#  420|   			*value = param->id;
#  421|   			return 0;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def119]
util-linux-2.40.4/sys-utils/irq-common.c:404:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘result’ where non-null expected
util-linux-2.40.4/sys-utils/irq-common.c:529:24: enter_function: entry to ‘get_scols_table’
util-linux-2.40.4/sys-utils/irq-common.c:543:16: call_function: calling ‘get_irqinfo’ from ‘get_scols_table’
util-linux-2.40.4/sys-utils/irq-common.c:543:16: return_function: returning to ‘get_scols_table’ from ‘get_irqinfo’
util-linux-2.40.4/sys-utils/irq-common.c:544:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/irq-common.c:547:42: branch_false: ...to here
util-linux-2.40.4/sys-utils/irq-common.c:548:18: call_function: calling ‘xmalloc’ from ‘get_scols_table’
util-linux-2.40.4/sys-utils/irq-common.c:548:18: return_function: returning to ‘get_scols_table’ from ‘xmalloc’
util-linux-2.40.4/sys-utils/irq-common.c:551:12: branch_false: following ‘false’ branch (when ‘prev’ is NULL)...
util-linux-2.40.4/sys-utils/irq-common.c:561:34: branch_false: ...to here
util-linux-2.40.4/sys-utils/irq-common.c:561:9: call_function: calling ‘sort_result’ from ‘get_scols_table’
#  402|   		func = out->sort_cmp_func;
#  403|   
#  404|-> 	qsort(result, nmemb, sizeof(*result),
#  405|   			(int (*)(const void *, const void *)) func);
#  406|   }

Error: GCC_ANALYZER_WARNING (CWE-476): [#def120]
util-linux-2.40.4/sys-utils/irq-common.c:557:38: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘cur’
util-linux-2.40.4/sys-utils/irq-common.c:529:24: enter_function: entry to ‘get_scols_table’
util-linux-2.40.4/sys-utils/irq-common.c:543:16: call_function: calling ‘get_irqinfo’ from ‘get_scols_table’
util-linux-2.40.4/sys-utils/irq-common.c:543:16: return_function: returning to ‘get_scols_table’ from ‘get_irqinfo’
util-linux-2.40.4/sys-utils/irq-common.c:544:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/irq-common.c:547:42: branch_false: ...to here
util-linux-2.40.4/sys-utils/irq-common.c:548:18: call_function: calling ‘xmalloc’ from ‘get_scols_table’
util-linux-2.40.4/sys-utils/irq-common.c:548:18: return_function: returning to ‘get_scols_table’ from ‘xmalloc’
util-linux-2.40.4/sys-utils/irq-common.c:551:12: branch_true: following ‘true’ branch (when ‘prev’ is non-NULL)...
util-linux-2.40.4/sys-utils/irq-common.c:552:17: branch_true: ...to here
util-linux-2.40.4/sys-utils/irq-common.c:553:29: branch_true: following ‘true’ branch...
util-linux-2.40.4/sys-utils/irq-common.c:554:55: branch_true: ...to here
util-linux-2.40.4/sys-utils/irq-common.c:557:38: danger: ‘cur’ could be NULL: unchecked value from [(69)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/68)
#  555|   			struct irq_info *pre = &prev->irq_info[i];
#  556|   
#  557|-> 			cur->delta = cur->total - pre->total;
#  558|   			stat->delta_irq += cur->delta;
#  559|   		}

Error: GCC_ANALYZER_WARNING (CWE-775): [#def121]
util-linux-2.40.4/sys-utils/ldattach.c:390:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev, 258)’
util-linux-2.40.4/sys-utils/ldattach.c:278:5: enter_function: entry to ‘main’
util-linux-2.40.4/sys-utils/ldattach.c:317:12: branch_false: following ‘false’ branch (when ‘argc != 0’)...
 branch_false: ...to here
util-linux-2.40.4/sys-utils/ldattach.c:364:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/ldattach.c:369:44: branch_false: ...to here
util-linux-2.40.4/sys-utils/ldattach.c:369:17: call_function: calling ‘lookup_table’ from ‘main’
util-linux-2.40.4/sys-utils/ldattach.c:369:17: return_function: returning to ‘main’ from ‘lookup_table’
util-linux-2.40.4/sys-utils/ldattach.c:370:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/ldattach.c:374:13: branch_false: ...to here
util-linux-2.40.4/sys-utils/ldattach.c:388:23: acquire_resource: opened here
util-linux-2.40.4/sys-utils/ldattach.c:388:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/ldattach.c:390:14: branch_false: ...to here
util-linux-2.40.4/sys-utils/ldattach.c:390:12: danger: ‘open(dev, 258)’ leaks here; was opened at [(13)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/12)
#  388|   	if ((tty_fd = open(dev, O_RDWR | O_NOCTTY)) < 0)
#  389|   		err(EXIT_FAILURE, _("cannot open %s"), dev);
#  390|-> 	if (!isatty(tty_fd))
#  391|   		errx(EXIT_FAILURE, _("%s is not a serial line"), dev);
#  392|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def122]
util-linux-2.40.4/sys-utils/lscpu-cpu.c:68:25: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*cxt.cpus’
util-linux-2.40.4/sys-utils/lscpu-cpu.c:57:5: enter_function: entry to ‘lscpu_create_cpus’
util-linux-2.40.4/sys-utils/lscpu-cpu.c:61:9: branch_true: following ‘true’ branch...
util-linux-2.40.4/sys-utils/lscpu-cpu.c:63:27: branch_true: ...to here
util-linux-2.40.4/sys-utils/lscpu-cpu.c:64:21: call_function: calling ‘xcalloc’ from ‘lscpu_create_cpus’
util-linux-2.40.4/sys-utils/lscpu-cpu.c:64:21: return_function: returning to ‘lscpu_create_cpus’ from ‘xcalloc’
util-linux-2.40.4/sys-utils/lscpu-cpu.c:66:28: branch_true: following ‘true’ branch...
util-linux-2.40.4/sys-utils/lscpu-cpu.c:67:21: branch_true: following ‘true’ branch...
util-linux-2.40.4/sys-utils/lscpu-cpu.c:68:42: call_function: calling ‘lscpu_new_cpu’ from ‘lscpu_create_cpus’
util-linux-2.40.4/sys-utils/lscpu-cpu.c:68:42: return_function: returning to ‘lscpu_create_cpus’ from ‘lscpu_new_cpu’
util-linux-2.40.4/sys-utils/lscpu-cpu.c:68:25: danger: ‘*cxt.cpus + i * 8’ could be NULL: unchecked value from [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5)
#   66|   	for (n = 0, i = 0; n < (size_t) cxt->maxcpus && i < cxt->npossibles; n++) {
#   67|   		if (CPU_ISSET_S(n, setsize, cpuset))
#   68|-> 			cxt->cpus[i++] = lscpu_new_cpu(n);
#   69|   	}
#   70|   

Error: GCC_ANALYZER_WARNING (CWE-476): [#def123]
util-linux-2.40.4/sys-utils/lscpu-cputype.c:428:20: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
util-linux-2.40.4/sys-utils/lscpu-cputype.c:422:13: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/lscpu-cputype.c:424:13: branch_false: ...to here
util-linux-2.40.4/sys-utils/lscpu-cputype.c:425:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/lscpu-cputype.c:428:20: danger: dereference of NULL ‘strstr(data, "type=")’
#  426|   		return 0;
#  427|   	p = strstr(data, "type=") + 5;
#  428|-> 	if (!p || !*p)
#  429|   		return 0;
#  430|   	type = 0;

Error: CPPCHECK_WARNING (CWE-457): [#def124]
util-linux-2.40.4/sys-utils/mount.c:820: error[legacyUninitvar]: Uninitialized variable: path
#  818|   				snprintf(path, sizeof(path), "/proc/%i/ns/mnt", pid);
#  819|   
#  820|-> 			if (mnt_context_set_target_ns(cxt, pid ? path : optarg))
#  821|   				err(MNT_EX_SYSERR, _("failed to set target namespace to %s"), pid ? path : optarg);
#  822|   			break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def125]
util-linux-2.40.4/sys-utils/nsenter.c:175:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor
util-linux-2.40.4/sys-utils/nsenter.c:316:5: enter_function: entry to ‘main’
util-linux-2.40.4/sys-utils/nsenter.c:377:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
util-linux-2.40.4/sys-utils/nsenter.c:381:17: branch_true: ...to here
util-linux-2.40.4/sys-utils/nsenter.c:381:17: call_function: calling ‘err_exclusive_options’ from ‘main’
util-linux-2.40.4/sys-utils/nsenter.c:381:17: return_function: returning to ‘main’ from ‘err_exclusive_options’
util-linux-2.40.4/sys-utils/nsenter.c:460:28: branch_true: following ‘true’ branch...
util-linux-2.40.4/sys-utils/nsenter.c:461:33: branch_true: ...to here
util-linux-2.40.4/sys-utils/nsenter.c:461:33: call_function: calling ‘open_target_fd’ from ‘main’
util-linux-2.40.4/sys-utils/nsenter.c:461:33: return_function: returning to ‘main’ from ‘open_target_fd’
util-linux-2.40.4/sys-utils/nsenter.c:175:1: danger: leaks here; was opened at [(19)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/18)
#  173|   	if (*fd < 0)
#  174|   		err(EXIT_FAILURE, _("cannot open %s"), path);
#  175|-> }
#  176|   
#  177|   static void open_namespace_fd(int nstype, const char *path)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def126]
util-linux-2.40.4/sys-utils/readprofile.c:230:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&defaultpro, 1)’
util-linux-2.40.4/sys-utils/readprofile.c:169:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
util-linux-2.40.4/sys-utils/readprofile.c:170:17: branch_true: ...to here
util-linux-2.40.4/sys-utils/readprofile.c:212:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/sys-utils/readprofile.c:218:20: branch_true: ...to here
util-linux-2.40.4/sys-utils/readprofile.c:218:20: branch_true: following ‘true’ branch (when ‘has_mult != 0’)...
util-linux-2.40.4/sys-utils/readprofile.c:226:17: branch_true: ...to here
util-linux-2.40.4/sys-utils/readprofile.c:227:22: acquire_resource: opened here
util-linux-2.40.4/sys-utils/readprofile.c:228:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/readprofile.c:230:21: branch_false: ...to here
util-linux-2.40.4/sys-utils/readprofile.c:230:21: danger: ‘open(&defaultpro, 1)’ leaks here; was opened at [(7)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/6)
#  228|   		if (fd < 0)
#  229|   			err(EXIT_FAILURE, "%s", defaultpro);
#  230|-> 		if (write(fd, &multiplier, to_write) != to_write)
#  231|   			err(EXIT_FAILURE, _("error writing %s"), defaultpro);
#  232|   		close(fd);

Error: GCC_ANALYZER_WARNING (CWE-476): [#def127]
util-linux-2.40.4/sys-utils/readprofile.c:277:9: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xmalloc(len)’
util-linux-2.40.4/sys-utils/readprofile.c:121:5: enter_function: entry to ‘main’
util-linux-2.40.4/sys-utils/readprofile.c:212:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/readprofile.c:237:23: branch_false: ...to here
util-linux-2.40.4/sys-utils/readprofile.c:237:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/readprofile.c:238:29: branch_false: ...to here
util-linux-2.40.4/sys-utils/readprofile.c:237:13: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/readprofile.c:239:17: branch_false: ...to here
util-linux-2.40.4/sys-utils/readprofile.c:237:13: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/readprofile.c:241:12: branch_false: ...to here
util-linux-2.40.4/sys-utils/readprofile.c:241:12: branch_false: following ‘false’ branch (when ‘len != 0’)...
util-linux-2.40.4/sys-utils/readprofile.c:244:15: branch_false: ...to here
util-linux-2.40.4/sys-utils/readprofile.c:244:15: call_function: calling ‘xmalloc’ from ‘main’
util-linux-2.40.4/sys-utils/readprofile.c:244:15: return_function: returning to ‘main’ from ‘xmalloc’
util-linux-2.40.4/sys-utils/readprofile.c:247:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/readprofile.c:249:9: branch_false: ...to here
util-linux-2.40.4/sys-utils/readprofile.c:277:9: danger: ‘xmalloc(len)’ could be NULL: unchecked value from [(14)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/13)
#  275|   	}
#  276|   
#  277|-> 	step = buf[0];
#  278|   	if (optInfo) {
#  279|   		printf(_("Sampling_step: %u\n"), step);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def128]
util-linux-2.40.4/sys-utils/setpgid.c:76:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/tty", 524288)’
util-linux-2.40.4/sys-utils/setpgid.c:65:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/setpgid.c:70:13: branch_false: ...to here
util-linux-2.40.4/sys-utils/setpgid.c:70:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/setpgid.c:73:12: branch_false: ...to here
util-linux-2.40.4/sys-utils/setpgid.c:73:12: branch_true: following ‘true’ branch (when ‘foreground != 0’)...
util-linux-2.40.4/sys-utils/setpgid.c:74:22: branch_true: ...to here
util-linux-2.40.4/sys-utils/setpgid.c:74:22: acquire_resource: opened here
util-linux-2.40.4/sys-utils/setpgid.c:75:20: branch_true: following ‘true’ branch...
util-linux-2.40.4/sys-utils/setpgid.c:76:29: branch_true: ...to here
util-linux-2.40.4/sys-utils/setpgid.c:76:28: danger: ‘open("/dev/tty", 524288)’ leaks here; was opened at [(9)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/8)
#   74|   		fd = open("/dev/tty", O_RDONLY|O_CLOEXEC);
#   75|   		if (fd >= 0) {
#   76|-> 			if (sigemptyset(&s) < 0)
#   77|   				err(EXIT_FAILURE, _("sigemptyset failed"));
#   78|   			if (sigaddset(&s, SIGTTOU) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def129]
util-linux-2.40.4/sys-utils/setpgid.c:78:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/tty", 524288)’
util-linux-2.40.4/sys-utils/setpgid.c:65:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/setpgid.c:70:13: branch_false: ...to here
util-linux-2.40.4/sys-utils/setpgid.c:70:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/setpgid.c:73:12: branch_false: ...to here
util-linux-2.40.4/sys-utils/setpgid.c:73:12: branch_true: following ‘true’ branch (when ‘foreground != 0’)...
util-linux-2.40.4/sys-utils/setpgid.c:74:22: branch_true: ...to here
util-linux-2.40.4/sys-utils/setpgid.c:74:22: acquire_resource: opened here
util-linux-2.40.4/sys-utils/setpgid.c:75:20: branch_true: following ‘true’ branch...
util-linux-2.40.4/sys-utils/setpgid.c:76:29: branch_true: ...to here
util-linux-2.40.4/sys-utils/setpgid.c:76:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/setpgid.c:78:29: branch_false: ...to here
util-linux-2.40.4/sys-utils/setpgid.c:78:28: danger: ‘open("/dev/tty", 524288)’ leaks here; was opened at [(9)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/8)
#   76|   			if (sigemptyset(&s) < 0)
#   77|   				err(EXIT_FAILURE, _("sigemptyset failed"));
#   78|-> 			if (sigaddset(&s, SIGTTOU) < 0)
#   79|   				err(EXIT_FAILURE, _("sigaddset failed"));
#   80|   			if (sigprocmask(SIG_BLOCK, &s, &old) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def130]
util-linux-2.40.4/sys-utils/setpgid.c:80:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/tty", 524288)’
util-linux-2.40.4/sys-utils/setpgid.c:65:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/setpgid.c:70:13: branch_false: ...to here
util-linux-2.40.4/sys-utils/setpgid.c:70:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/setpgid.c:73:12: branch_false: ...to here
util-linux-2.40.4/sys-utils/setpgid.c:73:12: branch_true: following ‘true’ branch (when ‘foreground != 0’)...
util-linux-2.40.4/sys-utils/setpgid.c:74:22: branch_true: ...to here
util-linux-2.40.4/sys-utils/setpgid.c:74:22: acquire_resource: opened here
util-linux-2.40.4/sys-utils/setpgid.c:75:20: branch_true: following ‘true’ branch...
util-linux-2.40.4/sys-utils/setpgid.c:76:29: branch_true: ...to here
util-linux-2.40.4/sys-utils/setpgid.c:76:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/setpgid.c:78:29: branch_false: ...to here
util-linux-2.40.4/sys-utils/setpgid.c:78:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/setpgid.c:80:29: branch_false: ...to here
util-linux-2.40.4/sys-utils/setpgid.c:80:28: danger: ‘open("/dev/tty", 524288)’ leaks here; was opened at [(9)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/8)
#   78|   			if (sigaddset(&s, SIGTTOU) < 0)
#   79|   				err(EXIT_FAILURE, _("sigaddset failed"));
#   80|-> 			if (sigprocmask(SIG_BLOCK, &s, &old) < 0)
#   81|   				err(EXIT_FAILURE, _("sigprocmask failed"));
#   82|   			if (tcsetpgrp(fd, getpgid(0)) < 0)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def131]
util-linux-2.40.4/sys-utils/setpriv.c:632:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/proc/self/attr/exec", 2)’
util-linux-2.40.4/sys-utils/setpriv.c:740:5: enter_function: entry to ‘main’
util-linux-2.40.4/sys-utils/setpriv.c:965:12: branch_false: following ‘false’ branch (when ‘dumplevel == 0’)...
util-linux-2.40.4/sys-utils/setpriv.c:973:12: branch_false: ...to here
util-linux-2.40.4/sys-utils/setpriv.c:973:12: branch_false: following ‘false’ branch (when ‘list_caps == 0’)...
util-linux-2.40.4/sys-utils/setpriv.c:981:13: branch_false: ...to here
util-linux-2.40.4/sys-utils/setpriv.c:981:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/setpriv.c:984:14: branch_false: ...to here
util-linux-2.40.4/sys-utils/setpriv.c:1000:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/setpriv.c:1010:13: branch_false: ...to here
util-linux-2.40.4/sys-utils/setpriv.c:1010:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/setpriv.c:1013:13: branch_false: ...to here
util-linux-2.40.4/sys-utils/setpriv.c:1013:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/sys-utils/setpriv.c:1014:17: branch_true: ...to here
util-linux-2.40.4/sys-utils/setpriv.c:1014:17: call_function: calling ‘do_selinux_label’ from ‘main’
#  630|   	len = strlen(label);
#  631|   	errno = 0;
#  632|-> 	if (write(fd, label, len) != (ssize_t) len)
#  633|   		err(SETPRIV_EXIT_PRIVERR,
#  634|   		    _("write failed: %s"), _PATH_PROC_ATTR_EXEC);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def132]
util-linux-2.40.4/sys-utils/swapoff.c:80:35: warning[-Wanalyzer-malloc-leak]: leak of ‘swapoff_resolve_tag(name,  value,  mntcache)’
util-linux-2.40.4/sys-utils/swapoff.c:226:5: enter_function: entry to ‘main’
util-linux-2.40.4/sys-utils/swapoff.c:278:21: branch_true: following ‘true’ branch...
util-linux-2.40.4/sys-utils/swapoff.c:279:27: branch_true: ...to here
util-linux-2.40.4/sys-utils/swapoff.c:279:27: call_function: calling ‘swapoff_by’ from ‘main’
#   78|   	while (tb && mnt_table_next_fs(tb, itr, &fs) == 0) {
#   79|   		blkid_probe pr = NULL;
#   80|-> 		const char *src = mnt_fs_get_source(fs);
#   81|   		const char *type = mnt_fs_get_swaptype(fs);
#   82|   		const char *data = NULL;

Error: CPPCHECK_WARNING (CWE-457): [#def133]
util-linux-2.40.4/sys-utils/umount.c:598: error[legacyUninitvar]: Uninitialized variable: path
#  596|   				snprintf(path, sizeof(path), "/proc/%i/ns/mnt", pid);
#  597|   
#  598|-> 			if (mnt_context_set_target_ns(cxt, pid ? path : optarg))
#  599|   				err(MNT_EX_SYSERR, _("failed to set target namespace to %s"), pid ? path : optarg);
#  600|   			break;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def134]
util-linux-2.40.4/sys-utils/unshare.c:118:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/proc/self/setgroups", 1)’
util-linux-2.40.4/sys-utils/unshare.c:111:14: acquire_resource: opened here
util-linux-2.40.4/sys-utils/unshare.c:112:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/unshare.c:118:13: branch_false: ...to here
util-linux-2.40.4/sys-utils/unshare.c:118:12: danger: ‘open("/proc/self/setgroups", 1)’ leaks here; was opened at [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0)
#  116|   	}
#  117|   
#  118|-> 	if (write_all(fd, cmd, strlen(cmd)))
#  119|   		err(EXIT_FAILURE, _("write failed %s"), file);
#  120|   	close(fd);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def135]
util-linux-2.40.4/sys-utils/unshare.c:668:13: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 524545)’
util-linux-2.40.4/sys-utils/unshare.c:782:5: enter_function: entry to ‘main’
util-linux-2.40.4/sys-utils/unshare.c:867:16: branch_true: following ‘true’ branch (when ‘c != -1’)...
util-linux-2.40.4/sys-utils/unshare.c:868:17: branch_true: ...to here
util-linux-2.40.4/sys-utils/unshare.c:936:28: branch_false: following ‘false’ branch (when the strings are non-equal)...
util-linux-2.40.4/sys-utils/unshare.c:939:35: branch_false: ...to here
util-linux-2.40.4/sys-utils/unshare.c:939:33: branch_true: following ‘true’ branch (when the strings are equal)...
util-linux-2.40.4/sys-utils/unshare.c:940:33: branch_true: ...to here
util-linux-2.40.4/sys-utils/unshare.c:940:33: call_function: calling ‘read_kernel_map’ from ‘main’
util-linux-2.40.4/sys-utils/unshare.c:940:33: return_function: returning to ‘main’ from ‘read_kernel_map’
util-linux-2.40.4/sys-utils/unshare.c:867:16: branch_false: following ‘false’ branch (when ‘c == -1’)...
util-linux-2.40.4/sys-utils/unshare.c:1011:13: branch_false: ...to here
util-linux-2.40.4/sys-utils/unshare.c:1011:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/unshare.c:1016:9: branch_false: ...to here
util-linux-2.40.4/sys-utils/unshare.c:1018:12: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/unshare.c:1021:13: branch_false: ...to here
util-linux-2.40.4/sys-utils/unshare.c:1021:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/sys-utils/unshare.c:1022:29: branch_true: ...to here
util-linux-2.40.4/sys-utils/unshare.c:1022:29: call_function: calling ‘map_ids_from_child’ from ‘main’
#  666|   	if (fd < 0)
#  667|   		err(EXIT_FAILURE, _("failed to open %s"), path);
#  668|-> 	if (write_all(fd, buffer, length) < 0)
#  669|   		err(EXIT_FAILURE, _("failed to write %s"), path);
#  670|   	close(fd);

Error: GCC_ANALYZER_WARNING (CWE-401): [#def136]
util-linux-2.40.4/sys-utils/zramctl.c:710:33: warning[-Wanalyzer-malloc-leak]: leak of ‘new_zram(*<unknown>)’
util-linux-2.40.4/sys-utils/zramctl.c:588:5: enter_function: entry to ‘main’
util-linux-2.40.4/sys-utils/zramctl.c:685:13: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/zramctl.c:688:14: branch_false: ...to here
util-linux-2.40.4/sys-utils/zramctl.c:688:13: branch_false: following ‘false’ branch...
util-linux-2.40.4/sys-utils/zramctl.c:692:9: branch_false: ...to here
util-linux-2.40.4/sys-utils/zramctl.c:707:20: branch_true: following ‘true’ branch...
util-linux-2.40.4/sys-utils/zramctl.c:708:46: branch_true: ...to here
util-linux-2.40.4/sys-utils/zramctl.c:708:32: call_function: calling ‘new_zram’ from ‘main’
util-linux-2.40.4/sys-utils/zramctl.c:708:32: return_function: returning to ‘main’ from ‘new_zram’
util-linux-2.40.4/sys-utils/zramctl.c:709:30: call_function: calling ‘zram_exist’ from ‘main’
util-linux-2.40.4/sys-utils/zramctl.c:709:30: return_function: returning to ‘main’ from ‘zram_exist’
util-linux-2.40.4/sys-utils/zramctl.c:709:28: branch_true: following ‘true’ branch...
util-linux-2.40.4/sys-utils/zramctl.c:710:57: branch_true: ...to here
util-linux-2.40.4/sys-utils/zramctl.c:710:33: danger: ‘new_zram(*<unknown>)’ leaks here; was allocated at [(14)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/13)
#  708|   			zram = new_zram(argv[optind++]);
#  709|   			if (!zram_exist(zram))
#  710|-> 				err(EXIT_FAILURE, "%s", zram->devname);
#  711|   		}
#  712|   		status(zram);

Error: GCC_ANALYZER_WARNING (CWE-688): [#def137]
util-linux-2.40.4/term-utils/agetty.c:1854:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*ie.output’ where non-null expected
util-linux-2.40.4/term-utils/agetty.c:1843:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/term-utils/agetty.c:1844:22: branch_true: ...to here
util-linux-2.40.4/term-utils/agetty.c:1847:30: acquire_memory: this call could return NULL
util-linux-2.40.4/term-utils/agetty.c:1850:16: branch_true: following ‘true’ branch...
util-linux-2.40.4/term-utils/agetty.c:1851:20: branch_true: ...to here
util-linux-2.40.4/term-utils/agetty.c:1851:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/term-utils/agetty.c:1854:25: branch_false: ...to here
util-linux-2.40.4/term-utils/agetty.c:1854:25: danger: argument 2 (‘*ie.output’) from [(3)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/2) could be NULL where non-null expected
# 1852|   			output_special_char(ie, getc(f), op, tp, f);
# 1853|   		else
# 1854|-> 			putc(c, ie->output);
# 1855|   	}
# 1856|   

Error: GCC_ANALYZER_WARNING (CWE-688): [#def138]
util-linux-2.40.4/term-utils/agetty.c:2722:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*ie.output’ where non-null expected
util-linux-2.40.4/term-utils/agetty.c:1833:12: enter_function: entry to ‘issuefile_read_stream’
util-linux-2.40.4/term-utils/agetty.c:1843:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/term-utils/agetty.c:1844:22: branch_true: ...to here
util-linux-2.40.4/term-utils/agetty.c:1847:30: acquire_memory: this call could return NULL
util-linux-2.40.4/term-utils/agetty.c:1850:16: branch_true: following ‘true’ branch...
util-linux-2.40.4/term-utils/agetty.c:1851:20: branch_true: ...to here
util-linux-2.40.4/term-utils/agetty.c:1851:20: branch_true: following ‘true’ branch...
util-linux-2.40.4/term-utils/agetty.c:1852:49: branch_true: ...to here
util-linux-2.40.4/term-utils/agetty.c:1852:25: call_function: calling ‘output_special_char’ from ‘issuefile_read_stream’
#argument 2 of ‘__builtin_fputc’ must be non-null
# 2720|   			}
# 2721|   		} else
# 2722|-> 			fputs("\033", ie->output);
# 2723|   		break;
# 2724|   	}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def139]
util-linux-2.40.4/term-utils/agetty.c:2797:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*ie.output’ where non-null expected
util-linux-2.40.4/term-utils/agetty.c:1833:12: enter_function: entry to ‘issuefile_read_stream’
util-linux-2.40.4/term-utils/agetty.c:1843:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/term-utils/agetty.c:1844:22: branch_true: ...to here
util-linux-2.40.4/term-utils/agetty.c:1847:30: acquire_memory: this call could return NULL
util-linux-2.40.4/term-utils/agetty.c:1850:16: branch_true: following ‘true’ branch...
util-linux-2.40.4/term-utils/agetty.c:1851:20: branch_true: ...to here
util-linux-2.40.4/term-utils/agetty.c:1851:20: branch_true: following ‘true’ branch...
util-linux-2.40.4/term-utils/agetty.c:1852:49: branch_true: ...to here
util-linux-2.40.4/term-utils/agetty.c:1852:25: call_function: calling ‘output_special_char’ from ‘issuefile_read_stream’
#argument 2 of ‘__builtin_fputs’ must be non-null
# 2795|   	}
# 2796|   	case 'l':
# 2797|-> 		fprintf (ie->output, "%s", op->tty);
# 2798|   		break;
# 2799|   	case 'b':

Error: GCC_ANALYZER_WARNING (CWE-688): [#def140]
util-linux-2.40.4/term-utils/agetty.c:2892:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*ie.output’ where non-null expected
util-linux-2.40.4/term-utils/agetty.c:1833:12: enter_function: entry to ‘issuefile_read_stream’
util-linux-2.40.4/term-utils/agetty.c:1843:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/term-utils/agetty.c:1844:22: branch_true: ...to here
util-linux-2.40.4/term-utils/agetty.c:1847:30: acquire_memory: this call could return NULL
util-linux-2.40.4/term-utils/agetty.c:1850:16: branch_true: following ‘true’ branch...
util-linux-2.40.4/term-utils/agetty.c:1851:20: branch_true: ...to here
util-linux-2.40.4/term-utils/agetty.c:1851:20: branch_true: following ‘true’ branch...
util-linux-2.40.4/term-utils/agetty.c:1852:49: branch_true: ...to here
util-linux-2.40.4/term-utils/agetty.c:1852:25: call_function: calling ‘output_special_char’ from ‘issuefile_read_stream’
# 2890|   #endif
# 2891|   	default:
# 2892|-> 		putc(c, ie->output);
# 2893|   		break;
# 2894|   	}

Error: GCC_ANALYZER_WARNING (CWE-688): [#def141]
util-linux-2.40.4/term-utils/wall.c:361:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fs’ where non-null expected
util-linux-2.40.4/term-utils/wall.c:324:14: enter_function: entry to ‘makemsg’
util-linux-2.40.4/term-utils/wall.c:328:21: acquire_memory: this call could return NULL
util-linux-2.40.4/term-utils/wall.c:330:16: call_function: calling ‘xmalloc’ from ‘makemsg’
util-linux-2.40.4/term-utils/wall.c:330:16: return_function: returning to ‘makemsg’ from ‘xmalloc’
util-linux-2.40.4/term-utils/wall.c:332:12: branch_true: following ‘true’ branch (when ‘print_banner == 1’)...
util-linux-2.40.4/term-utils/wall.c:333:34: branch_true: ...to here
util-linux-2.40.4/term-utils/wall.c:333:34: call_function: calling ‘xgethostname’ from ‘makemsg’
util-linux-2.40.4/term-utils/wall.c:333:34: return_function: returning to ‘makemsg’ from ‘xgethostname’
util-linux-2.40.4/term-utils/wall.c:361:17: danger: argument 1 (‘fs’) from [(2)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/1) could be NULL where non-null expected
#  359|   		/* snprintf is not always available, but the sprintf's here
#  360|   		   will not overflow as long as %d takes at most 100 chars */
#  361|-> 		fprintf(fs, "\r%*s\r\n", TERM_WIDTH, " ");
#  362|   
#  363|   		snprintf(lbuf, lbuflen,

Error: GCC_ANALYZER_WARNING (CWE-688): [#def142]
util-linux-2.40.4/term-utils/wall.c:370:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fs’ where non-null expected
util-linux-2.40.4/term-utils/wall.c:324:14: enter_function: entry to ‘makemsg’
util-linux-2.40.4/term-utils/wall.c:328:21: acquire_memory: this call could return NULL
util-linux-2.40.4/term-utils/wall.c:330:16: call_function: calling ‘xmalloc’ from ‘makemsg’
util-linux-2.40.4/term-utils/wall.c:330:16: return_function: returning to ‘makemsg’ from ‘xmalloc’
util-linux-2.40.4/term-utils/wall.c:332:12: branch_false: following ‘false’ branch (when ‘print_banner != 1’)...
util-linux-2.40.4/term-utils/wall.c:370:9: branch_false: ...to here
util-linux-2.40.4/term-utils/wall.c:370:9: danger: argument 1 (‘fs’) from [(2)](sarif:/runs/0/results/2/codeFlows/0/threadFlows/0/locations/1) could be NULL where non-null expected
#  368|   		free(whombuf);
#  369|   	}
#  370|-> 	fprintf(fs, "%*s\r\n", TERM_WIDTH, " ");
#  371|   
#  372|   	 if (mvec) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def143]
util-linux-2.40.4/text-utils/hexdump-display.c:390:29: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘curp’ where non-null expected
util-linux-2.40.4/text-utils/hexdump-display.c:336:1: enter_function: entry to ‘get’
util-linux-2.40.4/text-utils/hexdump-display.c:343:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/hexdump-display.c:344:35: branch_true: ...to here
util-linux-2.40.4/text-utils/hexdump-display.c:344:24: call_function: calling ‘xcalloc’ from ‘get’
util-linux-2.40.4/text-utils/hexdump-display.c:344:24: return_function: returning to ‘get’ from ‘xcalloc’
util-linux-2.40.4/text-utils/hexdump-display.c:345:24: call_function: calling ‘xcalloc’ from ‘get’
util-linux-2.40.4/text-utils/hexdump-display.c:345:24: return_function: returning to ‘get’ from ‘xcalloc’
util-linux-2.40.4/text-utils/hexdump-display.c:359:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/hexdump-display.c:373:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/hexdump-display.c:377:21: branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-display.c:379:20: branch_false: following ‘false’ branch (when ‘n != 0’)...
util-linux-2.40.4/text-utils/hexdump-display.c:385:17: branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-display.c:388:20: branch_true: following ‘true’ branch (when ‘need == 0’)...
util-linux-2.40.4/text-utils/hexdump-display.c:389:29: branch_true: ...to here
util-linux-2.40.4/text-utils/hexdump-display.c:389:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/hexdump-display.c:390:48: branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-display.c:390:29: danger: argument 1 (‘curp’) from [(6)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/5) could be NULL where non-null expected
#  388|   		if (!(need -= n)) {
#  389|   			if (vflag == ALL || vflag == FIRST ||
#  390|-> 			    memcmp(curp, savp, hex->blocksize) != 0) {
#  391|   				if (vflag == DUP || vflag == FIRST)
#  392|   					vflag = WAIT;

Error: GCC_ANALYZER_WARNING (CWE-688): [#def144]
util-linux-2.40.4/text-utils/hexdump-display.c:390:29: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘savp’ where non-null expected
util-linux-2.40.4/text-utils/hexdump-display.c:336:1: enter_function: entry to ‘get’
util-linux-2.40.4/text-utils/hexdump-display.c:343:12: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/hexdump-display.c:344:35: branch_true: ...to here
util-linux-2.40.4/text-utils/hexdump-display.c:344:24: call_function: calling ‘xcalloc’ from ‘get’
util-linux-2.40.4/text-utils/hexdump-display.c:344:24: return_function: returning to ‘get’ from ‘xcalloc’
util-linux-2.40.4/text-utils/hexdump-display.c:345:24: call_function: calling ‘xcalloc’ from ‘get’
util-linux-2.40.4/text-utils/hexdump-display.c:345:24: return_function: returning to ‘get’ from ‘xcalloc’
util-linux-2.40.4/text-utils/hexdump-display.c:359:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/hexdump-display.c:373:20: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/hexdump-display.c:377:21: branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-display.c:379:20: branch_false: following ‘false’ branch (when ‘n != 0’)...
util-linux-2.40.4/text-utils/hexdump-display.c:385:17: branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-display.c:388:20: branch_true: following ‘true’ branch (when ‘need == 0’)...
util-linux-2.40.4/text-utils/hexdump-display.c:389:29: branch_true: ...to here
util-linux-2.40.4/text-utils/hexdump-display.c:389:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/hexdump-display.c:390:48: branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-display.c:390:29: danger: argument 2 (‘savp’) from [(11)](sarif:/runs/0/results/1/codeFlows/0/threadFlows/0/locations/10) could be NULL where non-null expected
#  388|   		if (!(need -= n)) {
#  389|   			if (vflag == ALL || vflag == FIRST ||
#  390|-> 			    memcmp(curp, savp, hex->blocksize) != 0) {
#  391|   				if (vflag == DUP || vflag == FIRST)
#  392|   					vflag = WAIT;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def145]
util-linux-2.40.4/text-utils/hexdump-parse.c:284:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p1’
util-linux-2.40.4/text-utils/hexdump-parse.c:228:6: enter_function: entry to ‘rewrite_rules’
util-linux-2.40.4/text-utils/hexdump-parse.c:238:9: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:245:17: branch_true: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:246:24: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:247:30: branch_true: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:247:30: call_function: calling ‘xcalloc’ from ‘rewrite_rules’
util-linux-2.40.4/text-utils/hexdump-parse.c:247:30: return_function: returning to ‘rewrite_rules’ from ‘xcalloc’
util-linux-2.40.4/text-utils/hexdump-parse.c:257:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:267:29: branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:267:28: branch_false: following ‘false’ branch...
 branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:274:40: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:276:36: branch_false: ...to here
util-linux-2.40.4/text-utils/hexdump-parse.c:276:36: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/hexdump-parse.c:278:46: call_function: calling ‘next_number’ from ‘rewrite_rules’
util-linux-2.40.4/text-utils/hexdump-parse.c:278:46: return_function: returning to ‘rewrite_rules’ from ‘next_number’
util-linux-2.40.4/text-utils/hexdump-parse.c:284:33: danger: dereference of NULL ‘p1’
#  282|   
#  283|   			p2 = p1 + 1;		/* Set end pointer. */
#  284|-> 			cs[0] = *p1;		/* Set conversion string. */
#  285|   			cs[1] = 0;
#  286|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def146]
util-linux-2.40.4/text-utils/hexdump-parse.c:492:16: warning[-Wanalyzer-malloc-leak]: leak of ‘hcnext’
util-linux-2.40.4/text-utils/hexdump-parse.c:478:26: enter_function: entry to ‘color_fmt’
util-linux-2.40.4/text-utils/hexdump-parse.c:484:20: call_function: calling ‘xmalloc’ from ‘color_fmt’
util-linux-2.40.4/text-utils/hexdump-parse.c:484:20: return_function: returning to ‘color_fmt’ from ‘xmalloc’
util-linux-2.40.4/text-utils/hexdump-parse.c:485:23: call_function: calling ‘xcalloc’ from ‘color_fmt’
util-linux-2.40.4/text-utils/hexdump-parse.c:485:23: return_function: returning to ‘color_fmt’ from ‘xcalloc’
util-linux-2.40.4/text-utils/hexdump-parse.c:492:16: danger: ‘hcnext’ leaks here; was allocated at [(9)](sarif:/runs/0/results/3/codeFlows/0/threadFlows/0/locations/8)
#  490|   
#  491|   	fmt = cfmt;
#  492|-> 	while (cfmt && *cfmt) {
#  493|   		char *end;
#  494|   		/* invert this condition */

Error: GCC_ANALYZER_WARNING (CWE-476): [#def147]
util-linux-2.40.4/text-utils/more.c:284:21: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘as_argv’
util-linux-2.40.4/text-utils/more.c:2075:5: enter_function: entry to ‘main’
util-linux-2.40.4/text-utils/more.c:2103:12: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
util-linux-2.40.4/text-utils/more.c:2104:17: branch_true: ...to here
util-linux-2.40.4/text-utils/more.c:2104:17: call_function: calling ‘env_argscan’ from ‘main’
#  282|   		int move = 0;
#  283|   
#  284|-> 		if (as_argv[opt][0] == '-' && isdigit_string(as_argv[opt] + 1)) {
#  285|   			ctl->lines_per_screen =
#  286|   			    strtos16_or_err(as_argv[opt], _("failed to parse number"));

Error: GCC_ANALYZER_WARNING (CWE-688): [#def148]
util-linux-2.40.4/text-utils/more.c:307:21: warning[-Wanalyzer-null-argument]: use of NULL ‘as_argv’ where non-null expected
util-linux-2.40.4/text-utils/more.c:2075:5: enter_function: entry to ‘main’
util-linux-2.40.4/text-utils/more.c:2103:12: branch_true: following ‘true’ branch (when ‘s’ is non-NULL)...
util-linux-2.40.4/text-utils/more.c:2104:17: branch_true: ...to here
util-linux-2.40.4/text-utils/more.c:2104:17: call_function: calling ‘env_argscan’ from ‘main’
#  305|   	}
#  306|   
#  307|-> 	while ((c = getopt_long(as_argc, as_argv, "dflcpsun:eVh", longopts, NULL)) != -1) {
#  308|   		switch (c) {
#  309|   		case 'd':

Error: GCC_ANALYZER_WARNING (CWE-476): [#def149]
util-linux-2.40.4/text-utils/rev.c:93:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘str’
util-linux-2.40.4/text-utils/rev.c:119:5: enter_function: entry to ‘main’
util-linux-2.40.4/text-utils/rev.c:160:15: call_function: calling ‘xreallocarray’ from ‘main’
util-linux-2.40.4/text-utils/rev.c:160:15: return_function: returning to ‘main’ from ‘xreallocarray’
util-linux-2.40.4/text-utils/rev.c:174:24: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/rev.c:175:31: branch_true: ...to here
util-linux-2.40.4/text-utils/rev.c:175:31: call_function: calling ‘read_line’ from ‘main’
util-linux-2.40.4/text-utils/rev.c:175:31: return_function: returning to ‘main’ from ‘read_line’
util-linux-2.40.4/text-utils/rev.c:178:32: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/rev.c:183:39: call_function: calling ‘xreallocarray’ from ‘main’
util-linux-2.40.4/text-utils/rev.c:183:39: return_function: returning to ‘main’ from ‘xreallocarray’
util-linux-2.40.4/text-utils/rev.c:186:40: call_function: calling ‘read_line’ from ‘main’
util-linux-2.40.4/text-utils/rev.c:186:40: return_function: returning to ‘main’ from ‘read_line’
util-linux-2.40.4/text-utils/rev.c:178:32: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/rev.c:183:39: call_function: calling ‘xreallocarray’ from ‘main’
util-linux-2.40.4/text-utils/rev.c:183:39: return_function: returning to ‘main’ from ‘xreallocarray’
util-linux-2.40.4/text-utils/rev.c:188:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/rev.c:193:28: branch_false: ...to here
util-linux-2.40.4/text-utils/rev.c:193:28: branch_false: following ‘false’ branch (when ‘len != 0’)...
util-linux-2.40.4/text-utils/rev.c:196:45: branch_false: ...to here
util-linux-2.40.4/text-utils/rev.c:196:25: call_function: calling ‘reverse_str’ from ‘main’
#   91|   
#   92|   	for (i = 0; i < n / 2; ++i) {
#   93|-> 		wchar_t tmp = str[i];
#   94|   		str[i] = str[n - 1 - i];
#   95|   		str[n - 1 - i] = tmp;

Error: GCC_ANALYZER_WARNING (CWE-476): [#def150]
util-linux-2.40.4/text-utils/rev.c:116:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘str’
util-linux-2.40.4/text-utils/rev.c:119:5: enter_function: entry to ‘main’
util-linux-2.40.4/text-utils/rev.c:160:15: call_function: calling ‘xreallocarray’ from ‘main’
util-linux-2.40.4/text-utils/rev.c:160:15: return_function: returning to ‘main’ from ‘xreallocarray’
util-linux-2.40.4/text-utils/rev.c:174:24: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/rev.c:175:31: branch_true: ...to here
util-linux-2.40.4/text-utils/rev.c:175:31: call_function: calling ‘read_line’ from ‘main’
util-linux-2.40.4/text-utils/rev.c:175:31: return_function: returning to ‘main’ from ‘read_line’
util-linux-2.40.4/text-utils/rev.c:178:32: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/rev.c:183:39: call_function: calling ‘xreallocarray’ from ‘main’
util-linux-2.40.4/text-utils/rev.c:183:39: return_function: returning to ‘main’ from ‘xreallocarray’
util-linux-2.40.4/text-utils/rev.c:186:40: call_function: calling ‘read_line’ from ‘main’
util-linux-2.40.4/text-utils/rev.c:186:40: return_function: returning to ‘main’ from ‘read_line’
util-linux-2.40.4/text-utils/rev.c:178:32: branch_true: following ‘true’ branch...
util-linux-2.40.4/text-utils/rev.c:183:39: call_function: calling ‘xreallocarray’ from ‘main’
util-linux-2.40.4/text-utils/rev.c:183:39: return_function: returning to ‘main’ from ‘xreallocarray’
util-linux-2.40.4/text-utils/rev.c:188:28: branch_false: following ‘false’ branch...
util-linux-2.40.4/text-utils/rev.c:193:28: branch_false: ...to here
util-linux-2.40.4/text-utils/rev.c:193:28: branch_false: following ‘false’ branch (when ‘len != 0’)...
util-linux-2.40.4/text-utils/rev.c:196:45: branch_false: ...to here
util-linux-2.40.4/text-utils/rev.c:196:25: call_function: calling ‘reverse_str’ from ‘main’
util-linux-2.40.4/text-utils/rev.c:196:25: return_function: returning to ‘main’ from ‘reverse_str’
util-linux-2.40.4/text-utils/rev.c:197:25: call_function: calling ‘write_line’ from ‘main’
#  114|   {
#  115|   	for (size_t i = 0; i < n; i++)
#  116|-> 		fputwc(str[i], stream);
#  117|   }
#  118|   

Error: CPPCHECK_WARNING (CWE-476): [#def151]
util-linux-2.40.4/text-utils/ul.c:482: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#  480|   	int i, width;
#  481|   
#  482|-> 	while ((c = getwc(f)) != WEOF) {
#  483|   		switch (c) {
#  484|   		case '\b':

Error: CPPCHECK_WARNING (CWE-476): [#def152]
util-linux-2.40.4/text-utils/ul.c:639: warning[nullPointerOutOfResources]: If resource allocation fails, then there is a possible null pointer dereference: f
#  637|   				err(EXIT_FAILURE, _("cannot open %s"), argv[optind]);
#  638|   			filter(&ctl, &tcs, f);
#  639|-> 			fclose(f);
#  640|   		}
#  641|   	}

Scan Properties

analyzer-version-clippy1.86.0
analyzer-version-cppcheck2.17.1
analyzer-version-gcc15.0.1
analyzer-version-gcc-analyzer15.0.1
analyzer-version-shellcheck0.10.0
analyzer-version-unicontrol0.0.2
enabled-pluginsclippy, cppcheck, gcc, shellcheck, unicontrol
exit-code0
hostip-172-16-1-220.us-west-2.compute.internal
known-false-positives/usr/share/csmock/known-false-positives.js
known-false-positives-rpmknown-false-positives-0.0.0.20250425.124705.g1c7c448.main-1.el9.noarch
mock-configfedora-rawhide-x86_64
project-nameutil-linux-2.40.4-7.fc43
store-results-to/tmp/tmpgmeyevn9/util-linux-2.40.4-7.fc43.tar.xz
time-created2025-04-25 15:58:28
time-finished2025-04-25 16:04:44
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-rawhide-x86_64' '-t' 'unicontrol,cppcheck,gcc,clippy,shellcheck' '-o' '/tmp/tmpgmeyevn9/util-linux-2.40.4-7.fc43.tar.xz' '--gcc-analyze' '--unicontrol-notests' '--unicontrol-bidi-only' '--install' 'pam' '--gcc-analyzer-bin=/usr/bin/gcc' '/tmp/tmpgmeyevn9/util-linux-2.40.4-7.fc43.src.rpm'
tool-versioncsmock-3.8.1.20250422.172604.g26bc3d6-1.el9