Flawfinder version 2.0.10, (C) 2001-2019 David A. Wheeler. Number of rules (primarily dangerous function names) in C/C++ ruleset: 223 Examining data/partclone-0.3.13+dfsg/src/apfsclone.c Examining data/partclone-0.3.13+dfsg/src/apfsclone.h Examining data/partclone-0.3.13+dfsg/src/bitmap.h Examining data/partclone-0.3.13+dfsg/src/btrfs/bitops.h Examining data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c Examining data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.h Examining data/partclone-0.3.13+dfsg/src/btrfs/btrfsck.h Examining data/partclone-0.3.13+dfsg/src/btrfs/commands.h Examining data/partclone-0.3.13+dfsg/src/btrfs/crc32c.c Examining data/partclone-0.3.13+dfsg/src/btrfs/crc32c.h Examining data/partclone-0.3.13+dfsg/src/btrfs/ctree.c Examining data/partclone-0.3.13+dfsg/src/btrfs/ctree.h Examining data/partclone-0.3.13+dfsg/src/btrfs/dir-item.c Examining data/partclone-0.3.13+dfsg/src/btrfs/disk-io.c Examining data/partclone-0.3.13+dfsg/src/btrfs/disk-io.h Examining data/partclone-0.3.13+dfsg/src/btrfs/extent-cache.c Examining data/partclone-0.3.13+dfsg/src/btrfs/extent-cache.h Examining data/partclone-0.3.13+dfsg/src/btrfs/extent-tree.c Examining data/partclone-0.3.13+dfsg/src/btrfs/extent_io.c Examining data/partclone-0.3.13+dfsg/src/btrfs/extent_io.h Examining data/partclone-0.3.13+dfsg/src/btrfs/file-item.c Examining data/partclone-0.3.13+dfsg/src/btrfs/free-space-cache.c Examining data/partclone-0.3.13+dfsg/src/btrfs/free-space-cache.h Examining data/partclone-0.3.13+dfsg/src/btrfs/hash.h Examining data/partclone-0.3.13+dfsg/src/btrfs/inode-item.c Examining data/partclone-0.3.13+dfsg/src/btrfs/inode-map.c Examining data/partclone-0.3.13+dfsg/src/btrfs/internal.h Examining data/partclone-0.3.13+dfsg/src/btrfs/ioctl.h Examining data/partclone-0.3.13+dfsg/src/btrfs/kerncompat.h Examining data/partclone-0.3.13+dfsg/src/btrfs/list.h Examining data/partclone-0.3.13+dfsg/src/btrfs/list_sort.c Examining data/partclone-0.3.13+dfsg/src/btrfs/list_sort.h Examining data/partclone-0.3.13+dfsg/src/btrfs/math.h Examining data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c Examining data/partclone-0.3.13+dfsg/src/btrfs/print-tree.h Examining data/partclone-0.3.13+dfsg/src/btrfs/qgroup-verify.c Examining data/partclone-0.3.13+dfsg/src/btrfs/qgroup-verify.h Examining data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c Examining data/partclone-0.3.13+dfsg/src/btrfs/qgroup.h Examining data/partclone-0.3.13+dfsg/src/btrfs/radix-tree.c Examining data/partclone-0.3.13+dfsg/src/btrfs/radix-tree.h Examining data/partclone-0.3.13+dfsg/src/btrfs/raid6.c Examining data/partclone-0.3.13+dfsg/src/btrfs/rbtree-utils.c Examining data/partclone-0.3.13+dfsg/src/btrfs/rbtree-utils.h Examining data/partclone-0.3.13+dfsg/src/btrfs/rbtree.c Examining data/partclone-0.3.13+dfsg/src/btrfs/rbtree.h Examining data/partclone-0.3.13+dfsg/src/btrfs/rbtree_augmented.h Examining data/partclone-0.3.13+dfsg/src/btrfs/repair.c Examining data/partclone-0.3.13+dfsg/src/btrfs/repair.h Examining data/partclone-0.3.13+dfsg/src/btrfs/root-tree.c Examining data/partclone-0.3.13+dfsg/src/btrfs/send-stream.c Examining data/partclone-0.3.13+dfsg/src/btrfs/send-stream.h Examining data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c Examining data/partclone-0.3.13+dfsg/src/btrfs/send-utils.h Examining data/partclone-0.3.13+dfsg/src/btrfs/send.h Examining data/partclone-0.3.13+dfsg/src/btrfs/transaction.h Examining data/partclone-0.3.13+dfsg/src/btrfs/ulist.c Examining data/partclone-0.3.13+dfsg/src/btrfs/ulist.h Examining data/partclone-0.3.13+dfsg/src/btrfs/utils-lib.c Examining data/partclone-0.3.13+dfsg/src/btrfs/utils.c Examining data/partclone-0.3.13+dfsg/src/btrfs/utils.h Examining data/partclone-0.3.13+dfsg/src/btrfs/uuid-tree.c Examining data/partclone-0.3.13+dfsg/src/btrfs/version.h Examining data/partclone-0.3.13+dfsg/src/btrfs/volumes.c Examining data/partclone-0.3.13+dfsg/src/btrfs/volumes.h Examining data/partclone-0.3.13+dfsg/src/btrfsclone.c Examining data/partclone-0.3.13+dfsg/src/btrfsclone.h Examining data/partclone-0.3.13+dfsg/src/checksum.c Examining data/partclone-0.3.13+dfsg/src/checksum.h Examining data/partclone-0.3.13+dfsg/src/ddclone.c Examining data/partclone-0.3.13+dfsg/src/ddclone.h Examining data/partclone-0.3.13+dfsg/src/deplib_version.c Examining data/partclone-0.3.13+dfsg/src/exfat/byteorder.h Examining data/partclone-0.3.13+dfsg/src/exfat/cluster.c Examining data/partclone-0.3.13+dfsg/src/exfat/compiler.h Examining data/partclone-0.3.13+dfsg/src/exfat/exfat.h Examining data/partclone-0.3.13+dfsg/src/exfat/exfatfs.h Examining data/partclone-0.3.13+dfsg/src/exfat/io.c Examining data/partclone-0.3.13+dfsg/src/exfat/log.c Examining data/partclone-0.3.13+dfsg/src/exfat/lookup.c Examining data/partclone-0.3.13+dfsg/src/exfat/mount.c Examining data/partclone-0.3.13+dfsg/src/exfat/node.c Examining data/partclone-0.3.13+dfsg/src/exfat/platform.h Examining data/partclone-0.3.13+dfsg/src/exfat/time.c Examining data/partclone-0.3.13+dfsg/src/exfat/utf.c Examining data/partclone-0.3.13+dfsg/src/exfat/utils.c Examining data/partclone-0.3.13+dfsg/src/exfat/version.h Examining data/partclone-0.3.13+dfsg/src/exfatclone.c Examining data/partclone-0.3.13+dfsg/src/exfatclone.h Examining data/partclone-0.3.13+dfsg/src/extfsclone.c Examining data/partclone-0.3.13+dfsg/src/extfsclone.h Examining data/partclone-0.3.13+dfsg/src/f2fs/clone.c Examining data/partclone-0.3.13+dfsg/src/f2fs/f2fs.h Examining data/partclone-0.3.13+dfsg/src/f2fs/f2fs_fs.h Examining data/partclone-0.3.13+dfsg/src/f2fs/fsck.c Examining data/partclone-0.3.13+dfsg/src/f2fs/fsck.h Examining data/partclone-0.3.13+dfsg/src/f2fs/libf2fs.c Examining data/partclone-0.3.13+dfsg/src/f2fs/list.h Examining data/partclone-0.3.13+dfsg/src/f2fs/mount.c Examining data/partclone-0.3.13+dfsg/src/f2fsclone.c Examining data/partclone-0.3.13+dfsg/src/f2fsclone.h Examining data/partclone-0.3.13+dfsg/src/fatclone.c Examining data/partclone-0.3.13+dfsg/src/fatclone.h Examining data/partclone-0.3.13+dfsg/src/fs_common.h Examining data/partclone-0.3.13+dfsg/src/fstype.c Examining data/partclone-0.3.13+dfsg/src/fuseimg.c Examining data/partclone-0.3.13+dfsg/src/gettext.h Examining data/partclone-0.3.13+dfsg/src/hfsplusclone.c Examining data/partclone-0.3.13+dfsg/src/hfsplusclone.h Examining data/partclone-0.3.13+dfsg/src/info.c Examining data/partclone-0.3.13+dfsg/src/jfsclone.c Examining data/partclone-0.3.13+dfsg/src/jfsclone.h Examining data/partclone-0.3.13+dfsg/src/main.c Examining data/partclone-0.3.13+dfsg/src/minixclone.c Examining data/partclone-0.3.13+dfsg/src/minixclone.h Examining data/partclone-0.3.13+dfsg/src/nilfsclone.c Examining data/partclone-0.3.13+dfsg/src/nilfsclone.h Examining data/partclone-0.3.13+dfsg/src/ntfsclone-ng.c Examining data/partclone-0.3.13+dfsg/src/ntfsclone-ng.h Examining data/partclone-0.3.13+dfsg/src/ntfsfixboot.c Examining data/partclone-0.3.13+dfsg/src/progress.c Examining data/partclone-0.3.13+dfsg/src/readblock.c Examining data/partclone-0.3.13+dfsg/src/reiser4clone.c Examining data/partclone-0.3.13+dfsg/src/reiser4clone.h Examining data/partclone-0.3.13+dfsg/src/reiserfsclone.h Examining data/partclone-0.3.13+dfsg/src/torrent_helper.c Examining data/partclone-0.3.13+dfsg/src/torrent_helper.h Examining data/partclone-0.3.13+dfsg/src/ufs/ffs/fs.h Examining data/partclone-0.3.13+dfsg/src/ufs/libufs.h Examining data/partclone-0.3.13+dfsg/src/ufs/sys/disklabel.h Examining data/partclone-0.3.13+dfsg/src/ufs/ufs/dinode.h Examining data/partclone-0.3.13+dfsg/src/ufs/ufs/fs.h Examining data/partclone-0.3.13+dfsg/src/ufsclone.c Examining data/partclone-0.3.13+dfsg/src/ufsclone.h Examining data/partclone-0.3.13+dfsg/src/version.h Examining data/partclone-0.3.13+dfsg/src/vmfs5clone.c Examining data/partclone-0.3.13+dfsg/src/vmfsclone.c Examining data/partclone-0.3.13+dfsg/src/vmfsclone.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/atomic.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/bitops.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/cache.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/command.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/darwin.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/freebsd.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/gnukfreebsd.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/handle.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/hlist.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/input.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/irix.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/jdm.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/kmem.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/libxcmd.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/libxfs.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/libxlog.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/linux.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/list.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/parent.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/path.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/platform_defs.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/project.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/radix-tree.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs/handle.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs/jdm.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs/linux.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs/xfs.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs/xfs_arch.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs/xfs_fs.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs/xfs_types.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs/xqm.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs_arch.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs_btree_trace.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs_inode.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs_log_recover.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs_metadump.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs_mount.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs_multidisk.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs_trace.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xfs_trans.h Examining data/partclone-0.3.13+dfsg/src/xfs/include/xqm.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/cache.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/crc32.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/crc32defs.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/crc32table.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/darwin.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/defer_item.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/freebsd.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/gen_crc32table.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/init.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/init.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/irix.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/kmem.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/libxfs_api_defs.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/libxfs_io.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/libxfs_priv.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/linux.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/list_sort.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/logitem.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/radix-tree.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/rdwr.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/trans.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/util.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_ag_resv.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_ag_resv.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_alloc.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_alloc.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_alloc_btree.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_alloc_btree.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_remote.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_remote.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_sf.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_bit.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_bit.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_bmap.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_bmap.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_bmap_btree.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_bmap_btree.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_btree.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_btree.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_cksum.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_da_btree.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_da_btree.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_da_format.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_da_format.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_defer.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_defer.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_block.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_data.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_leaf.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_node.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_priv.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_sf.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dquot_buf.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_format.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_fs.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_ialloc.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_ialloc.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_ialloc_btree.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_ialloc_btree.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_buf.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_buf.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_fork.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_fork.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_log_format.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_log_rlimit.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_quota_defs.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_refcount.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_refcount.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_refcount_btree.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_refcount_btree.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_rmap.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_rmap.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_rmap_btree.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_rmap_btree.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_rtbitmap.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_sb.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_sb.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_shared.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_symlink_remote.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_trans_resv.c Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_trans_resv.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_trans_space.h Examining data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_types.h Examining data/partclone-0.3.13+dfsg/src/xfsclone.h Examining data/partclone-0.3.13+dfsg/src/reiserfsclone.c Examining data/partclone-0.3.13+dfsg/src/partclone.c Examining data/partclone-0.3.13+dfsg/src/partclone.h Examining data/partclone-0.3.13+dfsg/src/progress.h Examining data/partclone-0.3.13+dfsg/src/xfsclone.c FINAL RESULTS: data/partclone-0.3.13+dfsg/src/btrfs/send-stream.c:403:17: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. ret = s->ops->chmod(path, tmp, s->user); data/partclone-0.3.13+dfsg/src/btrfs/send-stream.c:409:17: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. ret = s->ops->chown(path, tmp, tmp2, s->user); data/partclone-0.3.13+dfsg/src/btrfs/send-stream.h:63:8: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. int (*chmod)(const char *path, u64 mode, void *user); data/partclone-0.3.13+dfsg/src/btrfs/send-stream.h:64:8: [5] (race) chown: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchown( ) instead. int (*chown)(const char *path, u64 uid, u64 gid, void *user); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:667:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(ri->path, args.name); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:668:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(ri->path, ri->name); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:825:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(full, dirid); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:826:2: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(full, name); data/partclone-0.3.13+dfsg/src/btrfs/kerncompat.h:263:30: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define printk(fmt, args...) fprintf(stderr, fmt, ##args) data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:317:3: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(path, ino_lookup_arg.name); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:1448:4: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buf, mkfs_features[i].name); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2047:8: [4] (buffer) fscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. If the scanf format is influenceable by an attacker, it's exploitable. ret = fscanf(f, fmt, loop_file); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2206:7: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(path, F_OK) == 0) data/partclone-0.3.13+dfsg/src/btrfs/utils.h:308:25: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__ ((format (printf, 1, 2))) data/partclone-0.3.13+dfsg/src/btrfs/utils.h:315:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, args); data/partclone-0.3.13+dfsg/src/btrfs/utils.h:320:25: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__ ((format (printf, 1, 2))) data/partclone-0.3.13+dfsg/src/btrfs/utils.h:327:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, args); data/partclone-0.3.13+dfsg/src/btrfs/utils.h:332:25: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__ ((format (printf, 2, 3))) data/partclone-0.3.13+dfsg/src/btrfs/utils.h:342:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, args); data/partclone-0.3.13+dfsg/src/btrfs/utils.h:349:25: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__ ((format (printf, 2, 3))) data/partclone-0.3.13+dfsg/src/btrfs/utils.h:359:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, args); data/partclone-0.3.13+dfsg/src/exfat/compiler.h:33:38: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define PRINTF __attribute__((format(printf, 1, 2))) data/partclone-0.3.13+dfsg/src/exfat/compiler.h:42:38: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define PRINTF __attribute__((format(printf, 1, 2))) data/partclone-0.3.13+dfsg/src/exfat/log.c:42:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/partclone-0.3.13+dfsg/src/exfat/log.c:66:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/partclone-0.3.13+dfsg/src/exfat/log.c:88:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/partclone-0.3.13+dfsg/src/exfat/log.c:107:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, format, ap); data/partclone-0.3.13+dfsg/src/exfat/node.c:1328:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(ef->label, label); data/partclone-0.3.13+dfsg/src/f2fs/f2fs_fs.h:65:4: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf("[%s:%4d] " #exp, __func__, __LINE__); \ data/partclone-0.3.13+dfsg/src/f2fs/f2fs_fs.h:66:4: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf("\n --> "fmt, ##__VA_ARGS__); \ data/partclone-0.3.13+dfsg/src/f2fs/f2fs_fs.h:82:3: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf("[%s:%d] " fmt, __func__, __LINE__, ##__VA_ARGS__); \ data/partclone-0.3.13+dfsg/src/f2fs/f2fs_fs.h:89:4: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(fmt, ##__VA_ARGS__); \ data/partclone-0.3.13+dfsg/src/f2fs/f2fs_fs.h:96:4: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf("[%s:%4d] " fmt, \ data/partclone-0.3.13+dfsg/src/f2fs/f2fs_fs.h:104:3: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf("%-30s" fmt, #member, ((ptr)->member)); \ data/partclone-0.3.13+dfsg/src/f2fs/f2fs_fs.h:130:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buf, len, #member); \ data/partclone-0.3.13+dfsg/src/f2fs/f2fs_fs.h:137:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buf, len, #member); \ data/partclone-0.3.13+dfsg/src/f2fs/f2fs_fs.h:143:3: [4] (format) snprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. snprintf(buf, len, #member); \ data/partclone-0.3.13+dfsg/src/main.c:454:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(torrent_name,"%s/torrent.info", target); data/partclone-0.3.13+dfsg/src/main.c:670:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(torrent_name,"%s/torrent.info", target); data/partclone-0.3.13+dfsg/src/main.c:1001:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(torrent_name,"%s/torrent.info", target); data/partclone-0.3.13+dfsg/src/ntfsfixboot.c:119:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(s, ap); data/partclone-0.3.13+dfsg/src/partclone.c:835:2: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. vsnprintf(tmp_str, sizeof(tmp_str), fmt, args); data/partclone-0.3.13+dfsg/src/partclone.c:1491:4: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(mount_p, mnt->mnt_dir); data/partclone-0.3.13+dfsg/src/partclone.c:1585:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(compresscmd, "%s >%s", opt->compresscmd, target); data/partclone-0.3.13+dfsg/src/partclone.c:1586:20: [4] (shell) popen: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. compress_pipe = popen(compresscmd, "w"); data/partclone-0.3.13+dfsg/src/partclone.c:1685:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(block_filename,"%s/%032llx", target, offset); data/partclone-0.3.13+dfsg/src/partclone.c:1901:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(bufstr, _("v%s"), img_head.ptc_version); data/partclone-0.3.13+dfsg/src/xfs/include/freebsd.h:105:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(buffer, s); data/partclone-0.3.13+dfsg/src/xfs/include/irix.h:315:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(buffer, s); data/partclone-0.3.13+dfsg/src/xfs/libxfs/linux.c:72:2: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(mounts, (!access(PROC_MOUNTED, R_OK)) ? PROC_MOUNTED : MOUNTED); data/partclone-0.3.13+dfsg/src/xfs/libxfs/linux.c:72:19: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. strcpy(mounts, (!access(PROC_MOUNTED, R_OK)) ? PROC_MOUNTED : MOUNTED); data/partclone-0.3.13+dfsg/src/xfs/libxfs/util.c:644:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, ap); data/partclone-0.3.13+dfsg/src/xfs/libxfs/util.c:659:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, ap); data/partclone-0.3.13+dfsg/src/xfs/libxfs/util.c:670:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, ap); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:1848:6: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (realpath(input, path)) { data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2033:7: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (!realpath(loop_dev, real_loop_dev)) data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2065:7: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (!realpath(a, real_a)) data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2068:7: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (!realpath(b, real_b)) data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2226:14: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. canonical = realpath(path, NULL); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3558:16: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. *mount_root = realpath(longest_match, NULL); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3921:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int c = getopt_long(argc, argv, "", long_options, NULL); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:4105:14: [3] (random) jrand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. return (u32)jrand48(rand_seed); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:4115:24: [3] (random) jrand48: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. return (unsigned int)(jrand48(rand_seed) % upper); data/partclone-0.3.13+dfsg/src/fuseimg.c:297:18: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. image_file = realpath(argv[argc-2], NULL); data/partclone-0.3.13+dfsg/src/info.c:72:17: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) { data/partclone-0.3.13+dfsg/src/partclone.c:417:14: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) { data/partclone-0.3.13+dfsg/src/partclone.c:1474:7: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (!realpath(device, real_file)) { data/partclone-0.3.13+dfsg/src/partclone.c:1487:8: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. if (!realpath(mnt->mnt_fsname, real_fsname)) data/partclone-0.3.13+dfsg/src/readblock.c:74:17: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while ((c = getopt_long(argc, argv, sopt, lopt, NULL)) != -1) { data/partclone-0.3.13+dfsg/src/apfsclone.c:51:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&apfs_spaceman, buf, sizeof(APFS_Block_8_5_Spaceman)); data/partclone-0.3.13+dfsg/src/apfsclone.c:65:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). APFSDEV = open(device, O_RDONLY); data/partclone-0.3.13+dfsg/src/apfsclone.c:75:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&nxsb, buf, sizeof(APFS_Superblock_NXSB)); data/partclone-0.3.13+dfsg/src/apfsclone.c:132:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&apfs_bh, spaceman_buf, sizeof(APFS_BlockHeader)); data/partclone-0.3.13+dfsg/src/apfsclone.c:133:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&apfs_th, spaceman_buf+sizeof(APFS_BlockHeader), sizeof(APFS_TableHeader)); data/partclone-0.3.13+dfsg/src/apfsclone.c:134:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&apfs_spaceman, spaceman_buf, sizeof(APFS_Block_8_5_Spaceman)); data/partclone-0.3.13+dfsg/src/apfsclone.c:154:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&apfs_4_7, bitmap_buf, sizeof(APFS_Block_4_7_Bitmaps)); data/partclone-0.3.13+dfsg/src/apfsclone.h:25:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. typedef unsigned char apfs_uuid_t[16]; data/partclone-0.3.13+dfsg/src/apfsclone.h:130:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char accessor[0x20]; data/partclone-0.3.13+dfsg/src/apfsclone.h:173:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char vol_name[0x100]; data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:437:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&ri->uuid, uuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:439:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&ri->puuid, puuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:441:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&ri->ruuid, ruuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:510:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&ri->uuid, uuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:513:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&ri->puuid, puuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:516:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&ri->ruuid, ruuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:584:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmp + add_len + 1, full_path, len); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:586:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmp, found->path, add_len); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1049:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(uuid, ri->uuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1050:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(puuid, ri->parent_uuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1051:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ruuid, ri->received_uuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1158:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmp + add_len + 1, ri->full_path, len); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1161:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmp, p, add_len); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1331:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tstr[256]; data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1332:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char uuidparse[BTRFS_UUID_UNPARSED_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1448:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char barrier[20]; data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1578:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(the_ri, ri, offsetof(struct root_info, path)); data/partclone-0.3.13+dfsg/src/btrfs/ctree.c:92:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(new_root, root, sizeof(*new_root)); data/partclone-0.3.13+dfsg/src/btrfs/ctree.h:445:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char label[BTRFS_LABEL_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/disk-io.c:93:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fs_uuid[BTRFS_UUID_UNPARSED_SIZE] = {'\0'}; data/partclone-0.3.13+dfsg/src/btrfs/disk-io.c:94:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char found_uuid[BTRFS_UUID_UNPARSED_SIZE] = {'\0'}; data/partclone-0.3.13+dfsg/src/btrfs/disk-io.c:134:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char result[BTRFS_CSUM_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/disk-io.c:735:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&root->root_key, location, sizeof(*location)); data/partclone-0.3.13+dfsg/src/btrfs/disk-io.c:1286:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(fs_info->fsid, &disk_super->fsid, BTRFS_FSID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/disk-io.c:1347:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = open(filename, oflags); data/partclone-0.3.13+dfsg/src/btrfs/disk-io.c:1397:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char result[BTRFS_CSUM_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/disk-io.c:1485:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fsid[BTRFS_UUID_UNPARSED_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/disk-io.c:1486:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dev_fsid[BTRFS_UUID_UNPARSED_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/disk-io.c:1539:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[BTRFS_SUPER_INFO_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/disk-io.c:1557:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sb, buf, BTRFS_SUPER_INFO_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/disk-io.c:1595:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sb, buf, BTRFS_SUPER_INFO_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/disk-io.c:1688:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dev_item->uuid, dev->uuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/disk-io.c:1689:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dev_item->fsid, dev->fs_devices->fsid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/extent-tree.c:2774:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&extent_op->key, key, sizeof(*key)); data/partclone-0.3.13+dfsg/src/btrfs/extent-tree.c:3060:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&root_item->drop_progress, data/partclone-0.3.13+dfsg/src/btrfs/extent-tree.c:3258:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&cache->key, &found_key, sizeof(found_key)); data/partclone-0.3.13+dfsg/src/btrfs/extent_io.c:784:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(eb->data, buf + total_write, this_len); data/partclone-0.3.13+dfsg/src/btrfs/extent_io.c:862:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst, eb->data + start, len); data/partclone-0.3.13+dfsg/src/btrfs/extent_io.c:868:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(eb->data + start, src, len); data/partclone-0.3.13+dfsg/src/btrfs/extent_io.c:875:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst->data + dst_offset, src->data + src_offset, len); data/partclone-0.3.13+dfsg/src/btrfs/free-space-cache.c:259:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(entry->bitmap, io_ctl->cur, io_ctl->root->sectorsize); data/partclone-0.3.13+dfsg/src/btrfs/ioctl.h:40:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[BTRFS_PATH_NAME_MAX + 1]; data/partclone-0.3.13+dfsg/src/btrfs/ioctl.h:96:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[BTRFS_SUBVOL_NAME_MAX + 1]; data/partclone-0.3.13+dfsg/src/btrfs/ioctl.h:300:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[BTRFS_INO_LOOKUP_PATH_MAX]; data/partclone-0.3.13+dfsg/src/btrfs/ioctl.h:355:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[BTRFS_SEARCH_ARGS_BUFSIZE]; data/partclone-0.3.13+dfsg/src/btrfs/ioctl.h:537:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char uuid[BTRFS_UUID_SIZE]; /* in */ data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:73:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char namebuf[BTRFS_NAME_LEN]; data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:113:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char namebuf[BTRFS_NAME_LEN]; data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:147:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char namebuf[BTRFS_NAME_LEN]; data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:170:3: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(ret, "DATA"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:175:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(ret, "METADATA"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:180:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(ret, "SYSTEM"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:184:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(ret, "|RAID0"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:187:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(ret, "|RAID1"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:190:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(ret, "|DUP"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:193:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(ret, "|RAID10"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:196:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(ret, "|RAID5"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:199:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(ret, "|RAID6"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:210:3: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(ret, "ON"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:212:3: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(ret, "OFF"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:215:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(ret, "|SCANNING"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:217:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(ret, "|INCONSISTENT"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:224:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char chunk_flags_str[32] = {0}; data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:234:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char dev_uuid[BTRFS_UUID_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:235:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char str_dev_uuid[BTRFS_UUID_UNPARSED_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:251:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char disk_uuid_c[BTRFS_UUID_UNPARSED_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:269:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fs_uuid[BTRFS_UUID_UNPARSED_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:270:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char chunk_uuid[BTRFS_UUID_UNPARSED_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:292:3: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(ret, "none"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:295:3: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(ret, "zlib"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:298:3: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(ret, "lzo"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:301:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(ret, "UNKNOWN.%d", compress_type); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:311:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char compress_str[16]; data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:350:3: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy(ret, "DATA"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:357:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(ret, "TREE_BLOCK"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:361:3: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(ret, "FULL_BACKREF"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:378:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char flags_str[32] = {0}; data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:476:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char namebuf[BTRFS_NAME_LEN]; data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:504:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char uuid_str[BTRFS_UUID_UNPARSED_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:862:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char flags_str[32]; data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c:931:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[100]; data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c:938:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(tmp, "%llu/%llu", data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c:968:11: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. len += sprintf(tmp, "%llu/%llu", data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c:980:11: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. len += sprintf(tmp, "%llu/%llu", data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c:1326:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out->qgroups, i->qgroups, pos * s); data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c:1327:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out->qgroups + pos + n, i->qgroups + pos, data/partclone-0.3.13+dfsg/src/btrfs/repair.c:39:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&corrupt->key, first_key, sizeof(*first_key)); data/partclone-0.3.13+dfsg/src/btrfs/root-tree.c:58:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(key, &found_key, sizeof(found_key)); data/partclone-0.3.13+dfsg/src/btrfs/send-stream.c:28:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char read_buf[BTRFS_SEND_BUF_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/send-stream.c:227:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(*str, data, len); data/partclone-0.3.13+dfsg/src/btrfs/send-stream.c:265:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(uuid, data, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:119:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, item, btrfs_search_header_len(sh)); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:336:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. if (((char *)buf)[i] == b) data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:478:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(info->uuid, root_item.uuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:479:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(info->received_uuid, root_item.received_uuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:480:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(info->parent_uuid, root_item.parent_uuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:640:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(si->uuid, root_item.uuid, data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:642:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(si->parent_uuid, root_item.parent_uuid, data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:644:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(si->received_uuid, data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:731:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(out, "%.*s/%.*s", p1_len, p1, p2_len, p2); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:763:2: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(out, "%.*s/%.*s/%.*s", p1_len, p1, p2_len, p2, p3_len, p3); data/partclone-0.3.13+dfsg/src/btrfs/send.h:47:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char magic[sizeof(BTRFS_SEND_STREAM_MAGIC)]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:59:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char argv0_buf[ARGV0_BUF_SIZE] = "btrfs"; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:245:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char chunk_uuid[BTRFS_UUID_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:246:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char super_buf[BTRFS_SUPER_INFO_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:316:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char fsid[BTRFS_FSID_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:317:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char chunk_uuid[BTRFS_UUID_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:445:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char super_buf[BTRFS_SUPER_INFO_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:446:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char dev_uuid[BTRFS_UUID_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:447:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char fsid[BTRFS_FSID_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:507:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char super_buf[BTRFS_SUPER_INFO_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:553:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(cur, &disk_key, sizeof(disk_key)); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:1298:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptr, &disk_key, sizeof(disk_key)); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:1384:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf->data, &super, sizeof(super)); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:1447:5: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buf, ", "); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:1609:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(disk_super, super, sizeof(*disk_super)); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:1619:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&dev_item->uuid, device->uuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:1640:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[BUFSIZ]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:1843:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:1890:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(dev, O_RDONLY); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:1918:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mp[PATH_MAX]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2004:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(loop_dev, O_RDONLY | O_NONBLOCK); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2013:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(loop_file, lo64.lo_file_name, sizeof(lo64.lo_file_name)); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2029:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fmt[20]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2030:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char p[PATH_MAX]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2031:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char real_loop_dev[PATH_MAX]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2036:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(f = fopen(p, "r"))) { data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2062:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char real_a[PATH_MAX]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2063:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char real_b[PATH_MAX]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2103:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char res_a[PATH_MAX]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2104:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char res_b[PATH_MAX]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2192:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX], name[PATH_MAX], *res = NULL; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2198:12: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if (!(f = fopen(path, "r"))) data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2250:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(file, O_RDONLY); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2330:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[PATH_MAX]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2339:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/dev/btrfs-control", O_RDWR); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2422:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static __thread char ps_array[10][32]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2587:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char label[BTRFS_LABEL_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2589:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(mount_path, O_RDONLY | O_NOATIME); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2641:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char label[BTRFS_LABEL_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2645:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(mount_path, O_RDONLY | O_NOATIME); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2815:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(p, O_RDONLY); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2845:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(fname, open_flags); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2979:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mp[PATH_MAX]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2986:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[BTRFS_SUPER_INFO_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2990:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(path, O_RDONLY); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3020:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(fi_args->fsid, fs_devices_mnt->fsid, BTRFS_FSID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3070:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(di_args, &tmp, sizeof(tmp)); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3120:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp[PATH_MAX]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3121:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[PATH_MAX]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3135:11: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((f = fopen("/proc/swaps", "r")) == NULL) data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3367:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(file, O_RDWR|O_EXCL); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3395:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char path[PATH_MAX]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3414:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(path, O_RDONLY); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3444:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(file, O_RDONLY); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3473:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[30] = {0,}; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3527:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(path, O_RDONLY | O_NOATIME); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3571:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(file, O_RDONLY); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3715:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char args2_buf[args2_size]; data/partclone-0.3.13+dfsg/src/btrfs/utils.c:4080:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open("/dev/urandom", O_RDONLY); data/partclone-0.3.13+dfsg/src/btrfs/volumes.c:100:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(fs_devices->fsid, disk_super->fsid, BTRFS_FSID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/volumes.c:118:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(device->uuid, disk_super->dev_item.uuid, data/partclone-0.3.13+dfsg/src/btrfs/volumes.c:228:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(device->name, flags); data/partclone-0.3.13+dfsg/src/btrfs/volumes.c:256:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[BTRFS_SUPER_INFO_SIZE]; data/partclone-0.3.13+dfsg/src/btrfs/volumes.c:653:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptr, &disk_key, sizeof(disk_key)); data/partclone-0.3.13+dfsg/src/btrfs/volumes.c:655:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptr, chunk, item_size); data/partclone-0.3.13+dfsg/src/btrfs/volumes.c:995:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(stripe->dev_uuid, device->uuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/volumes.c:1117:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(stripe->dev_uuid, device->uuid, BTRFS_UUID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/volumes.c:1816:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(fs_devices->fsid, fsid, BTRFS_FSID_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/volumes.c:2053:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(eb->data + dest_off, orig_eb->data + orig_off, copy_len); data/partclone-0.3.13+dfsg/src/btrfs/volumes.c:2091:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(eb->data, orig_eb->data + eb->start - start, stripe_len); data/partclone-0.3.13+dfsg/src/btrfs/volumes.c:2155:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p_eb->data, ebs[0]->data, stripe_len); data/partclone-0.3.13+dfsg/src/exfat/exfat.h:111:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char label[UTF8_BYTES(EXFAT_ENAME_MAX) + 1]; data/partclone-0.3.13+dfsg/src/exfat/io.c:50:9: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). return open(spec, O_RDONLY); data/partclone-0.3.13+dfsg/src/exfat/io.c:55:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open(spec, O_RDWR); data/partclone-0.3.13+dfsg/src/exfat/node.c:46:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[UTF8_BYTES(EXFAT_NAME_MAX) + 1]; data/partclone-0.3.13+dfsg/src/exfat/node.c:97:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[UTF8_BYTES(EXFAT_NAME_MAX) + 1]; data/partclone-0.3.13+dfsg/src/exfat/node.c:211:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[UTF8_BYTES(EXFAT_NAME_MAX) + 1]; data/partclone-0.3.13+dfsg/src/exfat/node.c:407:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(namep, file_name->name, data/partclone-0.3.13+dfsg/src/exfat/node.c:630:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[UTF8_BYTES(EXFAT_NAME_MAX) + 1]; data/partclone-0.3.13+dfsg/src/exfat/node.c:944:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(node->name, name, name_length * sizeof(le16_t)); data/partclone-0.3.13+dfsg/src/exfat/node.c:982:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(name_entry.name, node->name + i * EXFAT_ENAME_MAX, data/partclone-0.3.13+dfsg/src/exfat/node.c:1130:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(name_entry.name, name + i * EXFAT_ENAME_MAX, data/partclone-0.3.13+dfsg/src/exfat/node.c:1142:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(node->name, name, (EXFAT_NAME_MAX + 1) * sizeof(le16_t)); data/partclone-0.3.13+dfsg/src/exfat/utils.c:87:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(name_entry.name, name + i * EXFAT_ENAME_MAX, data/partclone-0.3.13+dfsg/src/f2fs/f2fs_fs.h:319:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char alloc_type[MAX_ACTIVE_LOGS]; data/partclone-0.3.13+dfsg/src/f2fs/f2fs_fs.h:322:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char sit_nat_version_bitmap[1]; data/partclone-0.3.13+dfsg/src/f2fs/fsck.c:563:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(name, de_blk->filename[i], name_len); data/partclone-0.3.13+dfsg/src/f2fs/fsck.h:55:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char buf[BLOCK_SZ]; data/partclone-0.3.13+dfsg/src/f2fs/libf2fs.c:420:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open(c->device_name, O_RDONLY | O_EXCL); data/partclone-0.3.13+dfsg/src/f2fs/libf2fs.c:439:7: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(c->device_name, O_RDWR); data/partclone-0.3.13+dfsg/src/f2fs/mount.c:352:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sbi->ckpt, cur_page, blk_size); data/partclone-0.3.13+dfsg/src/f2fs/mount.c:410:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(nm_i->nat_bitmap, version_bitmap, nm_i->bitmap_size); data/partclone-0.3.13+dfsg/src/f2fs/mount.c:460:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst_bitmap, src_bitmap, bitmap_size); data/partclone-0.3.13+dfsg/src/f2fs/mount.c:498:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&curseg->sum_blk->n_nats, kaddr, SUM_JOURNAL_SIZE); data/partclone-0.3.13+dfsg/src/f2fs/mount.c:501:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&curseg->sum_blk->n_sits, kaddr + SUM_JOURNAL_SIZE, SUM_JOURNAL_SIZE); data/partclone-0.3.13+dfsg/src/f2fs/mount.c:622:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(curseg->sum_blk, sum_blk, PAGE_CACHE_SIZE); data/partclone-0.3.13+dfsg/src/f2fs/mount.c:718:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(se->cur_valid_map, raw_sit->valid_map, SIT_VBLOCK_MAP_SIZE); data/partclone-0.3.13+dfsg/src/f2fs/mount.c:719:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(se->ckpt_valid_map, raw_sit->valid_map, SIT_VBLOCK_MAP_SIZE); data/partclone-0.3.13+dfsg/src/f2fs/mount.c:742:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sum_blk, curseg->sum_blk, BLOCK_SZ); data/partclone-0.3.13+dfsg/src/f2fs/mount.c:750:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sum_blk, curseg->sum_blk, BLOCK_SZ); data/partclone-0.3.13+dfsg/src/f2fs/mount.c:780:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sum_entry, &(sum_blk->entries[offset]), sizeof(struct f2fs_summary)); data/partclone-0.3.13+dfsg/src/f2fs/mount.c:820:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(raw_nat, &nat_block->entries[entry_off], sizeof(struct f2fs_nat_entry)); data/partclone-0.3.13+dfsg/src/f2fs/mount.c:917:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ptr, se->cur_valid_map, SIT_VBLOCK_MAP_SIZE); data/partclone-0.3.13+dfsg/src/f2fs/mount.c:961:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(raw_nat, &nat_in_journal(sum, i), sizeof(struct f2fs_nat_entry)); data/partclone-0.3.13+dfsg/src/fatclone.c:255:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ret = open(device, O_RDONLY); data/partclone-0.3.13+dfsg/src/fatclone.c:264:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&fat_sb, buffer, sizeof(FatBootSector)); data/partclone-0.3.13+dfsg/src/fatclone.c:274:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&fatfs_info, buffer, sizeof(FatFsInfo)); data/partclone-0.3.13+dfsg/src/fuseimg.c:50:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char bb[256]; data/partclone-0.3.13+dfsg/src/fuseimg.c:218:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[33]; data/partclone-0.3.13+dfsg/src/fuseimg.c:227:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. n = sprintf (buffer, "%032llx", test_block*fs_info.block_size); data/partclone-0.3.13+dfsg/src/fuseimg.c:311:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). dfr = open(opt.source, O_RDONLY); data/partclone-0.3.13+dfsg/src/gettext.h:195:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg_ctxt_id[msgctxt_len + msgid_len]; data/partclone-0.3.13+dfsg/src/gettext.h:197:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/partclone-0.3.13+dfsg/src/gettext.h:205:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); data/partclone-0.3.13+dfsg/src/gettext.h:207:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); data/partclone-0.3.13+dfsg/src/gettext.h:241:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char msg_ctxt_id[msgctxt_len + msgid_len]; data/partclone-0.3.13+dfsg/src/gettext.h:243:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buf[1024]; data/partclone-0.3.13+dfsg/src/gettext.h:251:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (msg_ctxt_id, msgctxt, msgctxt_len - 1); data/partclone-0.3.13+dfsg/src/gettext.h:253:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy (msg_ctxt_id + msgctxt_len, msgid, msgid_len); data/partclone-0.3.13+dfsg/src/hfsplusclone.c:83:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char HFS_Signature[2]; data/partclone-0.3.13+dfsg/src/hfsplusclone.c:86:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). ret = open(device, O_RDONLY); data/partclone-0.3.13+dfsg/src/hfsplusclone.c:93:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&sb, buffer, sizeof(HFSPlusVolumeHeader)); data/partclone-0.3.13+dfsg/src/info.c:89:19: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). opt.debug = atol(optarg); data/partclone-0.3.13+dfsg/src/info.c:122:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). dfr = open(opt.source, O_RDONLY); data/partclone-0.3.13+dfsg/src/info.c:139:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). dfr = open(opt.source, O_RDONLY); data/partclone-0.3.13+dfsg/src/jfsclone.c:89:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(device, "r+"); data/partclone-0.3.13+dfsg/src/jfsclone.c:417:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer, block_buffer + offset, count); data/partclone-0.3.13+dfsg/src/jfsclone.c:426:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[PSIZE]; data/partclone-0.3.13+dfsg/src/main.c:419:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char checksum[cs_size]; data/partclone-0.3.13+dfsg/src/main.c:453:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char torrent_name[PATH_MAX + 1] = {'\0'}; data/partclone-0.3.13+dfsg/src/main.c:455:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). tinfo = open(torrent_name, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR); data/partclone-0.3.13+dfsg/src/main.c:509:6: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(write_buffer + write_offset, data/partclone-0.3.13+dfsg/src/main.c:519:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(write_buffer + write_offset, checksum, cs_size); data/partclone-0.3.13+dfsg/src/main.c:592:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char last_block[fs_info.block_size]; data/partclone-0.3.13+dfsg/src/main.c:617:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char checksum[cs_size]; data/partclone-0.3.13+dfsg/src/main.c:669:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char torrent_name[PATH_MAX + 1] = {'\0'}; data/partclone-0.3.13+dfsg/src/main.c:671:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). tinfo = open(torrent_name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); data/partclone-0.3.13+dfsg/src/main.c:716:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(write_buffer + i * block_size, data/partclone-0.3.13+dfsg/src/main.c:730:18: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char checksum_orig[cs_size]; data/partclone-0.3.13+dfsg/src/main.c:731:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(checksum_orig, read_buffer + read_offset + block_size, cs_size); data/partclone-0.3.13+dfsg/src/main.c:752:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char checksum_orig[cs_size]; data/partclone-0.3.13+dfsg/src/main.c:753:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(checksum_orig, read_buffer + read_offset, cs_size); data/partclone-0.3.13+dfsg/src/main.c:1000:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char torrent_name[PATH_MAX + 1] = {'\0'}; data/partclone-0.3.13+dfsg/src/main.c:1002:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). tinfo = open(torrent_name, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR); data/partclone-0.3.13+dfsg/src/minixclone.c:125:11: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). dev = open(device,O_RDONLY); data/partclone-0.3.13+dfsg/src/ntfsfixboot.c:214:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char br_sector[512]; data/partclone-0.3.13+dfsg/src/ntfsfixboot.c:215:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char bak_sector[512]; data/partclone-0.3.13+dfsg/src/ntfsfixboot.c:225:17: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((device = open(optDeviceName, (optWrite ? O_RDWR : O_RDONLY) | O_SYNC)) < 0) { data/partclone-0.3.13+dfsg/src/ntfsfixboot.c:274:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&fs_geom, br_sector + 0x18, geomsize); data/partclone-0.3.13+dfsg/src/ntfsfixboot.c:279:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(§or_size, br_sector + 0x0b, 2); data/partclone-0.3.13+dfsg/src/ntfsfixboot.c:280:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&total_sectors, br_sector + 0x28, 8); data/partclone-0.3.13+dfsg/src/ntfsfixboot.c:306:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&bak_geom, bak_sector + 0x18, geomsize); data/partclone-0.3.13+dfsg/src/ntfsfixboot.c:369:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(br_sector + 0x18, &set_geom, geomsize); data/partclone-0.3.13+dfsg/src/partclone.c:433:27: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). opt->debug = optarg ? atol(optarg) : 1; data/partclone-0.3.13+dfsg/src/partclone.c:440:18: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). opt->fresh = atol(optarg); data/partclone-0.3.13+dfsg/src/partclone.c:456:24: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). opt->buffer_size = atol(optarg); data/partclone-0.3.13+dfsg/src/partclone.c:490:51: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). opt->checksum_mode = convert_to_checksum_mode(atol(optarg)); data/partclone-0.3.13+dfsg/src/partclone.c:494:32: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). opt->blocks_per_checksum = atol(optarg); data/partclone-0.3.13+dfsg/src/partclone.c:528:26: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). opt->offset = (off_t)atol(optarg); data/partclone-0.3.13+dfsg/src/partclone.c:687:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *in = fopen( "/dev/stderr", "r" ); data/partclone-0.3.13+dfsg/src/partclone.c:688:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *out = fopen( "/dev/stderr", "w" ); data/partclone-0.3.13+dfsg/src/partclone.c:818:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). msg = fopen(source,"w"); data/partclone-0.3.13+dfsg/src/partclone.c:829:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmp_str[512]; data/partclone-0.3.13+dfsg/src/partclone.c:912:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(fs_info, &fs_info_v2, sizeof(file_system_info_v2)); data/partclone-0.3.13+dfsg/src/partclone.c:913:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(img_opt, &img_opt_v2, sizeof(image_options_v2)); data/partclone-0.3.13+dfsg/src/partclone.c:937:16: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). img_version = atol(buf_v2.head.version); data/partclone-0.3.13+dfsg/src/partclone.c:964:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(img_head, &(buf_v2.head), sizeof(image_head_v2)); data/partclone-0.3.13+dfsg/src/partclone.c:970:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char version[IMAGE_VERSION_SIZE+1] = { 0x00 }; data/partclone-0.3.13+dfsg/src/partclone.c:972:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(version, buf_v2.head.version, IMAGE_VERSION_SIZE); data/partclone-0.3.13+dfsg/src/partclone.c:986:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&buf_v2.fs_info, &fs_info, sizeof(file_system_info)); data/partclone-0.3.13+dfsg/src/partclone.c:987:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&buf_v2.options, &img_opt, sizeof(image_options)); data/partclone-0.3.13+dfsg/src/partclone.c:1012:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char bbuffer[16384]; data/partclone-0.3.13+dfsg/src/partclone.c:1375:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[16384]; data/partclone-0.3.13+dfsg/src/partclone.c:1380:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char bitmagic_r[8]="00000000";/// read magic string from image data/partclone-0.3.13+dfsg/src/partclone.c:1535:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((ret = open(source, flags, S_IRUSR)) == -1) data/partclone-0.3.13+dfsg/src/partclone.c:1544:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((ret = open (source, flags, S_IRWXU)) == -1) data/partclone-0.3.13+dfsg/src/partclone.c:1597:15: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((ret = open(target, flags, S_IRUSR|S_IWUSR)) == -1) { data/partclone-0.3.13+dfsg/src/partclone.c:1630:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((ret = open (target, flags, S_IRUSR)) == -1) { data/partclone-0.3.13+dfsg/src/partclone.c:1687:20: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((torrent_fd = open (block_filename, flags, S_IRUSR)) == -1) { data/partclone-0.3.13+dfsg/src/partclone.c:1760:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char badsector_magic[10] = {'B', 'A', 'D', 'S', 'E', 'C', 'T', 'O', 'R', '\0'}; data/partclone-0.3.13+dfsg/src/partclone.c:1765:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buff, badsector_magic, strlen(badsector_magic)+1); data/partclone-0.3.13+dfsg/src/partclone.c:1772:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buff, badsector_magic, strlen(badsector_magic)+1); data/partclone-0.3.13+dfsg/src/partclone.c:1859:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char size_str[11]; data/partclone-0.3.13+dfsg/src/partclone.c:1882:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char bufstr[64]; data/partclone-0.3.13+dfsg/src/partclone.c:1898:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(bufstr, _("%d bits platform"), img_opt.cpu_bits); data/partclone-0.3.13+dfsg/src/partclone.c:1919:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(bufstr, "%d", img_opt.checksum_size); data/partclone-0.3.13+dfsg/src/partclone.c:1922:3: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(bufstr, "%d", img_opt.blocks_per_checksum); data/partclone-0.3.13+dfsg/src/partclone.h:116:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char note[NOTE_SIZE]; data/partclone-0.3.13+dfsg/src/partclone.h:148:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char magic[IMAGE_MAGIC_SIZE]; data/partclone-0.3.13+dfsg/src/partclone.h:149:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fs[FS_MAGIC_SIZE]; data/partclone-0.3.13+dfsg/src/partclone.h:150:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char version[IMAGE_VERSION_SIZE]; data/partclone-0.3.13+dfsg/src/partclone.h:151:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char padding[2]; data/partclone-0.3.13+dfsg/src/partclone.h:157:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char magic[IMAGE_MAGIC_SIZE+1]; data/partclone-0.3.13+dfsg/src/partclone.h:160:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char ptc_version[PARTCLONE_VERSION_SIZE]; data/partclone-0.3.13+dfsg/src/partclone.h:163:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char version[IMAGE_VERSION_SIZE]; data/partclone-0.3.13+dfsg/src/partclone.h:182:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char fs[FS_MAGIC_SIZE+1]; data/partclone-0.3.13+dfsg/src/partclone.h:203:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buff[4096]; data/partclone-0.3.13+dfsg/src/progress.c:105:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char Rformated[12], Eformated[12]; data/partclone-0.3.13+dfsg/src/progress.c:231:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char blockbuf[BUFSIZE]; data/partclone-0.3.13+dfsg/src/progress.h:48:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char Eformated[12]; data/partclone-0.3.13+dfsg/src/progress.h:49:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char Rformated[12]; data/partclone-0.3.13+dfsg/src/progress.h:53:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char speed_unit[5]; data/partclone-0.3.13+dfsg/src/readblock.c:94:19: [2] (integer) atol: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). opt.debug = atol(optarg); data/partclone-0.3.13+dfsg/src/readblock.c:127:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). dfr = open(opt.source, O_RDONLY); data/partclone-0.3.13+dfsg/src/readblock.c:144:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). dfr = open(opt.source, O_RDONLY); data/partclone-0.3.13+dfsg/src/torrent_helper.h:31:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char hash[SHA_DIGEST_LENGTH]; data/partclone-0.3.13+dfsg/src/ufs/libufs.h:79:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char d_sb[MAXBSIZE]; data/partclone-0.3.13+dfsg/src/ufs/libufs.h:84:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char d_buf[MAXBSIZE]; data/partclone-0.3.13+dfsg/src/ufs/sys/disklabel.h:77:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char d_typename[16]; /* type name, e.g. "eagle" */ data/partclone-0.3.13+dfsg/src/ufs/sys/disklabel.h:79:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char d_packname[16]; /* pack identifier */ data/partclone-0.3.13+dfsg/src/vmfs5clone.c:229:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&map->inode,inode,sizeof(*inode)); data/partclone-0.3.13+dfsg/src/xfs/include/darwin.h:287:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char fsx_pad[8]; data/partclone-0.3.13+dfsg/src/xfs/include/freebsd.h:134:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst, src, sizeof(uuid_t)); data/partclone-0.3.13+dfsg/src/xfs/include/freebsd.h:178:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char fsx_pad[8]; data/partclone-0.3.13+dfsg/src/xfs/include/irix.h:347:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst, src, sizeof(uuid_t)); data/partclone-0.3.13+dfsg/src/xfs/include/irix.h:431:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char fsx_pad[8]; data/partclone-0.3.13+dfsg/src/xfs/include/linux.h:191:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char fsx_pad[8]; data/partclone-0.3.13+dfsg/src/xfs/include/parent.h:25:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char p_name[1]; data/partclone-0.3.13+dfsg/src/xfs/include/xfs/linux.h:191:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char fsx_pad[8]; data/partclone-0.3.13+dfsg/src/xfs/include/xfs/xfs_fs.h:164:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char uuid[16]; /* unique id of the filesystem */ data/partclone-0.3.13+dfsg/src/xfs/include/xfs/xfs_fs.h:190:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char uuid[16]; /* unique id of the filesystem */ data/partclone-0.3.13+dfsg/src/xfs/include/xfs/xfs_fs.h:305:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char bs_pad[6]; /* pad space, unused */ data/partclone-0.3.13+dfsg/src/xfs/include/xfs/xfs_fs.h:476:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sx_pad[16]; /* pad space, unused */ data/partclone-0.3.13+dfsg/src/xfs/include/xfs/xqm.h:69:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char d_padding4[8]; /* yet more padding */ data/partclone-0.3.13+dfsg/src/xfs/include/xqm.h:69:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char d_padding4[8]; /* yet more padding */ data/partclone-0.3.13+dfsg/src/xfs/libxfs/crc32.c:66:30: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. crc32_body(u32 crc, unsigned char const *buf, size_t len, const u32 (*tab)[256]) data/partclone-0.3.13+dfsg/src/xfs/libxfs/crc32.c:139:61: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static inline u32 __pure crc32_le_generic(u32 crc, unsigned char const *p, data/partclone-0.3.13+dfsg/src/xfs/libxfs/darwin.c:40:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(block, O_RDONLY, 0)) < 0) { data/partclone-0.3.13+dfsg/src/xfs/libxfs/init.c:124:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((fd = open(path, flags, 0666)) < 0) { data/partclone-0.3.13+dfsg/src/xfs/libxfs/init.c:242:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char curdir[MAXPATHLEN]; data/partclone-0.3.13+dfsg/src/xfs/libxfs/init.c:244:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dpath[25]; data/partclone-0.3.13+dfsg/src/xfs/libxfs/init.c:247:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char logpath[25]; data/partclone-0.3.13+dfsg/src/xfs/libxfs/init.c:251:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char rtpath[25]; data/partclone-0.3.13+dfsg/src/xfs/libxfs/init.c:280:8: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fd = open(rawfile, O_RDONLY); data/partclone-0.3.13+dfsg/src/xfs/libxfs/linux.c:61:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char mounts[MAXPATHLEN]; data/partclone-0.3.13+dfsg/src/xfs/libxfs/radix-tree.c:119:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tags[RADIX_TREE_MAX_TAGS]; data/partclone-0.3.13+dfsg/src/xfs/libxfs/radix-tree.c:688:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tags[RADIX_TREE_MAX_TAGS]; data/partclone-0.3.13+dfsg/src/xfs/libxfs/rdwr.c:135:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((char *)p + sizeof(xlog_op_header_t), &magic, sizeof(magic)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/rdwr.c:315:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&head->h_fs_uuid, fs_uuid, sizeof(uuid_t)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/rdwr.c:1219:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(data, bp->b_addr + boff, len); data/partclone-0.3.13+dfsg/src/xfs/libxfs/rdwr.c:1222:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(bp->b_addr + boff, data, len); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:563:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sfe->nameval, args->name, args->namelen); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:564:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&sfe->nameval[args->namelen], args->value, args->valuelen); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:631:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. memmove(&((char *)sf)[base], &((char *)sf)[end], totsize - end); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:631:35: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. memmove(&((char *)sf)[base], &((char *)sf)[end], totsize - end); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:723:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(args->value, &sfe->nameval[args->namelen], data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:754:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmpbuffer, ifp->if_u1.if_data, size); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:770:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ifp->if_u1.if_data, tmpbuffer, size); /* it back */ data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:782:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ifp->if_u1.if_data, tmpbuffer, size); /* it back */ data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:888:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmpbuffer, bp->b_addr, args->geo->blksize); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:984:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(bp2->b_addr, bp1->b_addr, args->geo->blksize); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:1292:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((char *)name_loc->nameval, args->name, args->namelen); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:1293:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((char *)&name_loc->nameval[args->namelen], args->value, data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:1298:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy((char *)name_rmt->name, args->name, args->namelen); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:1350:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmpbuffer, bp->b_addr, args->geo->blksize); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:1360:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(bp->b_addr, tmpbuffer, xfs_attr3_leaf_hdr_size(leaf_src)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:1785:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&state->altpath, &state->path, sizeof(state->path)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:1842:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&state->altpath, &state->path, sizeof(state->path)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:2082:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tmp_leaf, save_leaf, xfs_attr3_leaf_hdr_size(save_leaf)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:2113:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(save_leaf, tmp_leaf, state->args->geo->blksize); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_leaf.c:2288:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(args->value, &name_loc->nameval[args->namelen], valuelen); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_remote.c:277:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(*dst, src + hdr_size, byte_cnt); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr_remote.c:316:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst + hdr_size, *src, byte_cnt); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_bmap_btree.c:89:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tkp, fkp, sizeof(*fkp) * dmxr); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_bmap_btree.c:90:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tpp, fpp, sizeof(*fpp) * dmxr); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_bmap_btree.c:368:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tkp, fkp, sizeof(*fkp) * dmxr); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_bmap_btree.c:369:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(tpp, fpp, sizeof(*fpp) * dmxr); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_btree.c:1292:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst_key, src_key, numkeys * cur->bc_ops->key_len); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_btree.c:1306:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst_rec, src_rec, numrecs * cur->bc_ops->rec_len); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_btree.c:1320:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst_ptr, src_ptr, numptrs * xfs_btree_ptr_len(cur)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_btree.c:1997:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(high, &max_hkey, cur->bc_ops->key_len / 2); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_btree.c:2014:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(key, xfs_btree_key_addr(cur, 1, block), data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_btree.c:2025:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(high, max_hkey, cur->bc_ops->key_len / 2); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_btree.c:2027:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(key, xfs_btree_key_addr(cur, 1, block), data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_btree.c:2958:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(cblock, block, xfs_btree_block_len(cur)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_da_btree.c:579:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(node, oldroot, size); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_da_btree.c:804:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(btree_d, btree_s, tmp); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_da_btree.c:815:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(btree_d, btree_s, tmp); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_da_btree.c:1088:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(root_blk->bp->b_addr, bp->b_addr, args->geo->blksize); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_da_btree.c:1156:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&state->altpath, &state->path, sizeof(state->path)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_da_btree.c:1211:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&state->altpath, &state->path, sizeof(state->path)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_da_btree.c:1416:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&save_btree[sindex], &drop_btree[0], tmp); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_da_btree.c:2174:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dead_buf->b_addr, last_buf->b_addr, args->geo->blksize); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_da_format.h:810:12: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. return &((char *)leafp)[be16_to_cpu(entries[idx].nameidx)]; data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2.c:42:16: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const unsigned char xfs_mode_to_ftype[S_IFMT >> S_SHIFT] = { data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2.c:342:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(args->value, name, len); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_block.c:547:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dep->name, args->name, args->namelen); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_block.c:1098:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sfp, oldsfp, ifp->if_bytes); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_block.c:1223:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dep->name, sfep->name, dep->namelen); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_leaf.c:436:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ents, blp, be32_to_cpu(btp->count) * sizeof(xfs_dir2_leaf_entry_t)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_leaf.c:859:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dep->name, args->name, dep->namelen); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_leaf.c:1787:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(xfs_dir2_leaf_bests_p(ltp), dp->d_ops->free_bests_p(free), data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_node.c:884:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&dents[start_d], &sents[start_s], data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_node.c:1425:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&state->altpath, &state->path, sizeof(state->path)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_node.c:1487:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&state->altpath, &state->path, sizeof(state->path)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_node.c:1969:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dep->name, args->name, dep->namelen); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_sf.c:188:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sfp, sfhp, xfs_dir2_sf_hdr_size(sfhp->i8count)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_sf.c:231:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sfep->name, dep->name, dep->namelen); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_sf.c:405:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sfep->name, args->name, sfep->namelen); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_sf.c:456:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(oldsfp, sfp, old_isize); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_sf.c:489:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sfp, oldsfp, nbytes); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_sf.c:496:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sfep->name, args->name, sfep->namelen); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_sf.c:507:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sfep, oldsfep, old_isize - nbytes); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_sf.c:1011:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, oldsfp, oldsize); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_sf.c:1039:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sfep->name, oldsfep->name, sfep->namelen); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_sf.c:1084:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, oldsfp, oldsize); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_dir2_sf.c:1112:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sfep->name, oldsfep->name, sfep->namelen); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_format.h:125:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sb_fname[12]; /* file system name */ data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_format.h:216:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sb_fname[12]; /* file system name */ data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_format.h:1187:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char dd_fill[4]; /* filling for posterity */ data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_fs.h:164:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char uuid[16]; /* unique id of the filesystem */ data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_fs.h:190:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char uuid[16]; /* unique id of the filesystem */ data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_fs.h:305:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. unsigned char bs_pad[6]; /* pad space, unused */ data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_fs.h:476:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char sx_pad[16]; /* pad space, unused */ data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_fork.c:290:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ifp->if_u1.if_data, data, size); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_fork.c:600:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(new_broot, ifp->if_broot, data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_fork.c:616:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(np, op, new_max * (uint)sizeof(xfs_bmbt_rec_t)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_fork.c:625:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(np, op, new_max * (uint)sizeof(xfs_fsblock_t)); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_fork.c:685:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ifp->if_u2.if_inline_data, ifp->if_u1.if_data, data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_fork.c:719:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ifp->if_u1.if_data, ifp->if_u2.if_inline_data, data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_fork.c:881:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(cp, ifp->if_u1.if_data, ifp->if_bytes); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_fork.c:919:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(XFS_DFORK_DPTR(dip), data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_fork.c:1478:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ifp->if_u2.if_inline_ext, ifp->if_u1.if_extents, data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_fork.c:1501:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ifp->if_u1.if_extents, ifp->if_u2.if_inline_ext, data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_fork.c:1939:4: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&erp->er_extbuf[erp->er_extcount], data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_inode_fork.h:70:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char if_inline_data[XFS_INLINE_DATA]; data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_log_format.h:189:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char hic_sector[XLOG_HEADER_SIZE]; data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_log_format.h:812:2: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char qf_pad[12]; /* padding for future */ data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_symlink_remote.c:186:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(bp->b_addr, ifp->if_u1.if_data, ifp->if_bytes); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_symlink_remote.c:202:2: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, ifp->if_u1.if_data, ifp->if_bytes); data/partclone-0.3.13+dfsg/src/xfsclone.c:266:22: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). if ((source_fd = open(device, open_flags)) < 0) { data/partclone-0.3.13+dfsg/src/apfsclone.c:71:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read_size = read(APFSDEV, buf, buffer_size); data/partclone-0.3.13+dfsg/src/apfsclone.c:202:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, apfs_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:417:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ri->name, name, name_len); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:489:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(ri->name, name, name_len); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:575:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). add_len = strlen(found->path); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:662:21: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ri->path = malloc(strlen(ri->name) + strlen(args.name) + 1); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:662:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). ri->path = malloc(strlen(ri->name) + strlen(args.name) + 1); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:822:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). full = malloc(strlen(dirid) + strlen(name) + 1); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:822:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). full = malloc(strlen(dirid) + strlen(name) + 1); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1150:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int add_len = strlen(p); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1151:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(ri->full_path); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1359:4: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy(tstr, "-"); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1364:4: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy(uuidparse, "-"); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1371:4: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy(uuidparse, "-"); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1378:4: [1] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant character. strcpy(uuidparse, "-"); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1462:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(btrfs_list_columns[i].name); data/partclone-0.3.13+dfsg/src/btrfs/btrfs-list.c:1464:5: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(barrier, "-"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:174:4: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(ret, "|"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:179:4: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(ret, "|"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:355:4: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(ret, "|"); data/partclone-0.3.13+dfsg/src/btrfs/print-tree.c:360:3: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(ret, "|"); data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c:299:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(btrfs_qgroup_columns[i].name); data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c:302:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = max_len - strlen(btrfs_qgroup_columns[i].name); data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c:306:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = max_len - strlen(btrfs_qgroup_columns[i].name); data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c:309:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(btrfs_qgroup_columns[i].name); data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c:941:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(tmp); data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c:946:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(pretty_size_mode(bq->rfer, unit_mode)); data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c:951:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(pretty_size_mode(bq->excl, unit_mode)); data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c:956:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(pretty_size_mode(bq->max_rfer, unit_mode)); data/partclone-0.3.13+dfsg/src/btrfs/qgroup.c:961:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(pretty_size_mode(bq->max_excl, unit_mode)); data/partclone-0.3.13+dfsg/src/btrfs/send-stream.c:45:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(s->fd, (char*)buf + pos, len - pos); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:293:3: [1] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant character. strcat(path, "/"); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:314:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(ino_lookup_arg.name); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:323:2: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(path, (char *)(backref_item + 1), data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:721:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int p1_len = strlen(p1); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:722:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int p2_len = strlen(p2); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:739:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int p1_len = strlen(p1); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:740:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int p2_len = strlen(p2); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:750:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int p1_len = strlen(p1); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:751:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int p2_len = strlen(p2); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:752:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int p3_len = strlen(p3); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:771:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int p1_len = strlen(p1); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:772:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int p2_len = strlen(p2); data/partclone-0.3.13+dfsg/src/btrfs/send-utils.c:773:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int p3_len = strlen(p3); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:71:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(argv0_buf); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:79:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(argv0_buf, argv[0], sizeof(argv0_buf)); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:1861:6: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(input) == (BTRFS_UUID_UNPARSED_SIZE - 1) && data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2202:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (fgets(name, sizeof(name), f) && (sz = strlen(name)) > 1) { data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2314:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(where, mnt->mnt_dir, size); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2526:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dest, src, n); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2540:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(input); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:2783:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const char *ptr_src_end = p + strlen(p); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3537:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(ent->mnt_dir); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3782:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(src); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:3976:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int len = strlen(mnt); data/partclone-0.3.13+dfsg/src/btrfs/utils.c:4082:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ret = read(fd, rand_seed, sizeof(rand_seed)); data/partclone-0.3.13+dfsg/src/btrfsclone.c:420:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, btrfs_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/ddclone.c:31:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, raw_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/exfat/io.c:259:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return read(dev->fd, buffer, size); data/partclone-0.3.13+dfsg/src/exfat/lookup.c:116:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). return strlen(*comp); data/partclone-0.3.13+dfsg/src/exfat/mount.c:64:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t length = strlen(option_name); data/partclone-0.3.13+dfsg/src/exfat/mount.c:85:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t length = strlen(option_name); data/partclone-0.3.13+dfsg/src/exfat/node.c:1306:58: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). rc = utf8_to_utf16(label_utf16, label, EXFAT_ENAME_MAX, strlen(label)); data/partclone-0.3.13+dfsg/src/exfatclone.c:86:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, exfat_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/extfsclone.c:235:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, extfs_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/f2fs/libf2fs.c:501:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(config.fd, buf, len) < 0) data/partclone-0.3.13+dfsg/src/f2fsclone.c:119:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, f2fs_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/fatclone.c:173:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rd = read(ret, &Fat16_Entry, sizeof(Fat16_Entry)); data/partclone-0.3.13+dfsg/src/fatclone.c:178:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rd = read(ret, &Fat16_Entry, sizeof(Fat16_Entry)); data/partclone-0.3.13+dfsg/src/fatclone.c:193:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rd = read(ret, &Fat32_Entry, sizeof(Fat32_Entry)); data/partclone-0.3.13+dfsg/src/fatclone.c:197:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rd = read(ret, &Fat32_Entry, sizeof(Fat32_Entry)); data/partclone-0.3.13+dfsg/src/fatclone.c:211:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rd = read(ret, &Fat16_Entry, sizeof(Fat16_Entry)); data/partclone-0.3.13+dfsg/src/fatclone.c:215:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rd = read(ret, &Fat16_Entry, sizeof(Fat16_Entry)); data/partclone-0.3.13+dfsg/src/fatclone.c:261:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read (ret, buffer, sizeof(FatBootSector)) != sizeof(FatBootSector)) data/partclone-0.3.13+dfsg/src/fatclone.c:271:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(ret, &fatfs_info, sizeof(FatFsInfo)) != sizeof(FatFsInfo)) data/partclone-0.3.13+dfsg/src/fatclone.c:294:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rd = read(ret, &Fat32_Entry, sizeof(Fat32_Entry)); data/partclone-0.3.13+dfsg/src/fatclone.c:321:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rd = read(ret, &Fat16_Entry, sizeof(Fat16_Entry)); data/partclone-0.3.13+dfsg/src/fatclone.c:348:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rd = read(ret, &Fat16_Entry, sizeof(Fat16_Entry)); data/partclone-0.3.13+dfsg/src/fatclone.c:384:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, fat_type, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/fuseimg.c:52:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int sl = strlen(path); data/partclone-0.3.13+dfsg/src/fuseimg.c:53:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(bb, path+1, sl); data/partclone-0.3.13+dfsg/src/gettext.h:191:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t msgctxt_len = strlen (msgctxt) + 1; data/partclone-0.3.13+dfsg/src/gettext.h:192:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t msgid_len = strlen (msgid) + 1; data/partclone-0.3.13+dfsg/src/gettext.h:237:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t msgctxt_len = strlen (msgctxt) + 1; data/partclone-0.3.13+dfsg/src/gettext.h:238:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t msgid_len = strlen (msgid) + 1; data/partclone-0.3.13+dfsg/src/hfsplusclone.c:91:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read (ret, buffer, sizeof(HFSPlusVolumeHeader)) != sizeof(HFSPlusVolumeHeader)) data/partclone-0.3.13+dfsg/src/hfsplusclone.c:163:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(ret, extent_bitmap, allocation_block_size) != allocation_block_size) data/partclone-0.3.13+dfsg/src/hfsplusclone.c:200:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, hfsplus_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/jfsclone.c:284:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, jfs_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/minixclone.c:134:29: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (MINIX_BLOCK_SIZE != read(dev, super_block_buffer, MINIX_BLOCK_SIZE)) data/partclone-0.3.13+dfsg/src/minixclone.c:165:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = read(dev, inode_map, imaps * block_size); data/partclone-0.3.13+dfsg/src/minixclone.c:169:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = read(dev, zone_map, zmaps * block_size); data/partclone-0.3.13+dfsg/src/minixclone.c:208:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, minix_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/minixclone.c:243:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = read(dev, inode_map, imaps * block_size); data/partclone-0.3.13+dfsg/src/minixclone.c:247:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). rc = read(dev, zone_map, zmaps * block_size); data/partclone-0.3.13+dfsg/src/nilfsclone.c:179:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, nilfs_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/ntfsclone-ng.c:306:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, ntfs_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/ntfsfixboot.c:257:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(device, br_sector, 512) != 512) { data/partclone-0.3.13+dfsg/src/ntfsfixboot.c:302:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(device, &bak_sector, 512) != 512) { data/partclone-0.3.13+dfsg/src/partclone.c:134:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(image_hdr->magic, IMAGE_MAGIC, IMAGE_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/partclone.c:135:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(image_hdr->version, IMAGE_VERSION_0001, IMAGE_VERSION_SIZE); data/partclone-0.3.13+dfsg/src/partclone.c:136:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(image_hdr->fs, fs, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/partclone.c:143:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(image_hdr->magic, IMAGE_MAGIC, IMAGE_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/partclone.c:144:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(image_hdr->version, IMAGE_VERSION_0002, IMAGE_VERSION_SIZE); data/partclone-0.3.13+dfsg/src/partclone.c:145:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(image_hdr->ptc_version, VERSION, PARTCLONE_VERSION_SIZE); data/partclone-0.3.13+dfsg/src/partclone.c:427:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(opt->note, optarg, NOTE_SIZE); data/partclone-0.3.13+dfsg/src/partclone.c:887:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, img_hdr_v1.fs, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/partclone.c:1144:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t path_len = strlen(path); data/partclone-0.3.13+dfsg/src/partclone.c:1165:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = path_len + strlen(p->d_name) + 2; data/partclone-0.3.13+dfsg/src/partclone.c:1582:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int strsz = strlen(opt->compresscmd) + strlen(target) + 4; data/partclone-0.3.13+dfsg/src/partclone.c:1582:43: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int strsz = strlen(opt->compresscmd) + strlen(target) + 4; data/partclone-0.3.13+dfsg/src/partclone.c:1730:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). i = read(*fd, buf, count); data/partclone-0.3.13+dfsg/src/partclone.c:1765:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy(buff, badsector_magic, strlen(badsector_magic)+1); data/partclone-0.3.13+dfsg/src/partclone.c:1772:33: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy(buff, badsector_magic, strlen(badsector_magic)+1); data/partclone-0.3.13+dfsg/src/partclone.c:1846:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ( strlen(opt.note) > 0 ){ data/partclone-0.3.13+dfsg/src/progress.c:130:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(speed_unit, "GB", 3); data/partclone-0.3.13+dfsg/src/progress.c:131:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(prog_stat->speed_unit, speed_unit, 3); data/partclone-0.3.13+dfsg/src/progress.c:134:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(speed_unit, "MB", 3); data/partclone-0.3.13+dfsg/src/progress.c:135:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(prog_stat->speed_unit, speed_unit, 3); data/partclone-0.3.13+dfsg/src/progress.c:138:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(speed_unit, "KB", 3); data/partclone-0.3.13+dfsg/src/progress.c:139:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(prog_stat->speed_unit, speed_unit, 3); data/partclone-0.3.13+dfsg/src/progress.c:142:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. strncpy(speed_unit, "byte", 5); data/partclone-0.3.13+dfsg/src/progress.c:143:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(prog_stat->speed_unit, speed_unit, 5); data/partclone-0.3.13+dfsg/src/progress.c:181:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(prog_stat->Eformated, Eformated, sizeof(prog_stat->Eformated)); data/partclone-0.3.13+dfsg/src/progress.c:182:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(prog_stat->Rformated, Rformated, sizeof(prog_stat->Rformated)); data/partclone-0.3.13+dfsg/src/reiser4clone.c:142:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, reiser4_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/reiserfsclone.c:114:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, reiserfs_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/ufsclone.c:182:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, ufs_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/vmfs5clone.c:421:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, vmfs_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/vmfsclone.c:134:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, vmfs_MAGIC, FS_MAGIC_SIZE); data/partclone-0.3.13+dfsg/src/xfs/include/darwin.h:145:9: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. #define memalign(a,sz) valloc(sz) data/partclone-0.3.13+dfsg/src/xfs/include/freebsd.h:38:9: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. #define memalign(a,sz) valloc(sz) data/partclone-0.3.13+dfsg/src/xfs/libxfs/rdwr.c:80:11: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. if ((z = memalign(libxfs_device_alignment(), zsize)) == NULL) { data/partclone-0.3.13+dfsg/src/xfs/libxfs/rdwr.c:578:16: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. bp->b_addr = memalign(libxfs_device_alignment(), bytes); data/partclone-0.3.13+dfsg/src/xfs/libxfs/xfs_attr.c:89:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). args->namelen = strlen((const char *)name); data/partclone-0.3.13+dfsg/src/xfsclone.c:52:15: [1] (free) memalign: On some systems (though not Linux-based systems) an attempt to free() results from memalign() may fail. This may, on a few systems, be exploitable. Also note that memalign() may not check that the boundary parameter is correct (CWE-676). Use posix_memalign instead (defined in POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD 4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases, malloc()'s alignment may be sufficient. buf = memalign(libxfs_device_alignment(), size); data/partclone-0.3.13+dfsg/src/xfsclone.c:67:28: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (buf && (rval = read(source_fd, buf, size)) != size) { data/partclone-0.3.13+dfsg/src/xfsclone.c:353:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(fs_info->fs, xfs_MAGIC, FS_MAGIC_SIZE); ANALYSIS SUMMARY: Hits = 649 Lines analyzed = 128417 in approximately 3.10 seconds (41441 lines/second) Physical Source Lines of Code (SLOC) = 90391 Hits@level = [0] 710 [1] 138 [2] 442 [3] 15 [4] 50 [5] 4 Hits@level+ = [0+] 1359 [1+] 649 [2+] 511 [3+] 69 [4+] 54 [5+] 4 Hits/KSLOC@level+ = [0+] 15.0347 [1+] 7.17992 [2+] 5.65322 [3+] 0.76335 [4+] 0.597405 [5+] 0.0442522 Symlinks skipped = 1 (--allowlink overrides but see doc for security issue) Dot directories skipped = 1 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.