Task #38841 - util-linux-2.42.start-1.20250219174606524537.pr3421.13.g27ef5bbab/scan-results.err
back to task #38841download
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c: scope_hint: In function ‘menu_set_title’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:954:1: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:68: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/debug.h:104:17: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_STRING’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:274:9: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_ENV’
util-linux-2.42.start-build/util-linux-2.42.start/include/debug.h:104:17: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_STRING’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:274:9: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_ENV’
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:60: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:270:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:2172:9: note: in expansion of macro ‘DBG’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:64: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:270:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:906:9: note: in expansion of macro ‘DBG’
# 952| }
# 953| m->title = str;
# 954|-> }
# 955|
# 956|
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c: scope_hint: In function ‘ui_create_label’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:2183:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc(fdisk_get_nlabels(*cf.cxt) + 1, 32)’
util-linux-2.42.start-build/util-linux-2.42.start/include/debug.h:104:17: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_STRING’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:274:9: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_ENV’
util-linux-2.42.start-build/util-linux-2.42.start/include/debug.h:104:17: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_STRING’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:274:9: note: in expansion of macro ‘__UL_INIT_DEBUG_FROM_ENV’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:270:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/cfdisk.c:2172:9: note: in expansion of macro ‘DBG’
# 2181| fdisk_label_get_type(lb) == FDISK_DISKLABEL_BSD)
# 2182| continue;
# 2183|-> cm[i++].name = fdisk_label_get_name(lb);
# 2184| }
# 2185|
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdformat.c: scope_hint: In function ‘verify_disk’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdformat.c:127:49: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xmalloc((long unsigned int)track_size)’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdformat.c:28: included_from: Included from here.
# 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-457):
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk-menu.c: scope_hint: In function ‘next_menu_entry’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk-menu.c:296:22: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘((unsigned char*)&*m)[8]’
util-linux-2.42.start-build/util-linux-2.42.start/include/pt-mbr.h:8: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk-menu.c:21: included_from: Included from here.
# 294| (m->label && (!lb || !(m->label & type))) ||
# 295| /* unwanted for nested PT */
# 296|-> (m->nonested && parent) ||
# 297| /* menu excluded for specified labels */
# 298| (m->exclude && lb && (m->exclude & type))) {
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk.c: scope_hint: In function ‘strtosize_sectors’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk.c:667:12: warning[-Wanalyzer-malloc-leak]: leak of ‘str’
# 665|
# 666| rc = strtosize(str, res);
# 667|-> if (rc)
# 668| return rc;
# 669|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fsck.c: scope_hint: In function ‘compile_fs_type’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fsck.c:995:28: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(fs_type)’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fsck.c:64: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fsck.c:58: included_from: Included from here.
# 993| s += 2;
# 994| negate = 1;
# 995|-> } else if (*s == '!') {
# 996| s++;
# 997| negate = 1;
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fsck.c:1005:28: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(fs_type)’
# 1003| s += 5;
# 1004| loop_special_case:
# 1005|-> cmp->type[num] = negate ? FS_TYPE_NEGOPT : FS_TYPE_OPT;
# 1006| } else {
# 1007| if (first_negate) {
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fsck.c:1011:44: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(fs_type)’
# 1009| first_negate = 0;
# 1010| }
# 1011|-> if ((negate && !cmp->negate) ||
# 1012| (!negate && cmp->negate)) {
# 1013| errx(FSCK_EX_USAGE,
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/mkfs.cramfs.c:305:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc(len + 257)’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
# 303| /* TODO: Reuse the parent's buffer to save memcpy'ing and duplication. */
# 304| path = xmalloc(len + 1 + MAX_INPUT_NAMELEN + 1);
# 305|-> memcpy(path, name, len);
# 306| endpath = path + len;
# 307| *endpath = '/';
Error: CPPCHECK_WARNING (CWE-190):
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/mkfs.cramfs.c:380: error[integerOverflow]: Signed integer overflow for expression '-(1<<24)'.
# 378| } else {
# 379| entry->size = st.st_rdev;
# 380|-> if (entry->size & -(1<<CRAMFS_SIZE_WIDTH))
# 381| warn_dev = 1;
# 382| }
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk.c:36: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/all-io.h: scope_hint: In function ‘read_all’
util-linux-2.42.start-build/util-linux-2.42.start/include/all-io.h:67:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘buf’ where non-null expected
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk.h:18: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk.c:47: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fdisk.c:35: included_from: Included from here.
<built-in>: note: argument 1 of ‘__builtin_memset’ must be non-null
# 65| int tries = 0;
# 66|
# 67|-> memset(buf, 0, count);
# 68| while (count > 0) {
# 69| ret = read(fd, buf, count);
Error: GCC_ANALYZER_WARNING (CWE-775):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/setpriv.c:35: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/all-io.h: scope_hint: In function ‘do_seccomp_filter’
util-linux-2.42.start-build/util-linux-2.42.start/include/all-io.h:97:23: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(file, 0)’
# 95|
# 96| while (1) {
# 97|-> ret = read_all(fd, *buf + c, size - c);
# 98| if (ret < 0) {
# 99| free(*buf);
Error: GCC_ANALYZER_WARNING (CWE-416):
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:53:19: warning[-Wanalyzer-use-after-free]: use after 'free' of 'child'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/line.c: scope_hint: In function 'scols_line_add_child'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/smartcolsP.h:19: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/smartcolsP.h:42:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/line.c:247:9: note: in expansion of macro 'DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/smartcolsP.h:42:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/line.c:223:9: note: in expansion of macro 'DBG'
# 51| {
# 52| next->prev = add;
# 53|-> add->next = next;
# 54| add->prev = prev;
# 55| prev->next = add;
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:55:20: warning[-Wanalyzer-malloc-leak]: leak of ‘new_counter_spec(optarg)’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.h:41: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:58: included_from: Included from here.
# 53| add->next = next;
# 54| add->prev = prev;
# 55|-> prev->next = add;
# 56| }
# 57|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:55:20: warning[-Wanalyzer-malloc-leak]: leak of ‘new_miscdev(minor, & name)’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/cdev.c: scope_hint: In function ‘read_misc’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.h:41: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:15: included_from: Included from here.
# 53| add->next = next;
# 54| add->prev = prev;
# 55|-> prev->next = add;
# 56| }
# 57|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:55:20: warning[-Wanalyzer-malloc-leak]: leak of ‘new_nodev(minor, filesystem)’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c: scope_hint: In function ‘add_nodev’
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:48: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:910:13: note: in expansion of macro ‘is_association’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:910:13: note: in expansion of macro ‘is_association’
# 53| add->next = next;
# 54| add->prev = prev;
# 55|-> prev->next = add;
# 56| }
# 57|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:55:20: warning[-Wanalyzer-malloc-leak]: leak of ‘new_partition(__dev, & name)’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/bdev.c: scope_hint: In function ‘read_partitions’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.h:41: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:15: included_from: Included from here.
# 53| add->next = next;
# 54| add->prev = prev;
# 55|-> prev->next = add;
# 56| }
# 57|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:55:20: warning[-Wanalyzer-malloc-leak]: leak of ‘parse_block(optarg, 25, & ioctls, 1)’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/enosys.c: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/enosys.c:35: included_from: Included from here.
# 53| add->next = next;
# 54| add->prev = prev;
# 55|-> prev->next = add;
# 56| }
# 57|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:55:20: warning[-Wanalyzer-malloc-leak]: leak of ‘read_ttydrv(&line)’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/cdev.c: scope_hint: In function ‘read_tty_drivers’
# 53| add->next = next;
# 54| add->prev = prev;
# 55|-> prev->next = add;
# 56| }
# 57|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:55:20: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 24)’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/kill.c: scope_hint: In function ‘parse_arguments’
# 53| add->next = next;
# 54| add->prev = prev;
# 55|-> prev->next = add;
# 56| }
# 57|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:55:20: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 32)’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/logger.c: scope_hint: In function ‘add_structured_data_id’
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/all-io.h:20: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/logger.c:57: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/logger.c: scope_hint: In function ‘add_structured_data_id’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/logger.c:63: included_from: Included from here.
# 53| add->next = next;
# 54| add->prev = prev;
# 55|-> prev->next = add;
# 56| }
# 57|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:55:20: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 48)’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/prlimit.c: scope_hint: In function ‘add_prlim’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/prlimit.c:28: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h: scope_hint: In function ‘add_prlim’
# 53| add->next = next;
# 54| add->prev = prev;
# 55|-> prev->next = add;
# 56| }
# 57|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:55:20: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 56)’
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/hexdump-parse.c: scope_hint: In function ‘color_fmt’
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/hexdump-parse.c:46: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/hexdump.h:38: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:18: included_from: Included from here.
# 53| add->next = next;
# 54| add->prev = prev;
# 55|-> prev->next = add;
# 56| }
# 57|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:55:20: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(24)’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsclocks.c: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsclocks.c:38: included_from: Included from here.
# 53| add->next = next;
# 54| add->prev = prev;
# 55|-> prev->next = add;
# 56| }
# 57|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:55:20: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(32)’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/unkn.c: scope_hint: In function ‘add_inode’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.h:41: included_from: Included from here.
# 53| add->next = next;
# 54| add->prev = prev;
# 55|-> prev->next = add;
# 56| }
# 57|
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:81:9: warning[-Wanalyzer-null-dereference]: dereference of NULL 'cxt'
util-linux-2.42.start-build/util-linux-2.42.start/libfdisk/src/wipe.c: scope_hint: In function 'fdisk_set_wipe_area'
util-linux-2.42.start-build/util-linux-2.42.start/libfdisk/src/fdiskP.h:26: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libfdisk/src/fdiskP.h:48:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libfdisk/src/wipe.c:90:9: note: in expansion of macro 'DBG'
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/smartcolsP.h:15: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/calculate.c:1: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h: scope_hint: In function 'merge_and_restore_back_links'
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:311:34: warning[-Wanalyzer-null-dereference]: dereference of NULL 'list'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/smartcolsP.h:19: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/smartcolsP.h:42:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/calculate.c:501:25: note: in expansion of macro 'DBG'
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h: scope_hint: In function 'merge_and_restore_back_links'
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/partx.c:37: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/strutils.h: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/include/strutils.h:274:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(*<unknown>)’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/partx.c:38: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/partx.c:33: included_from: Included from here.
# 272| size_t sz = prefix ? strlen(prefix) : 0;
# 273|
# 274|-> if (s && sz && strncmp(s, prefix, sz) == 0)
# 275| return s + sz;
# 276| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/uuidgen.c:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘unhex’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((*valuelen >> 1) + 1)’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/mkswap.c:50: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘check_blocks’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc((long unsigned int)*ctl.pagesize)’
util-linux-2.42.start-build/util-linux-2.42.start/include/optutils.h:8: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/mkswap.c:54: included_from: Included from here.
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/setpriv-landlock.c:19: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘parse_landlock_rule’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(32)’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/setpriv-landlock.c:18: included_from: Included from here.
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fsck.cramfs.c:70: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘test_crc’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(4096)’
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/fsck.cramfs.c:58: included_from: Included from here.
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/disk-utils/mkfs.cramfs.c:61: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘parse_directory’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(len + 257)’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/readprofile.c:50: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xmalloc(len)’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘color_fmt’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:34:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrndup(a, (long unsigned int)(p2 - a))’
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/hexdump-parse.c:238:9: note: in expansion of macro ‘list_for_each’
/usr/include/libintl.h:100: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/nls.h:27: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/hexdump-parse.c:45: included_from: Included from here.
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/irq-common.c:31: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘xreallocarray’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:56:21: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/irq-common.c: scope_hint: In function ‘xreallocarray’
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/irq-common.c:27: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/irq-common.c:30: included_from: Included from here.
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/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))’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘parse_pids(n_pids, argv + (long unsigned int)parse_options(argc, argv) * 8)’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/lslogins.c:57: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 112)’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/lslogins.c:1636:9: note: in expansion of macro ‘add_column’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/lslogins.c: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/lslogins.c:1636:9: note: in expansion of macro ‘add_column’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/lslogins.c:1637:9: note: in expansion of macro ‘add_column’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/lslogins.c: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/lslogins.c:1637:9: note: in expansion of macro ‘add_column’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/lscpu.h:20: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/lscpu.c:37: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 224)’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/lscpu.c: scope_hint: In function ‘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):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/kill.c:64: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘parse_arguments’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 24)’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.h:41: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/sock-xinfo.c:48: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘tcp_xinfo_scan_line’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 72)’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/sock-xinfo.c: scope_hint: In function ‘tcp_xinfo_scan_line’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/sock-xinfo.c: scope_hint: In function ‘tcp_xinfo_scan_line’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/sock-xinfo.c: scope_hint: In function ‘tcp_xinfo_scan_line’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/lsipc.c:42: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 8)’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/waitpid.c:34: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘open_pidfds’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:70:13: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(n_pids, 4)’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:21: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/strutils.h:53:64: note: in definition of macro ‘strtopid_or_err’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/waitpid.c:54:55: note: in expansion of macro ‘_’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/term-utils/wall.c:70: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h: scope_hint: In function ‘xgethostname’
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:188:13: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc(sz)’ where non-null expected
/usr/include/bits/sigstksz.h:24: included_from: Included from here.
/usr/include/signal.h:328: included_from: Included from here.
/usr/include/sys/param.h:28: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/term-utils/wall.c:45: included_from: Included from here.
/usr/include/unistd.h:911:12: note: argument 1 of ‘gethostname’ must be non-null
# 186|
# 187| name = xmalloc(sizeof(char) * sz);
# 188|-> if (gethostname(name, sz) != 0) {
# 189| free(name);
# 190| return NULL;
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/lib/colors.c: scope_hint: In function 'colors_add_scheme'
util-linux-2.42.start-build/util-linux-2.42.start/lib/colors.c:392:12: warning[-Wanalyzer-malloc-leak]: leak of 'strdup(name)'
util-linux-2.42.start-build/util-linux-2.42.start/lib/colors.c:38: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/lib/colors.c:60:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/lib/colors.c:507:9: note: in expansion of macro 'DBG'
util-linux-2.42.start-build/util-linux-2.42.start/lib/colors.c:60:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/lib/colors.c:371:9: note: in expansion of macro 'DBG'
# 390| cs->seq = seq;
# 391| cs->name = strdup(name);
# 392|-> if (!cs->name)
# 393| goto err;
# 394|
Error: GCC_ANALYZER_WARNING:
util-linux-2.42.start-build/util-linux-2.42.start/lib/pager.c: scope_hint: In function ‘pager_close’
util-linux-2.42.start-build/util-linux-2.42.start/lib/pager.c:305:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
util-linux-2.42.start-build/util-linux-2.42.start/lib/pager.c: scope_hint: In function ‘pager_close’
util-linux-2.42.start-build/util-linux-2.42.start/lib/pager.c: scope_hint: In function ‘pager_close’
# 303|
# 304| /* restore original output */
# 305|-> dup2(pager_process.org_out, STDOUT_FILENO);
# 306| dup2(pager_process.org_err, STDERR_FILENO);
# 307|
Error: GCC_ANALYZER_WARNING:
util-linux-2.42.start-build/util-linux-2.42.start/lib/pager.c:306:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘2’
util-linux-2.42.start-build/util-linux-2.42.start/lib/pager.c: scope_hint: In function ‘pager_close’
util-linux-2.42.start-build/util-linux-2.42.start/lib/pager.c: scope_hint: In function ‘pager_close’
# 304| /* restore original output */
# 305| dup2(pager_process.org_out, STDOUT_FILENO);
# 306|-> dup2(pager_process.org_err, STDERR_FILENO);
# 307|
# 308| close(pager_process.org_out);
Error: GCC_ANALYZER_WARNING (CWE-457):
util-linux-2.42.start-build/util-linux-2.42.start/lib/path.c: scope_hint: In function 'ul_path_read_buffer'
util-linux-2.42.start-build/util-linux-2.42.start/lib/path.c:695:21: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value '*<unknown>'
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/lib/path.c:24: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/lib/path.c:28: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/lib/path.c:40:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/lib/path.c:417:17: note: in expansion of macro 'DBG'
util-linux-2.42.start-build/util-linux-2.42.start/lib/path.c:22: included_from: Included from here.
# 693| else if (rc > 0) {
# 694| /* Remove trailing newline (usual in sysfs) */
# 695|-> if (*(buf + rc - 1) == '\n')
# 696| buf[--rc] = '\0';
# 697| else
Error: GCC_ANALYZER_WARNING (CWE-775):
util-linux-2.42.start-build/util-linux-2.42.start/lib/randutils.c: scope_hint: In function 'ul_random_get_bytes'
util-linux-2.42.start-build/util-linux-2.42.start/lib/randutils.c:138:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'random_get_fd()'
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:18: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/lib/randutils.c:19: included_from: Included from here.
# 136|
# 137| lose_counter = 0;
# 138|-> if (fd >= 0) {
# 139| while (n > 0) {
# 140| ssize_t x = read(fd, cp, n);
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/lib/strutils.c: scope_hint: In function 'isdigit_strend'
util-linux-2.42.start-build/util-linux-2.42.start/lib/strutils.c:234:33: warning[-Wanalyzer-null-dereference]: dereference of NULL 'p'
# 232| if (end)
# 233| *end = p;
# 234|-> return p && p > str && !*p;
# 235| }
# 236|
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/lib/strutils.c: scope_hint: In function ‘isdigit_strend’
util-linux-2.42.start-build/util-linux-2.42.start/lib/strutils.c:234:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
# 232| if (end)
# 233| *end = p;
# 234|-> return p && p > str && !*p;
# 235| }
# 236|
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/lib/strutils.c: scope_hint: In function 'isxdigit_strend'
util-linux-2.42.start-build/util-linux-2.42.start/lib/strutils.c:246:33: warning[-Wanalyzer-null-dereference]: dereference of NULL 'p'
# 244| *end = p;
# 245|
# 246|-> return p && p > str && !*p;
# 247| }
# 248|
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/lib/strutils.c: scope_hint: In function ‘isxdigit_strend’
util-linux-2.42.start-build/util-linux-2.42.start/lib/strutils.c:246:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p’
# 244| *end = p;
# 245|
# 246|-> return p && p > str && !*p;
# 247| }
# 248|
Error: GCC_ANALYZER_WARNING (CWE-416):
util-linux-2.42.start-build/util-linux-2.42.start/libblkid/src/partitions/partitions.c: scope_hint: In function 'unref_parttable'
util-linux-2.42.start-build/util-linux-2.42.start/libblkid/src/partitions/partitions.c:330:12: warning[-Wanalyzer-use-after-free]: use after 'free' of 'tab'
util-linux-2.42.start-build/util-linux-2.42.start/libblkid/src/partitions/partitions.c: scope_hint: In function 'unref_parttable'
util-linux-2.42.start-build/util-linux-2.42.start/libblkid/src/blkidP.h:30: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libblkid/src/partitions/partitions.h:4: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libblkid/src/partitions/partitions.c:23: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:176:41: note: in expansion of macro 'container_of'
util-linux-2.42.start-build/util-linux-2.42.start/libblkid/src/partitions/partitions.c:345:39: note: in expansion of macro 'list_entry'
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:176:41: note: in expansion of macro 'container_of'
util-linux-2.42.start-build/util-linux-2.42.start/libblkid/src/partitions/partitions.c:345:39: note: in expansion of macro 'list_entry'
# 328| return;
# 329|
# 330|-> tab->nparts--;
# 331| if (tab->nparts <= 0) {
# 332| list_del(&tab->t_tabs);
Error: GCC_ANALYZER_WARNING (CWE-775):
util-linux-2.42.start-build/util-linux-2.42.start/libblkid/src/topology/dm.c: scope_hint: In function 'probe_dm_tp'
util-linux-2.42.start-build/util-linux-2.42.start/libblkid/src/topology/dm.c:118:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'dmpipe[0]'
# 116|
# 117| fclose(stream);
# 118|-> return 0;
# 119|
# 120| nothing:
Error: GCC_ANALYZER_WARNING (CWE-775):
util-linux-2.42.start-build/util-linux-2.42.start/libblkid/src/topology/dm.c:118:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'dmpipe[1]'
# 116|
# 117| fclose(stream);
# 118|-> return 0;
# 119|
# 120| nothing:
Error: GCC_ANALYZER_WARNING (CWE-775):
util-linux-2.42.start-build/util-linux-2.42.start/libblkid/src/topology/lvm.c: scope_hint: In function 'probe_lvm_tp'
util-linux-2.42.start-build/util-linux-2.42.start/libblkid/src/topology/lvm.c:125:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'lvpipe[0]'
# 123| fclose(stream);
# 124| close(lvpipe[1]);
# 125|-> return 0;
# 126|
# 127| nothing:
Error: GCC_ANALYZER_WARNING (CWE-775):
util-linux-2.42.start-build/util-linux-2.42.start/libblkid/src/topology/lvm.c:125:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'lvpipe[1]'
# 123| fclose(stream);
# 124| close(lvpipe[1]);
# 125|-> return 0;
# 126|
# 127| nothing:
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/hook_idmap.c: scope_hint: In function 'hook_prepare_options'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/hook_idmap.c:465:25: warning[-Wanalyzer-malloc-leak]: leak of 'idmap'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/mountP.h:31: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/hook_idmap.c:28: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:39:24: note: in definition of macro 'INIT_LIST_HEAD'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/hook_idmap.c:24: included_from: Included from here.
# 463| goto err;
# 464|
# 465|-> idmap = calloc(1, sizeof(*idmap));
# 466| if (!idmap)
# 467| goto err;
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/tab.c: scope_hint: In function 'mnt_table_find_target'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/tab.c:1196:24: warning[-Wanalyzer-null-dereference]: dereference of NULL 'fs'
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/mountP.h:29: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/tab.c:52: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/mountP.h:32: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/mountP.h:63:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/tab.c:1775:9: note: in expansion of macro 'DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/mountP.h:63:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/tab.c:1781:17: note: in expansion of macro 'DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/mountP.h:63:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/tab.c:1100:9: note: in expansion of macro 'DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/mountP.h:63:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/tab.c:1154:9: note: in expansion of macro 'DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/mountP.h:63:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/tab.c:1179:9: note: in expansion of macro 'DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/mountP.h:189:28: note: in expansion of macro 'IS_ITER_FORWARD'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/tab.c:868:17: note: in expansion of macro 'MNT_ITER_INIT'
# 1194| char *p;
# 1195|
# 1196|-> if (!fs->target
# 1197| || mnt_fs_is_swaparea(fs)
# 1198| || mnt_fs_is_kernel(fs)
Error: GCC_ANALYZER_WARNING (CWE-416):
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/utils.c: scope_hint: In function 'mnt_free_filesystems.part.0'
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/utils.c:574:31: warning[-Wanalyzer-use-after-free]: use after 'reallocarray' of 'p'
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/strutils.h:19: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libmount/src/utils.c:24: included_from: Included from here.
# 572| if (!filesystems)
# 573| return;
# 574|-> for (p = filesystems; *p; p++)
# 575| free(*p);
# 576| free(filesystems);
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c: scope_hint: In function 'yyparse'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:393:21: warning[-Wanalyzer-malloc-leak]: leak of 'yyptr'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:95:40: note: in definition of macro 'YY_CAST'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:379:25: note: in expansion of macro 'YYMALLOC'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:1285:20: note: in expansion of macro 'YYSTACK_ALLOC'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:1355:17: note: in expansion of macro 'YYTRANSLATE'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:95:40: note: in definition of macro 'YY_CAST'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:379:25: note: in expansion of macro 'YYMALLOC'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:1285:20: note: in expansion of macro 'YYSTACK_ALLOC'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:438:9: note: in expansion of macro 'YYCOPY'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:1288:9: note: in expansion of macro 'YYSTACK_RELOCATE'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:95:40: note: in definition of macro 'YY_CAST'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:379:25: note: in expansion of macro 'YYMALLOC'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:1285:20: note: in expansion of macro 'YYSTACK_ALLOC'
# 391| # endif
# 392| # ifndef YYMALLOC
# 393|-> # define YYMALLOC malloc
# 394| # if ! defined malloc && ! defined EXIT_SUCCESS
# 395| void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
Error: GCC_ANALYZER_WARNING (CWE-457):
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:453:7: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value 'yyss'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:438:9: note: in expansion of macro 'YYCOPY'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:1288:9: note: in expansion of macro 'YYSTACK_RELOCATE'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:438:9: note: in expansion of macro 'YYCOPY'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:1288:9: note: in expansion of macro 'YYSTACK_RELOCATE'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:438:9: note: in expansion of macro 'YYCOPY'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-parser.c:1288:9: note: in expansion of macro 'YYSTACK_RELOCATE'
# 451| # if defined __GNUC__ && 1 < __GNUC__
# 452| # define YYCOPY(Dst, Src, Count) \
# 453|-> __builtin_memcpy (Dst, Src, YY_CAST (YYSIZE_T, (Count)) * sizeof (*(Src)))
# 454| # else
# 455| # define YYCOPY(Dst, Src, Count) \
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-scanner.c: scope_hint: In function 'yy_create_buffer'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-scanner.c:1484:12: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(64)'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-scanner.c: scope_hint: In function 'yy_create_buffer'
# 1482| * we need to put in 2 end-of-buffer characters.
# 1483| */
# 1484|-> b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 1485| if ( ! b->yy_ch_buf )
# 1486| YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-scanner.c: scope_hint: In function 'yy_create_buffer'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-scanner.c:1484:12: warning[-Wanalyzer-malloc-leak]: leak of 'yyalloc(64, yyscanner)'
# 1482| * we need to put in 2 end-of-buffer characters.
# 1483| */
# 1484|-> b->yy_ch_buf = (char *) yyalloc( (yy_size_t) (b->yy_buf_size + 2) , yyscanner );
# 1485| if ( ! b->yy_ch_buf )
# 1486| YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-scanner.c: scope_hint: In function 'yy_init_buffer'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-scanner.c:1526:19: warning[-Wanalyzer-null-dereference]: dereference of NULL 'b'
# 1524|
# 1525| yy_flush_buffer( b , yyscanner);
# 1526|->
# 1527| b->yy_input_file = file;
# 1528| b->yy_fill_buffer = 1;
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-scanner.c: scope_hint: In function 'yy_scan_buffer'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-scanner.c:1744:25: warning[-Wanalyzer-malloc-leak]: leak of 'malloc(n)'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-scanner.c: scope_hint: In function 'yy_scan_buffer'
# 1742| for ( i = 0; i < _yybytes_len; ++i )
# 1743| buf[i] = yybytes[i];
# 1744|->
# 1745| buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 1746|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-scanner.c: scope_hint: In function 'yy_scan_buffer'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/filter-scanner.c:1744:25: warning[-Wanalyzer-malloc-leak]: leak of 'yyalloc(n, yyscanner)'
# 1742| for ( i = 0; i < _yybytes_len; ++i )
# 1743| buf[i] = yybytes[i];
# 1744|->
# 1745| buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
# 1746|
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/print.c: scope_hint: In function 'print_json_data'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/print.c:544:71: warning[-Wanalyzer-null-dereference]: dereference of NULL 'data'
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/smartcolsP.h:14: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/print.c:26: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/smartcolsP.h:19: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/smartcolsP.h:42:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/print.c:873:9: note: in expansion of macro 'DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/smartcolsP.h:42:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/print.c:855:9: note: in expansion of macro 'DBG'
# 542| case SCOLS_JSON_BOOLEAN_OPTIONAL:
# 543| /* name: true|false|null */
# 544|-> if (cl->json_type == SCOLS_JSON_BOOLEAN_OPTIONAL && (!*data || !strcmp(data, "-"))) {
# 545| ul_jsonwrt_value_null(&tb->json, name);
# 546| } else {
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/print.c:548:42: warning[-Wanalyzer-null-dereference]: dereference of NULL 'data'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/smartcolsP.h:42:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/print.c:873:9: note: in expansion of macro 'DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/smartcolsP.h:42:25: note: in expansion of macro '__UL_DBG'
util-linux-2.42.start-build/util-linux-2.42.start/libsmartcols/src/print.c:855:9: note: in expansion of macro 'DBG'
# 546| } else {
# 547| ul_jsonwrt_value_boolean(&tb->json, name,
# 548|-> !*data ? 0 :
# 549| *data == '0' ? 0 :
# 550| *data == 'N' || *data == 'n' ? 0 : 1);
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/chfn.c: scope_hint: In function ‘parse_passwd’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/chfn.c:215:1: warning[-Wanalyzer-malloc-leak]: leak of ‘gecos’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/chfn.c:42: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/chfn.c:35: included_from: Included from here.
# 213| * not be changed by this version of chfn. */
# 214| ctl->oldf.other = strsep(&gecos, ",");
# 215|-> }
# 216|
# 217| /*
Error: GCC_ANALYZER_WARNING (CWE-775):
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/last.c: scope_hint: In function ‘process_wtmp_file’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/last.c:196:18: warning[-Wanalyzer-file-leak]: leak of FILE ‘fopen(filename, "r")’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/last.c:49: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/optutils.h:8: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/last.c:47: included_from: Included from here.
# 194| off_t o;
# 195|
# 196|-> if (quit == NULL && u != NULL) {
# 197| /*
# 198| * Normal read.
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/last.c:196:18: warning[-Wanalyzer-malloc-leak]: leak of ‘fopen(filename, "r")’
# 194| off_t o;
# 195|
# 196|-> if (quit == NULL && u != NULL) {
# 197| /*
# 198| * Normal read.
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/last.c: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/last.c:1042:41: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘files’
# 1040| if (!files)
# 1041| files = xmalloc(sizeof(char *) * argc);
# 1042|-> files[nfiles++] = xstrdup(optarg);
# 1043| break;
# 1044| case 'd':
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/login.c: scope_hint: In function ‘process_title_init’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/login.c:239:28: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘environ’
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/path.h:14: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/login.c:49: included_from: Included from here.
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/login.c:240:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘environ’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/login.c: scope_hint: In function ‘open_tty’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/login.c:455:17: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘i’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/login.c:36: included_from: Included from here.
# 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:
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/login.c:458:25: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘i’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/lslogins.c: scope_hint: In function ‘parse_utmpx.part.0’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/lslogins.c:521:24: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘ary’
# 519| if (i == imax)
# 520| ary = xreallocarray(ary, imax *= 2, sizeof(struct utmpx));
# 521|-> ary[i] = *u;
# 522| }
# 523|
Error: GCC_ANALYZER_WARNING:
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/sulogin.c: scope_hint: In function ‘setup’
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/sulogin.c:726:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘0’
# 724| }
# 725| notty:
# 726|-> dup2(fd, STDIN_FILENO);
# 727| dup2(fd, STDOUT_FILENO);
# 728| dup2(fd, STDERR_FILENO);
Error: GCC_ANALYZER_WARNING:
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/sulogin.c:727:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
# 725| notty:
# 726| dup2(fd, STDIN_FILENO);
# 727|-> dup2(fd, STDOUT_FILENO);
# 728| dup2(fd, STDERR_FILENO);
# 729| con->fd = STDIN_FILENO;
Error: GCC_ANALYZER_WARNING:
util-linux-2.42.start-build/util-linux-2.42.start/login-utils/sulogin.c:728:9: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘2’
# 726| dup2(fd, STDIN_FILENO);
# 727| dup2(fd, STDOUT_FILENO);
# 728|-> dup2(fd, STDERR_FILENO);
# 729| con->fd = STDIN_FILENO;
# 730|
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c: scope_hint: In function ‘new_file’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:730:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xcalloc(1, *class.size)’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:884:26: note: in expansion of macro ‘list_last_entry’
# 728| assert(class);
# 729| file = xcalloc(1, class->size);
# 730|-> file->class = class;
# 731|
# 732| file->proc = proc;
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c: scope_hint: In function ‘new_readlink_error_file’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:749:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xcalloc(1, readlink_error_class.size)’
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:18: included_from: Included from here.
# 747|
# 748| file = xcalloc(1, readlink_error_class.size);
# 749|-> file->class = &readlink_error_class;
# 750|
# 751| file->proc = proc;
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c: scope_hint: In function ‘new_stat_error_file’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:769:21: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xcalloc(1, stat_error_class.size)’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:884:26: note: in expansion of macro ‘list_last_entry’
# 767|
# 768| file = xcalloc(1, stat_error_class.size);
# 769|-> file->class = &stat_error_class;
# 770|
# 771| file->proc = proc;
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c: scope_hint: In function ‘copy_file’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:789:20: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xcalloc(1, *old_9(D)->class.size)’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:884:26: note: in expansion of macro ‘list_last_entry’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:884:26: note: in expansion of macro ‘list_last_entry’
# 787|
# 788| INIT_LIST_HEAD(&file->files);
# 789|-> file->proc = old->proc;
# 790| list_add_tail(&file->files, &old->proc->files);
# 791|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c: scope_hint: In function ‘reset_cooked_bdev’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:1136:1: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(filesystem)’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:910:13: note: in expansion of macro ‘is_association’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:910:13: note: in expansion of macro ‘is_association’
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:29: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:1167:9: note: in expansion of macro ‘list_for_each’
# 1134| free(bdev->filesystem);
# 1135| bdev->filesystem = xstrdup(filesystem);
# 1136|-> }
# 1137|
# 1138| static struct cooked_bdev *new_cooked_bdev(dev_t cooked, dev_t raw, const char *filesystem)
Error: GCC_ANALYZER_WARNING (CWE-416):
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c: scope_hint: In function ‘add_nodevs_from_cooked_bdevs’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:1327:31: warning[-Wanalyzer-use-after-free]: use after ‘free’ of ‘n’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:910:13: note: in expansion of macro ‘is_association’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:910:13: note: in expansion of macro ‘is_association’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:1183:9: note: in expansion of macro ‘list_for_each_safe’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:1183:9: note: in expansion of macro ‘list_for_each_safe’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c: scope_hint: In function ‘add_nodevs_from_cooked_bdevs’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:1324:9: note: in expansion of macro ‘list_for_each’
# 1325| struct cooked_bdev *bdev = list_entry(n, struct cooked_bdev,
# 1326| cooked_bdevs);
# 1327|-> if (major(bdev->cooked) == 0
# 1328| && get_nodev_filesystem(minor(bdev->cooked)) == NULL)
# 1329| add_nodev(minor(bdev->cooked), bdev->filesystem);
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:2092:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 2090| && (isspace((unsigned char)*next) || *next == ','))
# 2091| next++;
# 2092|-> if (*next != '\0')
# 2093| parse_pids(next, pids, count);
# 2094| }
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c: scope_hint: In function ‘parse_pids’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.c:2092:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘outarg’
# 2090| && (isspace((unsigned char)*next) || *next == ','))
# 2091| next++;
# 2092|-> if (*next != '\0')
# 2093| parse_pids(next, pids, count);
# 2094| }
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/sock-xinfo.c: scope_hint: In function ‘load_xinfo_from_proc_unix’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/sock-xinfo.c:748:17: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 152)’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.h:35: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.h:52:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/sock-xinfo.c:733:17: note: in expansion of macro ‘DBG’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.h:40: included_from: Included from here.
# 746|
# 747| DBG(ENDPOINTS, ul_debug(" path: %s", ux->path));
# 748|-> add_sock_info(&ux->sock);
# 749| }
# 750|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/sock-xinfo.c: scope_hint: In function ‘load_xinfo_from_proc_netlink’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/sock-xinfo.c:1987:17: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 40)’
# 1985| nl->groups = groups;
# 1986|
# 1987|-> add_sock_info(&nl->sock);
# 1988| }
# 1989|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/sock-xinfo.c: scope_hint: In function ‘load_xinfo_from_proc_packet’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/sock-xinfo.c:2389:17: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 32)’
# 2387| pkt->iface = iface;
# 2388|
# 2389|-> add_sock_info(&pkt->sock);
# 2390| }
# 2391|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/sock-xinfo.c: scope_hint: In function ‘handle_diag_vsock’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/sock-xinfo.c:2593:9: warning[-Wanalyzer-malloc-leak]: leak of ‘xcalloc(1, 48)’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/lsfd.h:52:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start-build/util-linux-2.42.start/lsfd-cmd/sock-xinfo.c:2562:9: note: in expansion of macro ‘DBG’
# 2591| vx->remote.port = diag->vdiag_dst_port;
# 2592|
# 2593|-> add_sock_info(xinfo);
# 2594| return true;
# 2595| }
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/blkid.c: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/blkid.c:889:43: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc((long unsigned int)(argc - optind), 8)’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/blkid.c:49: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/blkid.c:18: included_from: Included from here.
# 887| continue;
# 888|
# 889|-> devices[numdev++] = dev;
# 890| }
# 891|
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/cal.c: scope_hint: In function ‘monthly’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/cal.c:1085:28: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc((long unsigned int)*ctl.months_in_row, 208)’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/cal.c:79: included_from: Included from here.
# 1083|
# 1084| for (i = 0; i < ctl->months_in_row - 1; i++)
# 1085|-> ms[i].next = &ms[i + 1];
# 1086|
# 1087| rows = (ctl->num_months - 1) / ctl->months_in_row;
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/enosys.c: scope_hint: In function ‘parse_block’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/enosys.c:151:16: warning[-Wanalyzer-malloc-leak]: leak of ‘name’
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/enosys.c:29: included_from: Included from here.
# 149| free((char *)name);
# 150|
# 151|-> return blocked;
# 152| }
# 153|
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/enosys.c: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/enosys.c:187:28: warning[-Wanalyzer-malloc-leak]: leak of ‘parse_block(optarg, 38, & syscalls, 379)’
# 185| blocked = parse_block(optarg, ENOSYS, syscalls, ARRAY_SIZE(syscalls));
# 186| list_add(&blocked->head, &blocked_syscalls);
# 187|-> if (blocked->number == __NR_execve)
# 188| blocking_execve = true;
# 189|
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/getopt.c: scope_hint: In function ‘print_normalized.part.0’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/getopt.c:133:24: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xmalloc(strlen(arg) * 4 + 3)’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/getopt.c:74: included_from: Included from here.
# 131| bufptr = buf;
# 132|
# 133|-> for (*bufptr++ = '\''; *argptr; argptr++) {
# 134| if (ctl->shell == TCSH) {
# 135| switch (*argptr) {
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/getopt.c: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/getopt.c:418:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘ctl.optstr’ where non-null expected
<built-in>: note: 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):
util-linux-2.42.start-build/util-linux-2.42.start/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):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/hardlink.c: scope_hint: In function ‘get_sorted_xattr_name_table’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/hardlink.c:529:26: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc((long unsigned int)n, 8)’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/hardlink.c: scope_hint: In function ‘get_sorted_xattr_name_table’
util-linux-2.42.start-build/util-linux-2.42.start/include/optutils.h:8: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/hardlink.c:58: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/hardlink.c:55: included_from: Included from here.
# 527|
# 528| for (i = 0; i < n; i++) {
# 529|-> table[i] = names;
# 530| names += strlen(names) + 1;
# 531| }
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/hardlink.c:533:9: warning[-Wanalyzer-null-argument]: use of NULL ‘xcalloc((long unsigned int)n, 8)’ where non-null expected
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/hardlink.c: scope_hint: In function ‘get_sorted_xattr_name_table’
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:16: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/hardlink.c:54: included_from: Included from here.
/usr/include/stdlib.h:970:13: note: argument 1 of ‘qsort’ must be non-null
# 531| }
# 532|
# 533|-> qsort(table, n, sizeof(char *), cmp_xattr_name_ptrs);
# 534|
# 535| return table;
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/kill.c: scope_hint: In function ‘parse_arguments’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/kill.c:372:30: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 370| if (!strncmp(arg, "--list=", 7) || !strncmp(arg, "-l=", 3)) {
# 371| char *p = strchr(arg, '=') + 1;
# 372|-> if (p[0] == '0' && p[1] == 'x') {
# 373| uint64_t sigmask;
# 374| if (ul_strtou64(p + 2, &sigmask, 16) < 0)
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/look.c: scope_hint: In function ‘compare’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/look.c:337:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/look.c:61: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/look.c:57: included_from: Included from here.
# 335| if (!dflag || isalnum(*s2) || isblank(*s2))
# 336| {
# 337|-> *p++ = *s2;
# 338| i--;
# 339| }
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/look.c:342:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘p’
# 340| s2++;
# 341| }
# 342|-> *p = 0;
# 343|
# 344| /* and compare */
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsblk.h:18: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsblk-devtree.c:19: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsblk-devtree.c: scope_hint: In function ‘cmp_devices_devno’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsblk-devtree.c:536:47: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘a’
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:174:29: note: in definition of macro ‘cmp_numbers’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsblk.h:19: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:174:29: note: in definition of macro ‘cmp_numbers’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsblk-properties.c: scope_hint: In function ‘lookup.part.0’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsblk-properties.c:201:16: warning[-Wanalyzer-malloc-leak]: leak of ‘*prop.label’
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsblk-properties.c:8: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsblk.h:20: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsblk-properties.c:15: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsblk.h:30:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsblk-properties.c:219:9: note: in expansion of macro ‘DBG’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsblk-properties.c: scope_hint: In function ‘lookup.part.0’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lsblk-properties.c:9: included_from: Included from here.
# 199| *p = '\0';
# 200|
# 201|-> *value = xstrdup(v);
# 202| return 1;
# 203| }
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lslocks.c: scope_hint: In function ‘is_holder’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lslocks.c:304:17: warning[-Wanalyzer-null-argument]: use of NULL where non-null expected
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lslocks.c:46: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lslocks.c:938:9: note: in expansion of macro ‘INIT_LIST_HEAD’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lslocks.c:43: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/list.h:190:21: note: in definition of macro ‘list_for_each’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lslocks.c:317:9: note: in expansion of macro ‘list_for_each’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/lslocks.c:26: included_from: Included from here.
/usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/mcookie.c: scope_hint: In function ‘randomness_from_files’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/mcookie.c:118:35: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
# 116| int fd;
# 117|
# 118|-> if (*fname == '-' && !*(fname + 1))
# 119| fd = STDIN_FILENO;
# 120| else
Error: GCC_ANALYZER_WARNING (CWE-775):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/mcookie.c:137:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
# 135| }
# 136| }
# 137|-> }
# 138|
# 139| int main(int argc, char **argv)
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/mcookie.c: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/mcookie.c:169:49: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘ctl.files’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/mcookie.c:31: included_from: Included from here.
# 167| if (!ctl.files)
# 168| ctl.files = xmalloc(sizeof(char *) * argc);
# 169|-> ctl.files[ctl.nfiles++] = optarg;
# 170| break;
# 171| case 'm':
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c: scope_hint: In function ‘readlink_to_namei’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c:115:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc((long unsigned int)(sz + 1))’ where non-null expected
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c:39: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c:38: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c:29: included_from: Included from here.
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
# 113| if (isrel) {
# 114| /* create the absolute path from the relative symlink */
# 115|-> memcpy(nm->abslink, path, nm->relstart);
# 116| *(nm->abslink + nm->relstart) = '/';
# 117| nm->relstart++;
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c:123:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc((long unsigned int)(sz + 1))’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
# 121| * - or link without any subdir (foo -> bar)
# 122| */
# 123|-> memcpy(nm->abslink, sym, sz);
# 124|
# 125| nm->abslink[sz] = '\0';
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c: scope_hint: In function ‘dotdot_stat’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/namei.c:142:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc(len + 4)’ where non-null expected
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
# 140| path = xmalloc(len + sizeof(DOTDOTDIR));
# 141|
# 142|-> memcpy(path, dirname, len);
# 143| memcpy(path + len, DOTDOTDIR, sizeof(DOTDOTDIR));
# 144|
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/rename.c: scope_hint: In function ‘string_replace’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/rename.c:91:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘q’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/rename.c:37: included_from: Included from here.
# 89| while (count--) {
# 90| while (p < where)
# 91|-> *q++ = *p++;
# 92| p = to;
# 93| while (*p)
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/rename.c:94:30: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘q’
# 92| p = to;
# 93| while (*p)
# 94|-> *q++ = *p++;
# 95| if (fromlen > 0) {
# 96| p = where + fromlen;
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/rename.c:104:22: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘q’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/rename.c:34: included_from: Included from here.
# 102| }
# 103| while (*p)
# 104|-> *q++ = *p++;
# 105| *q = 0;
# 106| return 0;
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/rename.c:105:12: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘q’
# 103| while (*p)
# 104| *q++ = *p++;
# 105|-> *q = 0;
# 106| return 0;
# 107| }
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/rename.c: scope_hint: In function ‘do_symlink’
util-linux-2.42.start-build/util-linux-2.42.start/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.42.start-build/util-linux-2.42.start/misc-utils/rename.c:31: included_from: Included from here.
/usr/include/unistd.h:838:16: note: argument 2 of ‘readlink’ must be non-null
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/waitpid.c: scope_hint: In function ‘parse_pids’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/waitpid.c:54:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc(n_strings, 4)’
util-linux-2.42.start-build/util-linux-2.42.start/include/strutils.h:53:64: note: in definition of macro ‘strtopid_or_err’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/waitpid.c:54:55: note: in expansion of macro ‘_’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/waitpid.c: scope_hint: In function ‘open_pidfds’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/waitpid.c:64:27: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc(n_pids, 4) + i * 4’
util-linux-2.42.start-build/util-linux-2.42.start/include/strutils.h:53:64: note: in definition of macro ‘strtopid_or_err’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/waitpid.c:54:55: note: in expansion of macro ‘_’
# 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-688):
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/wipefs.c: scope_hint: In function ‘get_desc_for_probe’
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/wipefs.c:350:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc(*len)’ where non-null expected
util-linux-2.42.start-build/util-linux-2.42.start/misc-utils/wipefs.c:38: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/xalloc.h:20: included_from: Included from here.
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
# 348|
# 349| wp->magic = xmalloc(*len);
# 350|-> memcpy(wp->magic, mag, *len);
# 351| wp->len = *len;
# 352|
Error: COMPILER_WARNING:
util-linux-2.42.start-build/util-linux-2.42.start/schedutils/chrt.c: scope_hint: In function ‘show_sched_pid_info’
util-linux-2.42.start-build/util-linux-2.42.start/schedutils/chrt.c:185:21: warning[-Wstringop-overflow=]: ‘sched_getattr’ writing 3136 bytes into a region of size 56 overflows the destination
util-linux-2.42.start-build/util-linux-2.42.start/schedutils/chrt.c:183:35: note: destination object ‘sa’ of size 56
/usr/include/sched.h:43: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/schedutils/chrt.c:25: included_from: Included from here.
/usr/include/bits/sched.h:153:5: note: in a call to function ‘sched_getattr’ declared with attribute ‘access (write_only, 2, 3)’
# 183| struct sched_attr sa;
# 184|
# 185|-> if (sched_getattr(pid, &sa, sizeof(sa), 0) != 0) {
# 186| if (errno == ENOSYS)
# 187| goto fallback;
Error: COMPILER_WARNING:
util-linux-2.42.start-build/util-linux-2.42.start/schedutils/uclampset.c: scope_hint: In function ‘show_uclamp_pid_info’
util-linux-2.42.start-build/util-linux-2.42.start/schedutils/uclampset.c:92:13: warning[-Wstringop-overflow=]: ‘sched_getattr’ writing 3136 bytes into a region of size 56 overflows the destination
util-linux-2.42.start-build/util-linux-2.42.start/schedutils/uclampset.c:85:27: note: destination object ‘sa’ of size 56
/usr/include/bits/sched.h:153:5: note: in a call to function ‘sched_getattr’ declared with attribute ‘access (write_only, 2, 3)’
# 90| pid = getpid();
# 91|
# 92|-> if (sched_getattr(pid, &sa, sizeof(sa), 0) != 0)
# 93| err(EXIT_FAILURE, _("failed to get pid %d's uclamp values"), pid);
# 94|
Error: COMPILER_WARNING:
util-linux-2.42.start-build/util-linux-2.42.start/schedutils/uclampset.c: scope_hint: In function ‘set_uclamp_one’
util-linux-2.42.start-build/util-linux-2.42.start/schedutils/uclampset.c:158:13: warning[-Wstringop-overflow=]: ‘sched_getattr’ writing 3136 bytes into a region of size 56 overflows the destination
util-linux-2.42.start-build/util-linux-2.42.start/schedutils/uclampset.c:156:27: note: destination object ‘sa’ of size 56
/usr/include/sched.h:43: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/schedutils/uclampset.c:23: included_from: Included from here.
/usr/include/bits/sched.h:153:5: note: in a call to function ‘sched_getattr’ declared with attribute ‘access (write_only, 2, 3)’
# 156| struct sched_attr sa;
# 157|
# 158|-> if (sched_getattr(pid, &sa, sizeof(sa), 0) != 0)
# 159| err(EXIT_FAILURE, _("failed to get pid %d's uclamp values"), pid);
# 160|
Error: GCC_ANALYZER_WARNING (CWE-775):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/blkpr.c: scope_hint: In function ‘do_pr’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/blkpr.c:166:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(path, 2)’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/hwclock-rtc.c: scope_hint: In function ‘resolve_rtc_param_alias’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/hwclock-rtc.c:435:22: warning[-Wanalyzer-null-argument]: use of NULL ‘alias’ where non-null expected
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/hwclock-rtc.c:31: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/strutils.h:19: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/hwclock-rtc.c:30: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/strutils.h:10: included_from: Included from here.
/usr/include/string.h:156:12: note: argument 1 of ‘strcmp’ must be non-null
# 433|
# 434| while (param->name) {
# 435|-> if (!strcmp(alias, param->name)) {
# 436| *value = param->id;
# 437| return 0;
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/irq-common.c: scope_hint: In function ‘get_scols_table’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/irq-common.c:551:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘xmalloc(size)’ where non-null expected
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/irq-common.c: scope_hint: In function ‘get_scols_table’
<built-in>: note: argument 1 of ‘__builtin_memcpy’ must be non-null
# 549| size = sizeof(*stat->irq_info) * stat->nr_irq;
# 550| result = xmalloc(size);
# 551|-> memcpy(result, stat->irq_info, size);
# 552|
# 553| if (prev) {
Error: GCC_ANALYZER_WARNING (CWE-775):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/ldattach.c: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/ldattach.c:390:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(dev, 258)’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/lscpu-cpu.c: scope_hint: In function ‘lscpu_create_cpus’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/lscpu-cpu.c:68:40: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘*cxt.cpus’
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/lscpu.h:17: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/lscpu-cpu.c:11: included_from: Included from here.
/usr/include/sched.h:44: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/cpuset.h:10: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/lscpu.h:19: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/lscpu.h:20: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/lscpu.h:26: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/lscpu.h:37:25: note: in expansion of macro ‘__UL_DBG’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/lscpu-cpu.c:27:9: note: in expansion of macro ‘DBG’
# 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: CPPCHECK_WARNING (CWE-457):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/mount.c:880: error[legacyUninitvar]: Uninitialized variable: path
# 878| snprintf(path, sizeof(path), "/proc/%i/ns/mnt", pid);
# 879|
# 880|-> if (mnt_context_set_target_ns(cxt, pid ? path : optarg))
# 881| err(MNT_EX_SYSERR, _("failed to set target namespace to %s"), pid ? path : optarg);
# 882| break;
Error: GCC_ANALYZER_WARNING (CWE-775):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/nsenter.c: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/nsenter.c:177:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/nsenter.c:46: included_from: Included from here.
# 175| if (*fd < 0)
# 176| err(EXIT_FAILURE, _("cannot open %s"), path);
# 177|-> }
# 178|
# 179| static void enable_nsfile(struct namespace_file *n, const char *path)
Error: GCC_ANALYZER_WARNING (CWE-775):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/nsenter.c: scope_hint: In function ‘open_target_fd’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/nsenter.c:177:1: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*((struct namespace_file (*)[9])n)[preserve_cred].fd’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/nsenter.c:197:41: note: in expansion of macro ‘get_nsfile’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/nsenter.c:197:41: note: in expansion of macro ‘get_nsfile’
# 175| if (*fd < 0)
# 176| err(EXIT_FAILURE, _("cannot open %s"), path);
# 177|-> }
# 178|
# 179| static void enable_nsfile(struct namespace_file *n, const char *path)
Error: GCC_ANALYZER_WARNING (CWE-775):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/readprofile.c:229:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(&defaultpro, 1)’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/readprofile.c:47: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:62:62: note: in definition of macro ‘ignore_result’
# 227| if (fd < 0)
# 228| err(EXIT_FAILURE, "%s", defaultpro);
# 229|-> if (write(fd, &multiplier, to_write) != to_write)
# 230| err(EXIT_FAILURE, _("error writing %s"), defaultpro);
# 231| close(fd);
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/readprofile.c:276:14: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xmalloc(len)’
# 274| }
# 275|
# 276|-> step = buf[0];
# 277| if (optInfo) {
# 278| printf(_("Sampling_step: %u\n"), step);
Error: GCC_ANALYZER_WARNING (CWE-775):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/setpgid.c: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/setpgid.c:76:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/tty", 524288)’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/setpgid.c:78:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/tty", 524288)’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/setpgid.c:80:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/tty", 524288)’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/setpriv.c: scope_hint: In function ‘do_selinux_label’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/setpriv.c:654:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/proc/self/attr/exec", 2)’
# 652| len = strlen(label);
# 653| errno = 0;
# 654|-> if (write(fd, label, len) != (ssize_t) len)
# 655| err(SETPRIV_EXIT_PRIVERR,
# 656| _("write failed: %s"), _PATH_PROC_ATTR_EXEC);
Error: GCC_ANALYZER_WARNING (CWE-775):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/setpriv.c: scope_hint: In function ‘do_seccomp_filter’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/setpriv.c:695:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open(file, 0)’
# 693|
# 694| s = read_all_alloc(fd, &filter);
# 695|-> if (s < 0)
# 696| err(SETPRIV_EXIT_PRIVERR,
# 697| _("cannot read %s"), file);
Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/swapoff.c: scope_hint: In function ‘do_swapoff’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/swapoff.c:82:35: warning[-Wanalyzer-malloc-leak]: leak of ‘swapoff_resolve_tag(name, value, mntcache)’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/swapoff.c:24: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/swapoff.c:23: included_from: Included from here.
# 80| while (tb && mnt_table_next_fs(tb, itr, &fs) == 0) {
# 81| blkid_probe pr = NULL;
# 82|-> const char *src = mnt_fs_get_source(fs);
# 83| const char *type = mnt_fs_get_swaptype(fs);
# 84| const char *data = NULL;
Error: CPPCHECK_WARNING (CWE-457):
util-linux-2.42.start-build/util-linux-2.42.start/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):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/unshare.c: scope_hint: In function ‘setgroups_control.part.0’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/unshare.c:118:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/proc/self/setgroups", 1)’
# 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-401):
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/zramctl.c: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/zramctl.c:753:33: warning[-Wanalyzer-malloc-leak]: leak of ‘new_zram(*<unknown>)’
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/zramctl.c:35: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/optutils.h:8: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/zramctl.c:37: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:18: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/sys-utils/zramctl.c:31: included_from: Included from here.
# 751| zram = new_zram(argv[optind++]);
# 752| if (!zram_exist(zram))
# 753|-> err(EXIT_FAILURE, "%s", zram->devname);
# 754| }
# 755| status(zram);
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/term-utils/agetty.c: scope_hint: In function ‘issuefile_read_stream.part.0’
util-linux-2.42.start-build/util-linux-2.42.start/term-utils/agetty.c:1854:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*ie.output’ where non-null expected
util-linux-2.42.start-build/util-linux-2.42.start/term-utils/agetty.c:14: included_from: Included from here.
/usr/include/stdio.h:612:12: note: argument 2 of ‘putc’ must be non-null
# 1852| output_special_char(ie, fgetc(f), op, tp, f);
# 1853| else
# 1854|-> putc(c, ie->output);
# 1855| }
# 1856|
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/term-utils/agetty.c: scope_hint: In function ‘output_special_char’
util-linux-2.42.start-build/util-linux-2.42.start/term-utils/agetty.c:2711:25: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*ie.output’ where non-null expected
<built-in>: note: argument 2 of ‘__builtin_fputc’ must be non-null
# 2709| }
# 2710| } else
# 2711|-> fputs("\033", ie->output);
# 2712| break;
# 2713| }
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/term-utils/agetty.c:2786:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*ie.output’ where non-null expected
<built-in>: note: argument 2 of ‘__builtin_fputs’ must be non-null
# 2784| }
# 2785| case 'l':
# 2786|-> fprintf (ie->output, "%s", op->tty);
# 2787| break;
# 2788| case 'b':
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/term-utils/agetty.c:2881:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘*ie.output’ where non-null expected
/usr/include/stdio.h:612:12: note: argument 2 of ‘putc’ must be non-null
# 2879| #endif
# 2880| default:
# 2881|-> putc(c, ie->output);
# 2882| break;
# 2883| }
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/term-utils/wall.c: scope_hint: In function ‘makemsg’
util-linux-2.42.start-build/util-linux-2.42.start/term-utils/wall.c:382:17: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fs’ where non-null expected
util-linux-2.42.start-build/util-linux-2.42.start/term-utils/wall.c:54: included_from: Included from here.
/usr/include/stdio.h:357:12: note: argument 1 of ‘fprintf’ must be non-null
# 380| /* snprintf is not always available, but the sprintf's here
# 381| will not overflow as long as %d takes at most 100 chars */
# 382|-> fprintf(fs, "\r%*s\r\n", TERM_WIDTH, " ");
# 383|
# 384| snprintf(lbuf, lbuflen,
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/term-utils/wall.c:391:9: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘fs’ where non-null expected
/usr/include/stdio.h:357:12: note: argument 1 of ‘fprintf’ must be non-null
# 389| free(whombuf);
# 390| }
# 391|-> fprintf(fs, "%*s\r\n", TERM_WIDTH, " ");
# 392|
# 393| if (mvec) {
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/bits.c: scope_hint: In function ‘main’
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/bits.c:321:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘argv’
# 319|
# 320| for (; argc > 0; argc--, argv++)
# 321|-> parse_mask_or_list(*argv, bits, width);
# 322|
# 323| strv_free(stdin_lines);
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/hexdump-display.c: scope_hint: In function ‘get’
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/hexdump-display.c:390:29: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘curp’ where non-null expected
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/hexdump-display.c:44: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/hexdump-display.c:42: included_from: Included from here.
/usr/include/string.h:64:12: note: argument 1 of ‘memcmp’ must be non-null
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/hexdump-display.c:390:29: warning[-Wanalyzer-possible-null-argument]: use of possibly-NULL ‘savp’ where non-null expected
/usr/include/string.h:64:12: note: argument 2 of ‘memcmp’ must be non-null
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/hexdump-parse.c: scope_hint: In function ‘rewrite_rules’
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/hexdump-parse.c:284:33: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘p1’
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/hexdump-parse.c:238:9: note: in expansion of macro ‘list_for_each’
# 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):
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/hexdump-parse.c: scope_hint: In function ‘color_fmt’
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/hexdump-parse.c:492:21: warning[-Wanalyzer-malloc-leak]: leak of ‘hcnext’
# 490|
# 491| fmt = cfmt;
# 492|-> while (cfmt && *cfmt) {
# 493| char *end;
# 494| /* invert this condition */
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/more.c: scope_hint: In function ‘argscan’
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/more.c:287:28: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘as_argv’
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/more.c:86: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/c.h:22: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/include/strutils.h:19: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/more.c:84: included_from: Included from here.
# 285| int move = 0;
# 286|
# 287|-> if (as_argv[opt][0] == '-' && isdigit_string(as_argv[opt] + 1)) {
# 288| ctl->lines_per_screen =
# 289| strtos16_or_err(as_argv[opt], _("failed to parse number"));
Error: GCC_ANALYZER_WARNING (CWE-688):
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/more.c:310:21: warning[-Wanalyzer-null-argument]: use of NULL ‘as_argv’ where non-null expected
/usr/include/getopt.h:36: included_from: Included from here.
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/more.c:66: included_from: Included from here.
/usr/include/bits/getopt_ext.h:66:12: note: argument 2 of ‘getopt_long’ must be non-null
# 308| }
# 309|
# 310|-> while ((c = getopt_long(as_argc, as_argv, "dflcpsun:eVh", longopts, NULL)) != -1) {
# 311| switch (c) {
# 312| case 'd':
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/rev.c: scope_hint: In function ‘reverse_str’
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/rev.c:94:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘str’
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/rev.c:62: included_from: Included from here.
# 92|
# 93| for (i = 0; i < n / 2; ++i) {
# 94|-> wchar_t tmp = str[i];
# 95| str[i] = str[n - 1 - i];
# 96| str[n - 1 - i] = tmp;
Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/rev.c: scope_hint: In function ‘write_line’
util-linux-2.42.start-build/util-linux-2.42.start/text-utils/rev.c:117:17: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘str’
# 115| {
# 116| for (size_t i = 0; i < n; i++)
# 117|-> fputwc(str[i], stream);
# 118| }
# 119|