Fixed defects

List of Defects

Error: GCC_ANALYZER_WARNING (CWE-401): [#def1]
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-internal.h:203:17: warning[-Wanalyzer-malloc-leak]: leak of 'new_ht_entry'
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-writer-erofs.c: scope_hint: In function 'lcfs_build_node_from_image'
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-internal.h:29: included_from: Included from here.
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-writer-erofs.c:1851:13: note: in expansion of macro 'lcfs_u32_from_file'
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-writer-erofs.c:1856:13: note: in expansion of macro 'lcfs_u32_from_file'
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-writer-erofs.c:1863:13: note: in expansion of macro 'lcfs_u32_from_file'
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-writer-erofs.c:1870:17: note: in expansion of macro 'lcfs_u32_from_file'
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-writer-erofs.c: scope_hint: In function 'lcfs_build_node_from_image'
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-writer-erofs.c:25: included_from: Included from here.
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-erofs-internal.h:44:29: note: in expansion of macro 'lcfs_u16_from_file'
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-writer-erofs.c: scope_hint: In function 'lcfs_build_node_from_image'
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-writer-erofs.c:1482:32: note: in expansion of macro 'lcfs_u64_from_file'
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-writer-erofs.c: scope_hint: In function 'lcfs_build_node_from_image'
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-utils.h:23: included_from: Included from here.
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-writer-erofs.c:22: included_from: Included from here.
#  201|   {
#  202|   	if (*nodep != NULL) {
#  203|-> 		lcfs_node_unref(*nodep);
#  204|   		*nodep = NULL;
#  205|   	}

Error: CLANG_WARNING: [#def2]
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-mount.c:422:7: warning[unix.Malloc]: Potential leak of memory pointed to by 'opt'
#  420|   		strcat(opt, objdir);
#  421|   
#  422|-> 		res = syscall_fsconfig(fd_fs, FSCONFIG_SET_STRING, "lowerdir",
#  423|   				       opt, 0);
#  424|   		if (res < 0) {

Error: CLANG_WARNING: [#def3]
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-writer-erofs.c:356:9: warning[unix.Malloc]: Potential leak of memory pointed to by 'new_ent'
#  354|   				}
#  355|   				new_ent->xattr = &node->xattrs[i];
#  356|-> 				ent = hash_insert(xattr_hash, new_ent);
#  357|   				if (ent == NULL) {
#  358|   					goto fail;

Error: GCC_ANALYZER_WARNING (CWE-457): [#def4]
composefs-1.0.3-build/composefs-1.0.3/tools/composefs-info.c: scope_hint: In function ‘print_escaped’
composefs-1.0.3-build/composefs-1.0.3/tools/composefs-info.c:60:23: warning[-Wanalyzer-use-of-uninitialized-value]: use of uninitialized value ‘*val’
composefs-1.0.3-build/composefs-1.0.3/tools/composefs-info.c:33: included_from: Included from here.
composefs-1.0.3-build/composefs-1.0.3/libcomposefs/lcfs-utils.h:22: included_from: Included from here.
composefs-1.0.3-build/composefs-1.0.3/tools/composefs-info.c:23: included_from: Included from here.
/usr/include/string.h:407:15: note: argument 1 of ‘strlen’ must be a pointer to a null-terminated string
#   58|   
#   59|   	if (len < 0)
#   60|-> 		len = strlen(val);
#   61|   
#   62|   	if (escape_lone_dash && len == 1 && val[0] == '-') {

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
diffbase-analyzer-version-clang18.1.7
diffbase-analyzer-version-cppcheck2.14.2
diffbase-analyzer-version-gcc14.1.1
diffbase-analyzer-version-gcc-analyzer14.1.1
diffbase-analyzer-version-shellcheck0.10.0
diffbase-enabled-pluginsclang, cppcheck, gcc, shellcheck
diffbase-exit-code0
diffbase-hostip-172-16-1-40.us-west-2.compute.internal
diffbase-mock-configfedora-41-x86_64
diffbase-project-namecomposefs-1.0.4-1.fc41
diffbase-store-results-to/tmp/tmpw69xlp74/composefs-1.0.4-1.fc41.tar.xz
diffbase-time-created2024-07-03 12:09:17
diffbase-time-finished2024-07-03 12:10:26
diffbase-toolcsmock
diffbase-tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpw69xlp74/composefs-1.0.4-1.fc41.tar.xz' '--gcc-analyze' '/tmp/tmpw69xlp74/composefs-1.0.4-1.fc41.src.rpm'
diffbase-tool-versioncsmock-3.5.3-1.el9
enabled-pluginsclang, cppcheck, gcc, shellcheck
exit-code0
hostip-172-16-1-40.us-west-2.compute.internal
mock-configfedora-41-x86_64
project-namecomposefs-1.0.3-1.fc40
store-results-to/tmp/tmpee0gs7gi/composefs-1.0.3-1.fc40.tar.xz
time-created2024-07-03 12:07:34
time-finished2024-07-03 12:09:09
titleFixed defects
toolcsmock
tool-args'/usr/bin/csmock' '-r' 'fedora-41-x86_64' '-t' 'cppcheck,gcc,clang,shellcheck' '-o' '/tmp/tmpee0gs7gi/composefs-1.0.3-1.fc40.tar.xz' '--gcc-analyze' '/tmp/tmpee0gs7gi/composefs-1.0.3-1.fc40.src.rpm'
tool-versioncsmock-3.5.3-1.el9