Task #1299 - fixed.err

back to task #1299
download
Error: CLANG_WARNING:
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/lsfd.c:76: included_from: Included from here.
util-linux-2.40-build/util-linux-2.40-rc1/include/list.h:55:13: warning[core.NullDereference]: Access to field 'next' results in a dereference of a null pointer (loaded from variable 'prev')
#   53|   	add->next = next;
#   54|   	add->prev = prev;
#   55|-> 	prev->next = add;
#   56|   }
#   57|   

Error: GCC_ANALYZER_WARNING (CWE-401):
util-linux-2.40-build/util-linux-2.40-rc1/include/list.h:55:20: warning[-Wanalyzer-malloc-leak]: leak of ‘read_devdrv(&line)’
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/lsfd.c: scope_hint: In function ‘read_devices’
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/lsfd.c:2331:25: note: in expansion of macro ‘INITIALIZE_COLUMNS’
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/lsfd.c:2331:25: note: in expansion of macro ‘INITIALIZE_COLUMNS’
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/lsfd.c:2331:25: note: in expansion of macro ‘INITIALIZE_COLUMNS’
util-linux-2.40-build/util-linux-2.40-rc1/include/list.h:39:24: note: in definition of macro ‘INIT_LIST_HEAD’
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/lsfd.c: scope_hint: In function ‘read_devices’
util-linux-2.40-build/util-linux-2.40-rc1/include/list.h:39:24: note: in definition of macro ‘INIT_LIST_HEAD’
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/lsfd.c: scope_hint: In function ‘read_devices’
util-linux-2.40-build/util-linux-2.40-rc1/include/c.h:22: included_from: Included from here.
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/lsfd.c:75: included_from: Included from here.
#   53|   	add->next = next;
#   54|   	add->prev = prev;
#   55|-> 	prev->next = add;
#   56|   }
#   57|   

Error: CLANG_WARNING:
util-linux-2.40-build/util-linux-2.40-rc1/libmount/src/context_mount.c:553:17: warning[unix.Malloc]: Potential leak of memory pointed to by 'org_type'
#  551|   	org_type  = NULL;
#  552|   
#  553|-> 	if (rc == 0 && try_type && cxt->update) {
#  554|   		struct libmnt_fs *fs = mnt_update_get_fs(cxt->update);
#  555|   		if (fs)

Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/cal.c: scope_hint: In function ‘monthly’
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/cal.c:1016:28: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc((long unsigned int)*ctl.months_in_row, 208) + (sizetype)i * 208’
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/cal.c:79: included_from: Included from here.
# 1014|   
# 1015|   	for (i = 0; i < ctl->months_in_row - 1; i++)
# 1016|-> 		ms[i].next = &ms[i + 1];
# 1017|   
# 1018|   	rows = (ctl->num_months - 1) / ctl->months_in_row;

Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/hardlink.c: scope_hint: In function ‘get_sorted_xattr_name_table’
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/hardlink.c:515:26: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘xmalloc((long unsigned int)n * 8) + (long unsigned int)i * 8’
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/hardlink.c: scope_hint: In function ‘get_sorted_xattr_name_table’
#  513|   
#  514|   	for (i = 0; i < n; i++) {
#  515|-> 		table[i] = names;
#  516|   		names += strlen(names) + 1;
#  517|   	}

Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/lsfd.c:1766:13: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘0’
# 1764|   	       && (isspace((unsigned char)*next) || *next == ','))
# 1765|   		next++;
# 1766|-> 	if (*next != '\0')
# 1767|   		parse_pids(next, pids, count);
# 1768|   }

Error: CLANG_WARNING:
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/lslocks.c:244:7: warning[deadcode.DeadStores]: Although the value stored to 'len' is used in the enclosing expression, the value is never actually read from 'len'
#  242|   		return NULL;
#  243|   
#  244|-> 	if ((len = strlen(path)) >= (sizeof(path) - 2))
#  245|   		goto out;
#  246|   

Error: GCC_ANALYZER_WARNING (CWE-476):
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/waitpid.c: scope_hint: In function ‘parse_pids’
util-linux-2.40-build/util-linux-2.40-rc1/misc-utils/waitpid.c:54:25: warning[-Wanalyzer-null-dereference]: dereference of NULL ‘xcalloc(n_strings, 4)’
util-linux-2.40-build/util-linux-2.40-rc1/include/strutils.h:51:64: note: in definition of macro ‘strtopid_or_err’
util-linux-2.40-build/util-linux-2.40-rc1/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-401):
util-linux-2.40-build/util-linux-2.40-rc1/sys-utils/hwclock-rtc.c: scope_hint: In function ‘set_param_rtc’
util-linux-2.40-build/util-linux-2.40-rc1/sys-utils/hwclock-rtc.c:418:21: warning[-Wanalyzer-malloc-leak]: leak of ‘xstrdup(opt0)’
util-linux-2.40-build/util-linux-2.40-rc1/sys-utils/hwclock-rtc.c:26: included_from: Included from here.
util-linux-2.40-build/util-linux-2.40-rc1/include/c.h:22: included_from: Included from here.
util-linux-2.40-build/util-linux-2.40-rc1/include/strutils.h:17: included_from: Included from here.
util-linux-2.40-build/util-linux-2.40-rc1/sys-utils/hwclock-rtc.c:25: included_from: Included from here.
util-linux-2.40-build/util-linux-2.40-rc1/sys-utils/hwclock-rtc.c: scope_hint: In function ‘set_param_rtc’
util-linux-2.40-build/util-linux-2.40-rc1/sys-utils/hwclock-rtc.c: scope_hint: In function ‘set_param_rtc’
#  416|   	const struct hwclock_param *param = &hwclock_params[0];
#  417|   
#  418|-> 	while (param->name) {
#  419|   		if (!strcmp(alias, param->name)) {
#  420|   			*value = param->id;

Error: CLANG_WARNING:
util-linux-2.40-build/util-linux-2.40-rc1/sys-utils/hwclock-rtc.c:507:3: warning[unix.Malloc]: Potential leak of memory pointed to by 'opt'
#  505|   	rtc_fd = open_rtc(ctl);
#  506|   	if (rtc_fd < 0) {
#  507|-> 		warnx(_("cannot open %s"), rtc_dev_name);
#  508|   		return 1;
#  509|   	}