Task #182 - added.err

back to task #182
download
Error: SHELLCHECK_WARNING (CWE-149):
/usr/sbin/xfs_metadump:23:20: warning[SC2027]: The surrounding quotes actually unquote this. Remove or escape them.
#   21|   	l)	DBOPTS=$DBOPTS" -l "$OPTARG" ";;
#   22|   	F)	DBOPTS=$DBOPTS" -F";;
#   23|-> 	v)	OPTS=$OPTS"-v "$OPTARG" ";;
#   24|   	V)	xfs_db -p xfs_metadump -V
#   25|   		status=$?

Error: CLANG_WARNING:
xfsprogs-6.7.0/mdrestore/xfs_mdrestore.c:125:6: warning[core.NonNullParamChecker]: Null pointer passed to 1st parameter expecting 'nonnull'
#  123|   	*is_file = false;
#  124|   
#  125|-> 	if (stat(path, &statbuf) < 0)  {
#  126|   		/* ok, assume it's a file and create it */
#  127|   		open_flags |= O_CREAT;

Error: GCC_ANALYZER_WARNING (CWE-688):
xfsprogs-6.7.0/mdrestore/xfs_mdrestore.c: scope_hint: In function ‘open_device’
xfsprogs-6.7.0/mdrestore/xfs_mdrestore.c:125:13: warning[-Wanalyzer-null-argument]: use of NULL ‘path’ where non-null expected
xfsprogs-6.7.0/include/libxfs.h:27: included_from: Included from here.
xfsprogs-6.7.0/mdrestore/xfs_mdrestore.c:7: included_from: Included from here.
xfsprogs-6.7.0/include/xfs_arch.h:134:31: note: in definition of macro ‘__swab32’
xfsprogs-6.7.0/mdrestore/xfs_mdrestore.c:555:17: note: in expansion of macro ‘be32_to_cpu’
/usr/include/features.h:511: included_from: Included from here.
/usr/include/bits/libc-header-start.h:33: included_from: Included from here.
/usr/include/stdio.h:28: included_from: Included from here.
xfsprogs-6.7.0/include/platform_defs.h:9: included_from: Included from here.
xfsprogs-6.7.0/include/libxfs.h:11: included_from: Included from here.
/usr/include/sys/stat.h:227:12: note: argument 1 of ‘stat’ must be non-null
#  123|   	*is_file = false;
#  124|   
#  125|-> 	if (stat(path, &statbuf) < 0)  {
#  126|   		/* ok, assume it's a file and create it */
#  127|   		open_flags |= O_CREAT;

Error: CLANG_WARNING:
xfsprogs-6.7.0/mdrestore/xfs_mdrestore.c:407:6: warning[unix.StdCLibraryFunctions]: The 1st argument to 'fread' is NULL but should not be NULL
#  405|   	len = BBTOB(be32_to_cpu(xme.xme_len));
#  406|   
#  407|-> 	if (fread(block_buffer, len, 1, md_fp) != 1)
#  408|   		fatal("error reading from metadump file\n");
#  409|   

Error: CLANG_WARNING:
xfsprogs-6.7.0/mdrestore/xfs_mdrestore.c:415:50: warning[core.NullDereference]: Access to field 'sb_inprogress' results in a dereference of a null pointer (loaded from variable 'block_buffer')
#  413|   		fatal("bad magic number for primary superblock\n");
#  414|   
#  415|-> 	((struct xfs_dsb *)block_buffer)->sb_inprogress = 1;
#  416|   
#  417|   	verify_device_size(ddev_fd, is_data_target_file, sb.sb_dblocks,

Error: CLANG_WARNING:
xfsprogs-6.7.0/mdrestore/xfs_mdrestore.c:461:3: warning[core.CallAndMessage]: 2nd function call argument is an uninitialized value
#  459|   		len = BBTOB(be32_to_cpu(xme.xme_len));
#  460|   
#  461|-> 		restore_meta_extent(md_fp, fd, device, block_buffer, offset,
#  462|   				len);
#  463|