lvm2-2.03.24-3.fc41

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-775): [#def1]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/dmeventd/dmeventd.c: scope_hint: In function ‘_daemonize’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/dmeventd/dmeventd.c:2006:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 0)’
# 2004|   		exit(EXIT_DESC_OPEN_FAILURE);
# 2005|   
# 2006|-> 	if ((dup2(null_fd, STDIN_FILENO) == -1) ||
# 2007|   	    (dup2(null_fd, STDOUT_FILENO) == -1) ||
# 2008|   	    (dup2(null_fd, STDERR_FILENO) == -1))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/dmeventd/dmeventd.c:2006:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
# 2004|   		exit(EXIT_DESC_OPEN_FAILURE);
# 2005|   
# 2006|-> 	if ((dup2(null_fd, STDIN_FILENO) == -1) ||
# 2007|   	    (dup2(null_fd, STDOUT_FILENO) == -1) ||
# 2008|   	    (dup2(null_fd, STDERR_FILENO) == -1))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/dmeventd/dmeventd.c:2006:49: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 1)’
# 2004|   		exit(EXIT_DESC_OPEN_FAILURE);
# 2005|   
# 2006|-> 	if ((dup2(null_fd, STDIN_FILENO) == -1) ||
# 2007|   	    (dup2(null_fd, STDOUT_FILENO) == -1) ||
# 2008|   	    (dup2(null_fd, STDERR_FILENO) == -1))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/dmeventd/dmeventd.c:2006:49: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
# 2004|   		exit(EXIT_DESC_OPEN_FAILURE);
# 2005|   
# 2006|-> 	if ((dup2(null_fd, STDIN_FILENO) == -1) ||
# 2007|   	    (dup2(null_fd, STDOUT_FILENO) == -1) ||
# 2008|   	    (dup2(null_fd, STDERR_FILENO) == -1))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/dmeventd/dmeventd.c:2007:50: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 2)’
# 2005|   
# 2006|   	if ((dup2(null_fd, STDIN_FILENO) == -1) ||
# 2007|-> 	    (dup2(null_fd, STDOUT_FILENO) == -1) ||
# 2008|   	    (dup2(null_fd, STDERR_FILENO) == -1))
# 2009|   		exit(EXIT_DESC_OPEN_FAILURE);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def6]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/dmeventd/dmeventd.c:2007:50: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
# 2005|   
# 2006|   	if ((dup2(null_fd, STDIN_FILENO) == -1) ||
# 2007|-> 	    (dup2(null_fd, STDOUT_FILENO) == -1) ||
# 2008|   	    (dup2(null_fd, STDERR_FILENO) == -1))
# 2009|   		exit(EXIT_DESC_OPEN_FAILURE);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def7]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/dmeventd/dmeventd.c:2011:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
# 2009|   		exit(EXIT_DESC_OPEN_FAILURE);
# 2010|   
# 2011|-> 	if ((null_fd > STDERR_FILENO) && close(null_fd))
# 2012|   		exit(EXIT_DESC_CLOSE_FAILURE);
# 2013|   

Error: GCC_ANALYZER_WARNING (CWE-1341): [#def8]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/dmeventd/libdevmapper-event.c: scope_hint: In function ‘fini_fifos’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/dmeventd/libdevmapper-event.c:576:35: warning[-Wanalyzer-fd-double-close]: double ‘close’ of file descriptor ‘fifos.client’
/usr/include/time.h:29: included_from: Included from here.
/usr/include/pthread.h:23: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/daemons/dmeventd/libdevmapper-event.c:28: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/libdm/libdevmapper.h:23: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/libdm/misc/dm-logging.h:19: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/daemons/dmeventd/libdevmapper-event.c:17: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/libdm/misc/dm-logging.h:26:27: note: in expansion of macro ‘LOG_MESG’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:88:25: note: in expansion of macro ‘LOG_LINE’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:110:15: note: in expansion of macro ‘log_debug’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:130:30: note: in expansion of macro ‘stack’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/dmeventd/libdevmapper-event.c:569:17: note: in expansion of macro ‘return_0’
lvm2-2.03.24-build/LVM2.2.03.24/libdm/misc/dm-logging.h:26:27: note: in expansion of macro ‘LOG_MESG’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:88:25: note: in expansion of macro ‘LOG_LINE’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:110:15: note: in expansion of macro ‘log_debug’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:135:30: note: in expansion of macro ‘stack’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/dmeventd/libdevmapper-event.c:660:17: note: in expansion of macro ‘goto_out’
#  574|   void fini_fifos(struct dm_event_fifos *fifos)
#  575|   {
#  576|-> 	if (fifos->client >= 0 && close(fifos->client))
#  577|   		log_sys_debug("close", fifos->client_path);
#  578|   

Error: GCC_ANALYZER_WARNING: [#def9]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockctl.c: scope_hint: In function ‘_reopen_fd_to_null’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockctl.c:541:13: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘fd’
#  539|   	}
#  540|   
#  541|-> 	if (dup2(null_fd, fd) == -1) {
#  542|   		log_error("dup2 error %d", errno);
#  543|   		goto out;

Error: GCC_ANALYZER_WARNING: [#def10]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockctl.c: scope_hint: In function ‘_run_command_pipe’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockctl.c:649:26: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
#  647|   		else if (close(STDOUT_FILENO))
#  648|   			log_error("close error STDOUT %d", errno);
#  649|-> 		else if (dup2(pipefd[1 /*write*/], STDOUT_FILENO) == -1)
#  650|   			log_error("dup2 error STDOUT %d", errno);
#  651|   		else if (close(pipefd[1]))

Error: CLANG_WARNING: [#def11]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-core.c:1954:2: warning[unix.Malloc]: Use of memory after it is freed
# 1952|   	 */
# 1953|   
# 1954|-> 	list_for_each_entry_safe(act, safe, &r->actions, list) {
# 1955|   		if (act->flags & LD_AF_PERSISTENT)
# 1956|   			continue;

Error: CLANG_WARNING: [#def12]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-core.c:1989:2: warning[unix.Malloc]: Use of memory after it is freed
# 1987|   	 */
# 1988|   
# 1989|-> 	list_for_each_entry_safe(act, safe, &r->actions, list) {
# 1990|   		if (!(act->flags & LD_AF_PERSISTENT))
# 1991|   			continue;

Error: CLANG_WARNING: [#def13]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-core.c:2035:2: warning[unix.Malloc]: Use of memory after it is freed
# 2033|   	 */
# 2034|   
# 2035|-> 	list_for_each_entry_safe(act, safe, &r->actions, list) {
# 2036|   		if (act->flags & LD_AF_PERSISTENT)
# 2037|   			continue;

Error: CLANG_WARNING: [#def14]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c:667:4: warning[deadcode.DeadStores]: Value stored to 'rv' is never read
#  665|   		if (rv == -EMSGSIZE || rv == -ENOSPC) {
#  666|   			/* This indicates the end of the device is reached. */
#  667|-> 			rv = -EMSGSIZE;
#  668|   			break;
#  669|   		}

Error: CLANG_WARNING: [#def15]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c:971:4: warning[deadcode.DeadStores]: Value stored to 'rv' is never read
#  969|   		if (rv == -EMSGSIZE || rv == -ENOSPC) {
#  970|   			/* This indicates the end of the device is reached. */
#  971|-> 			rv = -EMSGSIZE;
#  972|   			break;
#  973|   		}

Error: GCC_ANALYZER_WARNING (CWE-126): [#def16]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c: scope_hint: In function ‘lm_prepare_lockspace_sanlock’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c:1412:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c: scope_hint: In function ‘lm_prepare_lockspace_sanlock’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c: scope_hint: In function ‘lm_prepare_lockspace_sanlock’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c:1412:25: note: read of 15 bytes from after the end of ‘lsname’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c:1412:25: note: valid subscripts for ‘lsname’ are ‘[0]’ to ‘[48]’
#  └──────────────────────────────────────────────────────────────────────┘
#      ^                    ^                     ^              ^
# 1410|   	if (daemon_test) {
# 1411|   		if (!gl_lsname_sanlock[0]) {
# 1412|-> 			strncpy(gl_lsname_sanlock, lsname, MAX_NAME);
# 1413|   			log_debug("S %s prepare_lockspace_san use global lock", lsname);
# 1414|   		}

Error: GCC_ANALYZER_WARNING (CWE-126): [#def17]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c:1486:25: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c: scope_hint: In function ‘lm_prepare_lockspace_sanlock’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c: scope_hint: In function ‘lm_prepare_lockspace_sanlock’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c:19: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c:1426:9: note: in expansion of macro ‘log_debug’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c:1462:9: note: in expansion of macro ‘log_debug’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c:1486:25: note: read of 15 bytes from after the end of ‘lsname’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c:1486:25: note: valid subscripts for ‘lsname’ are ‘[0]’ to ‘[48]’
#  └──────────────────────────────────────────────────────────────────────┘
#      ^                    ^                     ^              ^
# 1484|   				  lsname, gl_lsname_sanlock);
# 1485|   		} else {
# 1486|-> 			strncpy(gl_lsname_sanlock, lsname, MAX_NAME);
# 1487|   			log_debug("S %s prepare_lockspace_san use global lock %s",
# 1488|   				  lsname, gl_lsname_sanlock);

Error: CLANG_WARNING: [#def18]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmlockd/lvmlockd-sanlock.c:1887:4: warning[deadcode.DeadStores]: Value stored to 'rv' is never read
# 1885|   		 */
# 1886|   		if (rv == -ENOSPC)
# 1887|-> 			rv = -ELOCKIO;
# 1888|   
# 1889|   		/*

Error: GCC_ANALYZER_WARNING (CWE-775): [#def19]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmpolld/lvmpolld-core.c: scope_hint: In function ‘fork_and_poll’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmpolld/lvmpolld-core.c:409:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(outfd, 1)’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmpolld/lvmpolld-core.c:19: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmpolld/lvmpolld-core.c:393:9: note: in expansion of macro ‘DEBUGLOG’
#  407|   		/* !!! Do not touch any posix thread primitives !!! */
#  408|   
#  409|-> 		if ((dup2(outfd, STDOUT_FILENO ) != STDOUT_FILENO) ||
#  410|   		    (dup2(errfd, STDERR_FILENO ) != STDERR_FILENO))
#  411|   			_exit(LVMPD_RET_DUP_FAILED);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def20]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmpolld/lvmpolld-core.c:409:68: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(errfd, 2)’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmpolld/lvmpolld-core.c:393:9: note: in expansion of macro ‘DEBUGLOG’
#  407|   		/* !!! Do not touch any posix thread primitives !!! */
#  408|   
#  409|-> 		if ((dup2(outfd, STDOUT_FILENO ) != STDOUT_FILENO) ||
#  410|   		    (dup2(errfd, STDERR_FILENO ) != STDERR_FILENO))
#  411|   			_exit(LVMPD_RET_DUP_FAILED);

Error: CLANG_WARNING: [#def21]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmpolld/lvmpolld-core.c:413:3: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  411|   			_exit(LVMPD_RET_DUP_FAILED);
#  412|   
#  413|-> 		execve(*(pdlv->cmdargv), (char *const *)pdlv->cmdargv, (char *const *)pdlv->cmdenvp);
#  414|   
#  415|   		_exit(LVMPD_RET_EXC_FAILED);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def22]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmpolld/lvmpolld-data-utils.c: scope_hint: In function ‘lvmpolld_thread_data_destroy’
lvm2-2.03.24-build/LVM2.2.03.24/daemons/lvmpolld/lvmpolld-data-utils.c:397:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor
#  395|   		(void) close(data->errpipe[1]);
#  396|   
#  397|-> 	free(data);
#  398|   }

Error: CLANG_WARNING: [#def23]
lvm2-2.03.24-build/LVM2.2.03.24/device_mapper/libdm-report.c:592:3: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value
#  590|   		arr[i].item.pos = pos;
#  591|   
#  592|-> 		memcpy(repstr + pos, arr[i].str, arr[i].item.len);
#  593|   		memcpy(repstr_extra + i + 1, &arr[i].item, sizeof(struct pos_len));
#  594|   

Error: CLANG_WARNING: [#def24]
lvm2-2.03.24-build/LVM2.2.03.24/device_mapper/regex/ttree.c:99:13: warning[core.NullDereference]: Access to field 'data' results in a dereference of a null pointer
#   97|   		}
#   98|   	}
#   99|-> 	(*c)->data = data;
#  100|   
#  101|   	return 1;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def25]
lvm2-2.03.24-build/LVM2.2.03.24/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c:26: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/device_mapper/vdo/status.c: scope_hint: In function ‘dm_vdo_status_parse’
lvm2-2.03.24-build/LVM2.2.03.24/device_mapper/vdo/status.c:247:12: warning[-Wanalyzer-malloc-leak]: leak of ‘<unknown>’
lvm2-2.03.24-build/LVM2.2.03.24/device_mapper/vdo/status.c: scope_hint: In function ‘dm_vdo_status_parse’
#  245|   
#  246|   bad:
#  247|-> 	if (s && !mem) {
#  248|   		free(s->device);
#  249|   		free(s);

Error: CLANG_WARNING: [#def26]
lvm2-2.03.24-build/LVM2.2.03.24/lib/activate/dev_manager.c:4152:2: warning[deadcode.DeadStores]: Value stored to 'next' is never read
# 4150|   		return_0;
# 4151|   
# 4152|-> 	next = dm_get_next_target(dmt, next, &start, &length, &target_type, &params);
# 4153|   
# 4154|   	if (!target_type || !params || strcmp(target_type, "crypt")) {

Error: GCC_ANALYZER_WARNING (CWE-688): [#def27]
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.c: scope_hint: In function ‘_lvmcache_update_vgname’
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.c:1933:30: warning[-Wanalyzer-null-argument]: use of NULL ‘vgid’ where non-null expected
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lib.h:30: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.c:17: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:95:31: note: in expansion of macro ‘LOG_LINE_WITH_CLASS’
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.c:1906:17: note: in expansion of macro ‘log_debug_cache’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:95:31: note: in expansion of macro ‘LOG_LINE_WITH_CLASS’
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.c:1922:25: note: in expansion of macro ‘log_debug_cache’
lvm2-2.03.24-build/LVM2.2.03.24/device_mapper/all.h:34: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lib.h:22: included_from: Included from here.
/usr/include/string.h:64:12: note: argument 2 of ‘memcmp’ must be non-null
# 1931|   			 */
# 1932|   
# 1933|-> 			if (!memcmp(other->vgid, vgid, ID_LEN)) {
# 1934|   				/* shouldn't happen since we looked up by vgid above */
# 1935|   				log_error(INTERNAL_ERROR "lvmcache_update_vgname %s %s %s %s",

Error: GCC_ANALYZER_WARNING (CWE-401): [#def28]
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.c: scope_hint: In function ‘_lvmcache_update_vgstatus’
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.c:2034:12: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(lock_type)’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:95:31: note: in expansion of macro ‘LOG_LINE_WITH_CLASS’
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.c:2021:9: note: in expansion of macro ‘log_debug_cache’
# 2032|   	free(info->vginfo->lock_type);
# 2033|   
# 2034|-> 	if (!(info->vginfo->lock_type = strdup(lock_type))) {
# 2035|   		log_error("cache lock_type alloc failed for %s", lock_type);
# 2036|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def29]
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.c:2052:12: warning[-Wanalyzer-malloc-leak]: leak of ‘strdup(system_id)’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:95:31: note: in expansion of macro ‘LOG_LINE_WITH_CLASS’
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.c:2039:9: note: in expansion of macro ‘log_debug_cache’
# 2050|   	free(info->vginfo->system_id);
# 2051|   
# 2052|-> 	if (!(info->vginfo->system_id = strdup(system_id))) {
# 2053|   		log_error("cache system_id alloc failed for %s", system_id);
# 2054|   		return 0;

Error: GCC_ANALYZER_WARNING (CWE-401): [#def30]
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.c: scope_hint: In function ‘lvmcache_add’
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.c:2514:33: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
/usr/include/bits/types/struct_iovec.h:23: included_from: Included from here.
/usr/include/bits/fcntl-linux.h:38: included_from: Included from here.
/usr/include/bits/fcntl.h:61: included_from: Included from here.
/usr/include/fcntl.h:35: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/device.h:21: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/dev-cache.h:19: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.h:19: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.c:18: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:95:31: note: in expansion of macro ‘LOG_LINE_WITH_CLASS’
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.c:2491:25: note: in expansion of macro ‘log_debug_cache’
lvm2-2.03.24-build/LVM2.2.03.24/lib/cache/lvmcache.c: scope_hint: In function ‘lvmcache_add’
# 2512|   				devl->dev = dev;
# 2513|   
# 2514|-> 				dm_list_add(&_initial_duplicates, &devl->list);
# 2515|   			}
# 2516|   

Error: GCC_ANALYZER_WARNING (CWE-835): [#def31]
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/dev-type.c: scope_hint: In function ‘create_dev_types’
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/dev-type.c:268:28: warning[-Wanalyzer-infinite-loop]: infinite loop
#  266|   
#  267|   		/* Find the start of the device major name */
#  268|-> 		while (line[i] != ' ' && line[i] != '\0')
#  269|   			i++;
#  270|   		while (line[i] == ' ')

Error: GCC_ANALYZER_WARNING (CWE-835): [#def32]
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/dev-type.c:270:28: warning[-Wanalyzer-infinite-loop]: infinite loop
#  268|   		while (line[i] != ' ' && line[i] != '\0')
#  269|   			i++;
#  270|-> 		while (line[i] == ' ')
#  271|   			i++;
#  272|   

Error: CLANG_WARNING: [#def33]
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/dev-type.c:641:8: warning[deadcode.DeadStores]: Although the value stored to 'value' is used in the enclosing expression, the value is never actually read from 'value'
#  639|   
#  640|   	device = (struct udev_device *) ext->handle;
#  641|-> 	if (!(value = udev_device_get_property_value(device, DEV_EXT_UDEV_BLKID_PART_TABLE_TYPE)))
#  642|   		return 0;
#  643|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def34]
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/online.c: scope_hint: In function ‘get_pvs_online’
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/online.c:189:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 328)’
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lib.h:30: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/online.c:16: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:103:24: note: in expansion of macro ‘LOG_LINE’
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/online.c:97:25: note: in expansion of macro ‘log_warn’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:88:25: note: in expansion of macro ‘LOG_LINE’
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/online.c:112:25: note: in expansion of macro ‘log_debug’
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/online.c: scope_hint: In function ‘get_pvs_online’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:88:25: note: in expansion of macro ‘LOG_LINE’
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/online.c:188:17: note: in expansion of macro ‘log_debug’
#  187|   
#  188|   		log_debug("Found PV online %s for VG %s %s", path, vgname, file_devname);
#  189|-> 		dm_list_add(pvs_online, &po->list);
#  190|   	}
#  191|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def35]
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/online.c: scope_hint: In function ‘get_pvs_lookup’
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/online.c:440:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 328)’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:88:25: note: in expansion of macro ‘LOG_LINE’
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/online.c:91:25: note: in expansion of macro ‘log_debug’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:88:25: note: in expansion of macro ‘LOG_LINE’
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/online.c:112:25: note: in expansion of macro ‘log_debug’
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/online.c: scope_hint: In function ‘get_pvs_lookup’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:88:25: note: in expansion of macro ‘LOG_LINE’
lvm2-2.03.24-build/LVM2.2.03.24/lib/device/online.c:439:17: note: in expansion of macro ‘log_debug’
#  438|   
#  439|   		log_debug("Found PV online lookup %s for VG %s on %s.", path, vgname, file_devname);
#  440|-> 		dm_list_add(pvs_online, &po->list);
#  441|   	}
#  442|   

Error: CLANG_WARNING: [#def36]
lvm2-2.03.24-build/LVM2.2.03.24/lib/display/display.c:978:33: warning[core.UndefinedBinaryOperatorResult]: The right operand of '==' is a garbage value due to array index out of bounds
#  976|   		c = tolower(c);
#  977|   
#  978|-> 		if ((ret > 0) && answer && (c == answer[0]))
#  979|   			answer++;	/* Matching, next char */
#  980|   		else if (c == '\n') {

Error: GCC_ANALYZER_WARNING (CWE-465): [#def37]
lvm2-2.03.24-build/LVM2.2.03.24/lib/format_text/flags.c: scope_hint: In function ‘read_flags’
lvm2-2.03.24-build/LVM2.2.03.24/lib/format_text/flags.c:195:16: warning[-Wanalyzer-deref-before-check]: check of ‘cv’ for NULL after already dereferencing it
#  193|   		goto out;
#  194|   
#  195|-> 	while (cv) {
#  196|   		if (cv->type != DM_CFG_STRING) {
#  197|   			log_error("Status value is not a string.");

Error: CLANG_WARNING: [#def38]
lvm2-2.03.24-build/LVM2.2.03.24/lib/format_text/format-text.c:1954:6: warning[core.uninitialized.Branch]: Branch condition evaluates to a garbage value
# 1952|   static void _text_destroy(struct format_type *fmt)
# 1953|   {
# 1954|-> 	if (fmt->orphan_vg)
# 1955|   		free_orphan_vg(fmt->orphan_vg);
# 1956|   

Error: GCC_ANALYZER_WARNING (CWE-457): [#def39]
lvm2-2.03.24-build/LVM2.2.03.24/lib/format_text/format-text.c: scope_hint: In function ‘_text_destroy’
lvm2-2.03.24-build/LVM2.2.03.24/lib/format_text/format-text.c:1954:16: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*fmt.orphan_vg’
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lib.h:30: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/format_text/format-text.c:16: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:105:23: note: in expansion of macro ‘LOG_LINE_WITH_ERRNO’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:115:28: note: in expansion of macro ‘log_err’
lvm2-2.03.24-build/LVM2.2.03.24/lib/format_text/format-text.c:2622:17: note: in expansion of macro ‘log_error’
# 1952|   static void _text_destroy(struct format_type *fmt)
# 1953|   {
# 1954|-> 	if (fmt->orphan_vg)
# 1955|   		free_orphan_vg(fmt->orphan_vg);
# 1956|   

Error: GCC_ANALYZER_WARNING (CWE-465): [#def40]
lvm2-2.03.24-build/LVM2.2.03.24/lib/format_text/import_vsn1.c: scope_hint: In function ‘_read_str_list’
lvm2-2.03.24-build/LVM2.2.03.24/lib/format_text/import_vsn1.c:162:16: warning[-Wanalyzer-deref-before-check]: check of ‘cv’ for NULL after already dereferencing it
lvm2-2.03.24-build/LVM2.2.03.24/lib/format_text/import_vsn1.c:396:14: note: in expansion of macro ‘_read_int32’
lvm2-2.03.24-build/LVM2.2.03.24/lib/format_text/import_vsn1.c:402:14: note: in expansion of macro ‘_read_int32’
lvm2-2.03.24-build/LVM2.2.03.24/lib/format_text/import_vsn1.c:408:14: note: in expansion of macro ‘_read_int32’
#  160|   		return 1;
#  161|   
#  162|-> 	while (cv) {
#  163|   		if (cv->type != DM_CFG_STRING) {
#  164|   			log_error("Found an item that is not a string");

Error: GCC_ANALYZER_WARNING (CWE-401): [#def41]
lvm2-2.03.24-build/LVM2.2.03.24/lib/label/hints.c: scope_hint: In function ‘_read_hint_file’
lvm2-2.03.24-build/LVM2.2.03.24/lib/label/hints.c:861:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 4288)’
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lib.h:30: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/label/hints.c:138: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:88:25: note: in expansion of macro ‘LOG_LINE’
lvm2-2.03.24-build/LVM2.2.03.24/lib/label/hints.c:717:9: note: in expansion of macro ‘log_debug’
lvm2-2.03.24-build/LVM2.2.03.24/lib/label/hints.c: scope_hint: In function ‘_read_hint_file’
#  859|   
#  860|   		log_debug("add hint %s %s %d:%d %s", hint.name, hint.pvid, major, minor, vgname);
#  861|-> 		dm_list_add(hints, &alloc_hint->list);
#  862|   		found++;
#  863|   	}

Error: CLANG_WARNING: [#def42]
lvm2-2.03.24-build/LVM2.2.03.24/lib/metadata/merge.c:705:5: warning[core.NullDereference]: Access to field 'n' results in a dereference of a null pointer
#  703|    */
#  704|   				seg_found = 0;
#  705|-> 				dm_list_iterate_items(sl, &seg_lv(seg, s)->segs_using_this_lv)
#  706|   					if (sl->seg == seg)
#  707|   						seg_found++;

Error: CLANG_WARNING: [#def43]
lvm2-2.03.24-build/LVM2.2.03.24/lib/metadata/vdo_manip.c:292:3: warning[deadcode.DeadStores]: Value stored to 'buf_pos' is never read
#  290|   	argv[++args] = buf_pos;
#  291|   	if (vtp->index_memory_size_mb >= 1024)
#  292|-> 		buf_pos += 1 + dm_snprintf(buf_pos, 30, "--uds-memory-size=%u",
#  293|   					   vtp->index_memory_size_mb / 1024);
#  294|   	else

Error: CLANG_WARNING: [#def44]
lvm2-2.03.24-build/LVM2.2.03.24/lib/metadata/vdo_manip.c:295:3: warning[deadcode.DeadStores]: Value stored to 'buf_pos' is never read
#  293|   					   vtp->index_memory_size_mb / 1024);
#  294|   	else
#  295|-> 		buf_pos += 1 + dm_snprintf(buf_pos, 30, "--uds-memory-size=0.%2u",
#  296|   					   (vtp->index_memory_size_mb < 512) ? 25 :
#  297|   					   (vtp->index_memory_size_mb < 768) ? 50 : 75);

Error: GCC_ANALYZER_WARNING: [#def45]
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lvm-exec.c: scope_hint: In function ‘_reopen_fd_to_null’
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lvm-exec.c:131:13: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘fd’
#  129|   	}
#  130|   
#  131|-> 	if (dup2(null_fd, fd) == -1) {
#  132|   		log_sys_error("dup2", "");
#  133|   		goto out;

Error: GCC_ANALYZER_WARNING (CWE-775): [#def46]
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lvm-exec.c: scope_hint: In function ‘pipe_open’
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lvm-exec.c:156:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[0]’
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lib.h:30: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lvm-exec.c:16: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:102:26: note: in expansion of macro ‘LOG_LINE’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:112:30: note: in expansion of macro ‘log_notice’
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lvm-exec.c:164:9: note: in expansion of macro ‘log_verbose’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/lvm-logging.h:33:45: note: in definition of macro ‘LOG_LINE_WITH_ERRNO’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:122:17: note: in expansion of macro ‘log_err’
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lvm-exec.c:167:17: note: in expansion of macro ‘log_sys_error’
#  154|   		if (!sync_local_dev_names(cmd)) {
#  155|   			log_error("Failed to sync local device names before forking.");
#  156|-> 			return 0;
#  157|   		}
#  158|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def47]
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lvm-exec.c:156:32: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘pipefd[1]’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:102:26: note: in expansion of macro ‘LOG_LINE’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:112:30: note: in expansion of macro ‘log_notice’
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lvm-exec.c:164:9: note: in expansion of macro ‘log_verbose’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/lvm-logging.h:33:45: note: in definition of macro ‘LOG_LINE_WITH_ERRNO’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:122:17: note: in expansion of macro ‘log_err’
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lvm-exec.c:167:17: note: in expansion of macro ‘log_sys_error’
#  154|   		if (!sync_local_dev_names(cmd)) {
#  155|   			log_error("Failed to sync local device names before forking.");
#  156|-> 			return 0;
#  157|   		}
#  158|   

Error: GCC_ANALYZER_WARNING: [#def48]
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lvm-exec.c:179:26: warning[-Wanalyzer-fd-use-without-check]: ‘dup2’ on possibly invalid file descriptor ‘1’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:102:26: note: in expansion of macro ‘LOG_LINE’
lvm2-2.03.24-build/LVM2.2.03.24/lib/log/log.h:112:30: note: in expansion of macro ‘log_notice’
lvm2-2.03.24-build/LVM2.2.03.24/lib/misc/lvm-exec.c:164:9: note: in expansion of macro ‘log_verbose’
#  177|   		else if (close(STDOUT_FILENO))
#  178|   			log_sys_error("close", "STDOUT");
#  179|-> 		else if (dup2(pipefd[1 /*write*/], STDOUT_FILENO) == -1)
#  180|   			log_sys_error("dup2", "STDOUT");
#  181|   		else if (close(pipefd[1]))

Error: GCC_ANALYZER_WARNING (CWE-775): [#def49]
lvm2-2.03.24-build/LVM2.2.03.24/libdaemon/server/daemon-server.c: scope_hint: In function ‘_daemonise’
lvm2-2.03.24-build/LVM2.2.03.24/libdaemon/server/daemon-server.c:344:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
#  342|   
#  343|   	sigemptyset(&my_sigset);
#  344|-> 	if (sigprocmask(SIG_SETMASK, &my_sigset, NULL) < 0) {
#  345|   		fprintf(stderr, "Unable to restore signals.\n");
#  346|   		exit(EXIT_FAILURE);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def50]
lvm2-2.03.24-build/LVM2.2.03.24/libdaemon/server/daemon-server.c:350:9: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
#  348|   	signal(SIGTERM, &_exit_handler);
#  349|   
#  350|-> 	switch (pid = fork()) {
#  351|   	case -1:
#  352|   		perror("fork failed:");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def51]
lvm2-2.03.24-build/LVM2.2.03.24/libdaemon/server/daemon-server.c:381:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
#  379|   	}
#  380|   
#  381|-> 	if (chdir("/")) {
#  382|   		perror("Cannot chdir to /");
#  383|   		exit(1);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def52]
lvm2-2.03.24-build/LVM2.2.03.24/libdaemon/server/daemon-server.c:386:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 0)’
#  384|   	}
#  385|   
#  386|-> 	if ((dup2(fd, STDIN_FILENO) == -1) ||
#  387|   	    (dup2(fd, STDOUT_FILENO) == -1) ||
#  388|   	    (dup2(fd, STDERR_FILENO) == -1)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def53]
lvm2-2.03.24-build/LVM2.2.03.24/libdaemon/server/daemon-server.c:386:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
#  384|   	}
#  385|   
#  386|-> 	if ((dup2(fd, STDIN_FILENO) == -1) ||
#  387|   	    (dup2(fd, STDOUT_FILENO) == -1) ||
#  388|   	    (dup2(fd, STDERR_FILENO) == -1)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def54]
lvm2-2.03.24-build/LVM2.2.03.24/libdaemon/server/daemon-server.c:386:44: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 1)’
#  384|   	}
#  385|   
#  386|-> 	if ((dup2(fd, STDIN_FILENO) == -1) ||
#  387|   	    (dup2(fd, STDOUT_FILENO) == -1) ||
#  388|   	    (dup2(fd, STDERR_FILENO) == -1)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def55]
lvm2-2.03.24-build/LVM2.2.03.24/libdaemon/server/daemon-server.c:386:44: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
#  384|   	}
#  385|   
#  386|-> 	if ((dup2(fd, STDIN_FILENO) == -1) ||
#  387|   	    (dup2(fd, STDOUT_FILENO) == -1) ||
#  388|   	    (dup2(fd, STDERR_FILENO) == -1)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def56]
lvm2-2.03.24-build/LVM2.2.03.24/libdaemon/server/daemon-server.c:387:45: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 2)’
#  385|   
#  386|   	if ((dup2(fd, STDIN_FILENO) == -1) ||
#  387|-> 	    (dup2(fd, STDOUT_FILENO) == -1) ||
#  388|   	    (dup2(fd, STDERR_FILENO) == -1)) {
#  389|   		perror("Error setting terminal FDs to /dev/null");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def57]
lvm2-2.03.24-build/LVM2.2.03.24/libdaemon/server/daemon-server.c:387:45: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
#  385|   
#  386|   	if ((dup2(fd, STDIN_FILENO) == -1) ||
#  387|-> 	    (dup2(fd, STDOUT_FILENO) == -1) ||
#  388|   	    (dup2(fd, STDERR_FILENO) == -1)) {
#  389|   		perror("Error setting terminal FDs to /dev/null");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def58]
lvm2-2.03.24-build/LVM2.2.03.24/libdaemon/server/daemon-server.c:393:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
#  391|   	}
#  392|   
#  393|-> 	if ((fd > STDERR_FILENO) && close(fd)) {
#  394|   		perror("Failed to close /dev/null descriptor");
#  395|   		exit(3);

Error: GCC_ANALYZER_WARNING (CWE-775): [#def59]
lvm2-2.03.24-build/LVM2.2.03.24/libdm/dm-tools/dmfilemapd.c: scope_hint: In function ‘_daemonise’
lvm2-2.03.24-build/LVM2.2.03.24/libdm/dm-tools/dmfilemapd.c:659:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 0)’
#  657|   		}
#  658|   
#  659|-> 		if ((dup2(fd, STDIN_FILENO) == -1) ||
#  660|   		    (dup2(fd, STDOUT_FILENO) == -1) ||
#  661|   		    (dup2(fd, STDERR_FILENO) == -1)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def60]
lvm2-2.03.24-build/LVM2.2.03.24/libdm/dm-tools/dmfilemapd.c:659:52: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 1)’
#  657|   		}
#  658|   
#  659|-> 		if ((dup2(fd, STDIN_FILENO) == -1) ||
#  660|   		    (dup2(fd, STDOUT_FILENO) == -1) ||
#  661|   		    (dup2(fd, STDERR_FILENO) == -1)) {

Error: GCC_ANALYZER_WARNING (CWE-775): [#def61]
lvm2-2.03.24-build/LVM2.2.03.24/libdm/dm-tools/dmfilemapd.c:660:53: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘dup2(open("/dev/null", 2), 2)’
#  658|   
#  659|   		if ((dup2(fd, STDIN_FILENO) == -1) ||
#  660|-> 		    (dup2(fd, STDOUT_FILENO) == -1) ||
#  661|   		    (dup2(fd, STDERR_FILENO) == -1)) {
#  662|   			if (fd > STDERR_FILENO)

Error: GCC_ANALYZER_WARNING (CWE-775): [#def62]
lvm2-2.03.24-build/LVM2.2.03.24/libdm/dm-tools/dmfilemapd.c:662:28: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
#  660|   		    (dup2(fd, STDOUT_FILENO) == -1) ||
#  661|   		    (dup2(fd, STDERR_FILENO) == -1)) {
#  662|-> 			if (fd > STDERR_FILENO)
#  663|   				(void) close(fd);
#  664|   			_early_log("Error redirecting stdin/out/err to null.");

Error: GCC_ANALYZER_WARNING (CWE-775): [#def63]
lvm2-2.03.24-build/LVM2.2.03.24/libdm/dm-tools/dmfilemapd.c:668:20: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘open("/dev/null", 2)’
#  666|   			return 0;
#  667|   		}
#  668|-> 		if (fd > STDERR_FILENO)
#  669|   			(void) close(fd);
#  670|   	}

Error: CLANG_WARNING: [#def64]
lvm2-2.03.24-build/LVM2.2.03.24/libdm/dm-tools/dmsetup.c:567:3: warning[unix.Malloc]: Argument to free() is the address of a global variable, which is not memory allocated by malloc()
#  565|   	 */
#  566|   	if (!strcmp(split_name->subsystem, "LVM"))
#  567|-> 		free(split_name->vg_name);
#  568|   
#  569|   	free(split_name->subsystem);

Error: GCC_ANALYZER_WARNING (CWE-590): [#def65]
lvm2-2.03.24-build/LVM2.2.03.24/libdm/dm-tools/dmsetup.c: scope_hint: In function ‘_destroy_split_name’
lvm2-2.03.24-build/LVM2.2.03.24/libdm/dm-tools/dmsetup.c:567:17: warning[-Wanalyzer-free-of-non-heap]: ‘free’ of ‘""’ which points to memory not on the heap
#  565|   	 */
#  566|   	if (!strcmp(split_name->subsystem, "LVM"))
#  567|-> 		free(split_name->vg_name);
#  568|   
#  569|   	free(split_name->subsystem);

Error: CLANG_WARNING: [#def66]
lvm2-2.03.24-build/LVM2.2.03.24/libdm/dm-tools/dmsetup.c:5512:2: warning[deadcode.DeadStores]: Value stored to 'fd' is never read
# 5510|   		log_sys_debug("close", abspath);
# 5511|   
# 5512|-> 	fd = -1;
# 5513|   
# 5514|   	for (region = regions; *region != DM_STATS_REGIONS_ALL; region++)

Error: CLANG_WARNING: [#def67]
lvm2-2.03.24-build/LVM2.2.03.24/libdm/libdm-stats.c:3435:3: warning[deadcode.DeadStores]: Value stored to 'area_id' is never read
# 3433|   		/* group aggregation */
# 3434|   		group_id = region_id;
# 3435|-> 		area_id = DM_STATS_WALK_GROUP;
# 3436|   		if (!_stats_group_id_present(dms, group_id))
# 3437|   			return_NULL;

Error: CLANG_WARNING: [#def68]
lvm2-2.03.24-build/LVM2.2.03.24/libdm/libdm-stats.c:4445:4: warning[deadcode.DeadStores]: Value stored to 'expected' is never read
# 4443|   			ext_copy(fm_pending, fm_ext + i);
# 4444|   		} else {
# 4445|-> 			expected = 0;
# 4446|   			/* Begin a new pending extent for extent 0. If there is
# 4447|   			 * a hole at the start of the file, the first allocated

Error: CLANG_WARNING: [#def69]
lvm2-2.03.24-build/LVM2.2.03.24/libdm/libdm-stats.c:4790:11: warning[core.NullDereference]: Dereference of null pointer
# 4788|   			if ((old_ext = _find_extent((uint64_t) nr_kept,
# 4789|   						    old_extents,
# 4790|-> 						    extents[i].start,
# 4791|   						    extents[i].len))) {
# 4792|   				regions[i] = old_ext->id;

Error: CLANG_WARNING: [#def70]
lvm2-2.03.24-build/LVM2.2.03.24/libdm/regex/ttree.c:99:13: warning[core.NullDereference]: Access to field 'data' results in a dereference of a null pointer
#   97|   		}
#   98|   	}
#   99|-> 	(*c)->data = data;
#  100|   
#  101|   	return 1;

Error: CLANG_WARNING: [#def71]
lvm2-2.03.24-build/LVM2.2.03.24/tools/lvconvert.c:4438:9: warning[deadcode.DeadStores]: Although the value stored to 'dev_fast' is used in the enclosing expression, the value is never actually read from 'dev_fast'
# 4436|   		}
# 4437|   
# 4438|-> 		if (!(dev_fast = dev_cache_get(cmd, device_name, cmd->filter))) {
# 4439|   			log_error("Device %s not found.", device_name);
# 4440|   			return 0;

Error: CLANG_WARNING: [#def72]
lvm2-2.03.24-build/LVM2.2.03.24/tools/lvconvert.c:6378:8: warning[deadcode.DeadStores]: Although the value stored to 'lv_wcorig' is used in the enclosing expression, the value is never actually read from 'lv_wcorig'
# 6376|   	 */
# 6377|   
# 6378|-> 	if (!(lv_wcorig = _lv_writecache_create(cmd, lv_update, lv_fast, block_size_sectors, &settings)))
# 6379|   		goto_bad;
# 6380|   

Error: GCC_ANALYZER_WARNING (CWE-126): [#def73]
lvm2-2.03.24-build/LVM2.2.03.24/tools/man-generator.c: scope_hint: In function ‘_print_val_man’
lvm2-2.03.24-build/LVM2.2.03.24/tools/man-generator.c:218:29: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
lvm2-2.03.24-build/LVM2.2.03.24/tools/man-generator.c:110: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/tools/man-generator.c:218:29: note: read of 1 byte from after the end of the region
#                                                       └─────────────────┘
#                                                                ^
lvm2-2.03.24-build/LVM2.2.03.24/tools/man-generator.c:17: included_from: Included from here.
/usr/include/string.h:350:14: note: argument 1 of ‘strstr’ must be a pointer to a null-terminated string
#  216|   			}
#  217|   
#  218|-> 			if (strstr(line_argv[i], "Number"))
#  219|   				printf("\\fI%s\\fP", line_argv[i]);
#  220|   			else

Error: CLANG_WARNING: [#def74]
lvm2-2.03.24-build/LVM2.2.03.24/tools/man-generator.c:375:5: warning[deadcode.DeadStores]: Value stored to 'need_ro_indent_end' is never read
#  373|   			if ((cmd->ro_count > 2) && (sep == 2)) {
#  374|   				printf("\n.RS 5\n");
#  375|-> 				need_ro_indent_end = 1;
#  376|   			}
#  377|   

Error: CLANG_WARNING: [#def75]
lvm2-2.03.24-build/LVM2.2.03.24/tools/pvck.c:530:3: warning[deadcode.DeadStores]: Value stored to 'p' is never read
#  528|   		memset(line, 0, sizeof(line));
#  529|   		_copy_line(p, line, &len, sizeof(line)-1);
#  530|-> 		p += len;
#  531|   
#  532|   		if (strncmp(line, "seqno = ", 8)) {

Error: GCC_ANALYZER_WARNING (CWE-122): [#def76]
lvm2-2.03.24-build/LVM2.2.03.24/tools/pvck.c: scope_hint: In function ‘_check_metadata_file’
lvm2-2.03.24-build/LVM2.2.03.24/tools/pvck.c:2910:21: warning[-Wanalyzer-out-of-bounds]: heap-based buffer over-read
lvm2-2.03.24-build/LVM2.2.03.24/device_mapper/all.h:27: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/tools/tool.h:22: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/tools/tools.h:19: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/tools/pvck.c:17: included_from: Included from here.
lvm2-2.03.24-build/LVM2.2.03.24/tools/tools.h:48: included_from: Included from here.
#                                                       └─────────────────┘
#                                                                ^
# 2908|   	if (text_buf[text_size-1] != '\0' ||
# 2909|   	    text_buf[text_size-2] != '\n' ||
# 2910|-> 	    text_buf[text_size-3] != '\n')
# 2911|   		log_warn("WARNING: unexpected final bytes of raw metadata, expected \\n\\n\\0.");
# 2912|   

Error: CLANG_WARNING: [#def77]
lvm2-2.03.24-build/LVM2.2.03.24/tools/pvscan.c:981:25: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  979|   		online_pvid_file_read(path, &major, &minor, file_vgname, file_devname);
#  980|   
#  981|-> 		if (file_vgname[0] && strcmp(vg->name, file_vgname)) {
#  982|   			log_warn("WARNING: VG %s PV %s wrong vgname in online file %s",
#  983|   				  vg->name, pvid, file_vgname);

Error: CLANG_WARNING: [#def78]
lvm2-2.03.24-build/LVM2.2.03.24/tools/pvscan.c:1171:4: warning[deadcode.DeadStores]: Value stored to 'vg_complete' is never read
# 1169|   			pvs_offline = 0;
# 1170|   			pvs_unknown = 0;
# 1171|-> 			vg_complete = 0;
# 1172|   
# 1173|   			if (vg) {

Error: CLANG_WARNING: [#def79]
lvm2-2.03.24-build/LVM2.2.03.24/tools/toollib.c:2927:9: warning[deadcode.DeadStores]: Although the value stored to 'type' is used in the enclosing expression, the value is never actually read from 'type'
# 2925|   			continue;
# 2926|   
# 2927|-> 		if (!(type = get_lv_type(lvt_enum)))
# 2928|   			continue;
# 2929|   

Error: CLANG_WARNING: [#def80]
lvm2-2.03.24-build/LVM2.2.03.24/tools/toollib.c:2973:9: warning[deadcode.DeadStores]: Although the value stored to 'prop' is used in the enclosing expression, the value is never actually read from 'prop'
# 2971|   			continue;
# 2972|   
# 2973|-> 		if (!(prop = get_lv_prop(lvp_enum)))
# 2974|   			continue;
# 2975|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def81]
lvm2-2.03.24-build/LVM2.2.03.24/tools/vgcfgbackup.c: scope_hint: In function ‘_vg_backup_single’
lvm2-2.03.24-build/LVM2.2.03.24/tools/vgcfgbackup.c:68:20: warning[-Wanalyzer-malloc-leak]: leak of ‘_expand_filename(arg_value(cmd, 195), *vg.name,  last_filename)’
#   66|   			return_ECMD_FAILED;
#   67|   
#   68|-> 		if (!backup_to_file(filename, vg->cmd->cmd_line, vg))
#   69|   			return_ECMD_FAILED;
#   70|   	} else {

Error: CLANG_WARNING: [#def82]
lvm2-2.03.24-build/LVM2.2.03.24/tools/vgchange.c:1281:10: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1279|   				lv_lock_count++;
# 1280|   
# 1281|-> 				if (!strcmp(lock_type, "dlm"))
# 1282|   					lv->lock_args = "dlm";
# 1283|   			}

Error: CLANG_WARNING: [#def83]
lvm2-2.03.24-build/LVM2.2.03.24/tools/vgchange.c:1291:8: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
# 1289|   		 * the lock_args during stage 1.
# 1290|   		 */
# 1291|-> 		if (!strcmp(lock_type, "sanlock"))
# 1292|   			vg->skip_validate_lock_args = 1;
# 1293|   

Error: GCC_ANALYZER_WARNING (CWE-401): [#def84]
lvm2-2.03.24-build/LVM2.2.03.24/tools/vgimportclone.c: scope_hint: In function ‘_get_other_devs’
lvm2-2.03.24-build/LVM2.2.03.24/tools/vgimportclone.c:191:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
lvm2-2.03.24-build/LVM2.2.03.24/tools/vgimportclone.c: scope_hint: In function ‘_get_other_devs’
#  189|   		}
#  190|   		devl->dev = dev;
#  191|-> 		dm_list_add(other_devs, &devl->list);
#  192|   	}
#  193|   bad:

Error: GCC_ANALYZER_WARNING (CWE-401): [#def85]
lvm2-2.03.24-build/LVM2.2.03.24/tools/vgimportclone.c: scope_hint: In function ‘vgimportclone’
lvm2-2.03.24-build/LVM2.2.03.24/tools/vgimportclone.c:274:17: warning[-Wanalyzer-malloc-leak]: leak of ‘calloc(1, 24)’
lvm2-2.03.24-build/LVM2.2.03.24/tools/vgimportclone.c: scope_hint: In function ‘vgimportclone’
#  272|   
#  273|   		devl->dev = dev;
#  274|-> 		dm_list_add(&vp.new_devs, &devl->list);
#  275|   	}
#  276|   

Error: CLANG_WARNING: [#def86]
lvm2-2.03.24-build/LVM2.2.03.24/tools/vgsplit.c:565:8: warning[deadcode.DeadStores]: Although the value stored to 'vginfo_to' is used in the enclosing expression, the value is never actually read from 'vginfo_to'
#  563|   		return_ECMD_FAILED;
#  564|   
#  565|-> 	if (!(vginfo_to = lvmcache_vginfo_from_vgname(vg_name_to, NULL))) {
#  566|   		if (!validate_name(vg_name_to)) {
#  567|   			log_error("Invalid vg name %s.", vg_name_to);

Scan Properties

analyzer-version-clang18.1.7
analyzer-version-cppcheck2.14.2
analyzer-version-gcc14.1.1
analyzer-version-gcc-analyzer14.1.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-213.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namelvm2-2.03.24-3.fc41
store-results-to/tmp/tmp3wxqwdje/lvm2-2.03.24-3.fc41.tar.xz
time-created2024-07-03 16:13:43
time-finished2024-07-03 16:19:01
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmp3wxqwdje/lvm2-2.03.24-3.fc41.tar.xz' '--gcc-analyze' '/tmp/tmp3wxqwdje/lvm2-2.03.24-3.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9