cryptsetup-2.7.2-1.fc41

List of Defects

Error: CLANG_WARNING: [#def1]
cryptsetup-2.7.2/lib/luks2/luks2_reencrypt.c:1872:6: warning[core.NullDereference]: Access to field 'digest_new' results in a dereference of a null pointer (loaded from variable 'rh')
# 1870|   
# 1871|   	/* FIXME: validate in reencrypt context load */
# 1872|-> 	if (rh->digest_new < 0 && rh->mode != CRYPT_REENCRYPT_DECRYPT)
# 1873|   		return -EINVAL;
# 1874|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def2]
cryptsetup-2.7.2/lib/utils.c: scope_hint: In function 'crypt_keyfile_device_read'
cryptsetup-2.7.2/lib/utils.c:331:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor '<unknown>'
cryptsetup-2.7.2/lib/utils.c:31: included_from: Included from here.
cryptsetup-2.7.2/lib/internal.h:190:57: note: in definition of macro 'log_err'
cryptsetup-2.7.2/lib/utils.c:220:29: note: in expansion of macro '_'
#  329|   	r = 0;
#  330|   out:
#  331|-> 	if (fd != STDIN_FILENO)
#  332|   		close(fd);
#  333|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def3]
cryptsetup-2.7.2/lib/utils_keyring.c: scope_hint: In function 'find_key_by_type_and_desc'
cryptsetup-2.7.2/lib/utils_keyring.c:173:21: warning[-Wanalyzer-fd-leak]: leak of file descriptor 'open("/proc/keys", 0)'
cryptsetup-2.7.2/lib/utils_keyring.c:22: included_from: Included from here.
#  171|   		return 0;
#  172|   
#  173|-> 	while ((n = read(f, buf + buffer_len, sizeof(buf) - buffer_len - 1)) > 0) {
#  174|   		buffer_len += n;
#  175|   		buf[buffer_len] = '\0';

Error: GCC_ANALYZER_WARNING (CWE-775): [#def4]
cryptsetup-2.7.2/src/utils_luks.c: scope_hint: In function ‘tools_read_json_file’
cryptsetup-2.7.2/src/utils_luks.c:227:16: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘fd’
cryptsetup-2.7.2/src/utils_luks.c:23: included_from: Included from here.
cryptsetup-2.7.2/src/utils_luks.c:183:17: note: in expansion of macro ‘log_dbg’
#  225|   		free(buf);
#  226|   	}
#  227|-> 	return r;
#  228|   }
#  229|   

Error: GCC_ANALYZER_WARNING (CWE-775): [#def5]
cryptsetup-2.7.2/src/utils_reencrypt_luks1.c: scope_hint: In function ‘parse_log’
cryptsetup-2.7.2/src/utils_reencrypt_luks1.c:281:12: warning[-Wanalyzer-fd-leak]: leak of file descriptor ‘*rc.log_fd’
cryptsetup-2.7.2/src/cryptsetup.h:33: included_from: Included from here.
cryptsetup-2.7.2/src/utils_reencrypt_luks1.c:26: included_from: Included from here.
cryptsetup-2.7.2/src/cryptsetup.h:134:58: note: in definition of macro ‘log_std’
cryptsetup-2.7.2/src/utils_reencrypt_luks1.c:320:25: note: in expansion of macro ‘_’
#  279|   
#  280|   	s = read(rc->log_fd, rc->log_buf, SECTOR_SIZE);
#  281|-> 	if (s == -1) {
#  282|   		log_err(_("Cannot read reencryption log file."));
#  283|   		return -EIO;

Scan Properties

analyzer-version-clang18.1.3
analyzer-version-cppcheck2.13.0
analyzer-version-gcc14.0.1
analyzer-version-gcc-analyzer14.0.1
analyzer-version-shellcheck0.10.0
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-220.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namecryptsetup-2.7.2-1.fc41
store-results-to/tmp/tmpbkbavy5x/cryptsetup-2.7.2-1.fc41.tar.xz
time-created2024-04-22 10:45:52
time-finished2024-04-22 10:47:44
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpbkbavy5x/cryptsetup-2.7.2-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpbkbavy5x/cryptsetup-2.7.2-1.fc41.src.rpm'
tool-versioncsmock-3.5.3-1.el9