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/f2fs-tools-1.11.0/fsck/common.h
Examining data/f2fs-tools-1.11.0/fsck/defrag.c
Examining data/f2fs-tools-1.11.0/fsck/dict.c
Examining data/f2fs-tools-1.11.0/fsck/dict.h
Examining data/f2fs-tools-1.11.0/fsck/dir.c
Examining data/f2fs-tools-1.11.0/fsck/dqblk_v2.h
Examining data/f2fs-tools-1.11.0/fsck/dump.c
Examining data/f2fs-tools-1.11.0/fsck/f2fs.h
Examining data/f2fs-tools-1.11.0/fsck/fsck.c
Examining data/f2fs-tools-1.11.0/fsck/fsck.h
Examining data/f2fs-tools-1.11.0/fsck/main.c
Examining data/f2fs-tools-1.11.0/fsck/mkquota.c
Examining data/f2fs-tools-1.11.0/fsck/mount.c
Examining data/f2fs-tools-1.11.0/fsck/node.c
Examining data/f2fs-tools-1.11.0/fsck/node.h
Examining data/f2fs-tools-1.11.0/fsck/quotaio.c
Examining data/f2fs-tools-1.11.0/fsck/quotaio.h
Examining data/f2fs-tools-1.11.0/fsck/quotaio_tree.c
Examining data/f2fs-tools-1.11.0/fsck/quotaio_tree.h
Examining data/f2fs-tools-1.11.0/fsck/quotaio_v2.c
Examining data/f2fs-tools-1.11.0/fsck/quotaio_v2.h
Examining data/f2fs-tools-1.11.0/fsck/resize.c
Examining data/f2fs-tools-1.11.0/fsck/segment.c
Examining data/f2fs-tools-1.11.0/fsck/sload.c
Examining data/f2fs-tools-1.11.0/fsck/xattr.c
Examining data/f2fs-tools-1.11.0/fsck/xattr.h
Examining data/f2fs-tools-1.11.0/include/android_config.h
Examining data/f2fs-tools-1.11.0/include/f2fs_fs.h
Examining data/f2fs-tools-1.11.0/include/quota.h
Examining data/f2fs-tools-1.11.0/lib/libf2fs.c
Examining data/f2fs-tools-1.11.0/lib/libf2fs_io.c
Examining data/f2fs-tools-1.11.0/lib/libf2fs_zoned.c
Examining data/f2fs-tools-1.11.0/mkfs/f2fs_format.c
Examining data/f2fs-tools-1.11.0/mkfs/f2fs_format_main.c
Examining data/f2fs-tools-1.11.0/mkfs/f2fs_format_utils.c
Examining data/f2fs-tools-1.11.0/mkfs/f2fs_format_utils.h
Examining data/f2fs-tools-1.11.0/tools/f2fs_io_parse.c
Examining data/f2fs-tools-1.11.0/tools/f2fscrypt.c
Examining data/f2fs-tools-1.11.0/tools/f2fstat.c
Examining data/f2fs-tools-1.11.0/tools/fibmap.c
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/freebsd_nvme_ioctl.h
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_cmds.h
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_cmds_basic.h
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_cmds_extra.h
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_cmds_mmc.h
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_io_linux.h
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_lib.h
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_lib_data.h
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_linux_inc.h
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_pr2serr.h
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_pt.h
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_pt_linux.h
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_pt_nvme.h
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_pt_win32.h
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_unaligned.h
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_mmc.c
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_io_linux.c
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib_data.c
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_common.c
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux.c
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c
Examining data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_write_buffer.c
Examining data/f2fs-tools-1.11.0/tools/sha512.c

FINAL RESULTS:

data/f2fs-tools-1.11.0/fsck/sload.c:151:9:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
		ret = readlink(de->full_path, de->link, F2FS_BLKSIZE - 1);
data/f2fs-tools-1.11.0/tools/fibmap.c:123:6:  [5] (race) readlink:
  This accepts filename arguments; if an attacker can move those files or
  change the link content, a race condition results. Also, it does not
  terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach.
	if (readlink(devname, linkname, sizeof(linkname)) < 0)
data/f2fs-tools-1.11.0/fsck/dump.c:451:8:  [4] (buffer) scanf:
  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.
	ret = scanf("%s", ans);
data/f2fs-tools-1.11.0/fsck/dump.c:456:9:  [4] (shell) system:
  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.
		ret = system("mkdir -p ./lost_found");
data/f2fs-tools-1.11.0/fsck/dump.c:462:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(path, "./lost_found/%s", name);
data/f2fs-tools-1.11.0/fsck/fsck.c:2563:9:  [4] (buffer) scanf:
  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.
		ret = scanf("%s", ans);
data/f2fs-tools-1.11.0/fsck/main.c:43:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(ret, "%s/%s", cwd, file);
data/f2fs-tools-1.11.0/fsck/main.c:770:10:  [4] (buffer) scanf:
  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.
			ret = scanf("%s", ans);
data/f2fs-tools-1.11.0/include/f2fs_fs.h:198: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/f2fs-tools-1.11.0/include/f2fs_fs.h:204: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/f2fs-tools-1.11.0/include/f2fs_fs.h:211: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/f2fs-tools-1.11.0/include/f2fs_fs.h:219: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/f2fs-tools-1.11.0/include/f2fs_fs.h:255: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/f2fs-tools-1.11.0/include/f2fs_fs.h:263: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/f2fs-tools-1.11.0/include/f2fs_fs.h:269: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/f2fs-tools-1.11.0/lib/libf2fs.c:578:8:  [4] (buffer) sscanf:
  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.
	ret = sscanf(ptr, "DEVNAME=%s\n", buf);
data/f2fs-tools-1.11.0/lib/libf2fs_zoned.c:43: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.
	res = fscanf(file, "%s", str);
data/f2fs-tools-1.11.0/lib/libf2fs_zoned.c:81: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.
	res = fscanf(file, "%s", str);
data/f2fs-tools-1.11.0/tools/f2fs_io_parse.c:173: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(pent->name, ptr);
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:182:13:  [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.
		int ret = access(argv[x], W_OK);
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:615:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(key_ref_full, "%s%s", F2FS_KEY_DESC_PREFIX,
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:657: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.
		    access(mnt->mnt_dir, R_OK))
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:784: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(saltbuf.key_ref_str, argv[optind]);
data/f2fs-tools-1.11.0/tools/f2fstat.c:9:27:  [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 dbg(fmt, args...)	printf(fmt, __VA_ARGS__);
data/f2fs-tools-1.11.0/tools/f2fstat.c:148: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(keyname, head);
data/f2fs-tools-1.11.0/tools/f2fstat.c:206: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(opt->partname, basename(optarg));
data/f2fs-tools-1.11.0/tools/f2fstat.c:224: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(head + index, name_h[i]);
data/f2fs-tools-1.11.0/tools/f2fstat.c:294:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(buf, format, util, used_node_blks, used_data_blks,
data/f2fs-tools-1.11.0/tools/f2fstat.c:299: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(tmp, buf);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_pr2serr.h:20:33:  [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/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:69:33:  [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/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:82:9:  [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.
    n = vfprintf(sg_warnings_strm ? sg_warnings_strm : stderr, fmt, args);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:74:33:  [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/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:87:9:  [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.
    n = vfprintf(sg_warnings_strm ? sg_warnings_strm : stderr, fmt, args);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:105:33:  [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/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:118:9:  [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.
    n = vfprintf(sg_warnings_strm ? sg_warnings_strm : stderr, fmt, args);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_mmc.c:42:33:  [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/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_mmc.c:55:9:  [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.
    n = vfprintf(sg_warnings_strm ? sg_warnings_strm : stderr, fmt, args);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_io_linux.c:28:33:  [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/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_io_linux.c:41:9:  [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.
    n = vfprintf(sg_warnings_strm ? sg_warnings_strm : stderr, fmt, args);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:58:33:  [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/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:71:9:  [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.
    n = vfprintf(sg_warnings_strm ? sg_warnings_strm : stderr, fmt, args);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:78:42:  [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, 3, 4)));
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:99:9:  [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.
    n = vsnprintf(cp, cp_max_len, fmt, args);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:2718:17:  [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.
                fprintf(fp, formatstr, buff);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:2752:13:  [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.
            fprintf(fp, formatstr, buff);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:3204:15:  [4] (buffer) sscanf:
  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.
        res = sscanf(b + 2, "%" SCNx64 , &unum);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:3207:15:  [4] (buffer) sscanf:
  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.
        res = sscanf(b, "%" SCNx64 , &unum);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:3349:9:  [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.
    n = vfprintf(stderr, fmt, args);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux.c:118:33:  [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/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux.c:131:9:  [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.
    n = vfprintf(sg_warnings_strm ? sg_warnings_strm : stderr, fmt, args);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:124:33:  [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/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:137:9:  [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.
    n = vfprintf(sg_warnings_strm ? sg_warnings_strm : stderr, fmt, args);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_write_buffer.c:394:21:  [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(ebuff, EBUFF_SZ,
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_write_buffer.c:403:25:  [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(ebuff,  EBUFF_SZ, ME "couldn't skip to "
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_write_buffer.c:414:17:  [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(ebuff, EBUFF_SZ, ME "couldn't read from %s",
data/f2fs-tools-1.11.0/fsck/main.c:171:20:  [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 ((option = getopt_long(argc, argv, option_string,
data/f2fs-tools-1.11.0/fsck/main.c:266:20:  [3] (buffer) getopt:
  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 ((option = getopt(argc, argv, option_string)) != EOF) {
data/f2fs-tools-1.11.0/fsck/main.c:327:20:  [3] (buffer) getopt:
  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 ((option = getopt(argc, argv, option_string)) != EOF) {
data/f2fs-tools-1.11.0/fsck/main.c:382:20:  [3] (buffer) getopt:
  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 ((option = getopt(argc, argv, option_string)) != EOF) {
data/f2fs-tools-1.11.0/fsck/main.c:421:20:  [3] (buffer) getopt:
  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 ((option = getopt(argc, argv, option_string)) != EOF) {
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:622:2:  [3] (random) srand:
  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.
	srand(time(NULL));
data/f2fs-tools-1.11.0/mkfs/f2fs_format_main.c:117:19:  [3] (buffer) getopt:
  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 ((option = getopt(argc,argv,option_string)) != EOF) {
data/f2fs-tools-1.11.0/tools/f2fs_io_parse.c:124:19:  [3] (buffer) getopt:
  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 ((option = getopt(argc, argv, option_string)) != EOF) {
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:695:16:  [3] (buffer) getopt:
  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 ((opt = getopt(argc, argv, "k:S:p:vq")) != -1) {
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:759:14:  [3] (buffer) getopt:
  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 (argc, argv, "p:")) != EOF) {
data/f2fs-tools-1.11.0/tools/f2fstat.c:197:19:  [3] (buffer) getopt:
  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 ((option = getopt(argc, argv, option_string)) != EOF) {
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_write_buffer.c:217:13:  [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.
        c = getopt_long(argc, argv, "b:dhi:I:l:m:o:rs:S:t:vV", long_options,
data/f2fs-tools-1.11.0/fsck/dict.c:1205: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.
typedef char input_t[256];
data/f2fs-tools-1.11.0/fsck/dict.c:1244: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, str, sz);
data/f2fs-tools-1.11.0/fsck/dict.c:1470:20:  [2] (integer) atoi:
  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).
					int dictnum = atoi(tok1);
data/f2fs-tools-1.11.0/fsck/dict.c:1483:18:  [2] (integer) atoi:
  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).
					int dict1 = atoi(tok1), dict2 = atoi(tok2);
data/f2fs-tools-1.11.0/fsck/dict.c:1483:38:  [2] (integer) atoi:
  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).
					int dict1 = atoi(tok1), dict2 = atoi(tok2);
data/f2fs-tools-1.11.0/fsck/dir.c:208: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(d->filename[bit_pos], name, len);
data/f2fs-tools-1.11.0/fsck/dir.c:351: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(dent_blk->filename[0], ".", 1);
data/f2fs-tools-1.11.0/fsck/dir.c:357: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(dent_blk->filename[1], "..", 2);
data/f2fs-tools-1.11.0/fsck/dir.c:388: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(inline_data_addr(inode), symname, symlen);
data/f2fs-tools-1.11.0/fsck/dir.c:395: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(data_blk, symname, symlen);
data/f2fs-tools-1.11.0/fsck/dir.c:454: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_blk->i.i_name, de->name, de->len);
data/f2fs-tools-1.11.0/fsck/dir.c:484: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 inline_data[MAX_INLINE_DATA(node)];
data/f2fs-tools-1.11.0/fsck/dir.c:493: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(inline_data, inline_data_addr(node), MAX_INLINE_DATA(node));
data/f2fs-tools-1.11.0/fsck/dir.c:517: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.bitmap, src.bitmap, src.nr_bitmap);
data/f2fs-tools-1.11.0/fsck/dir.c:521: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.dentry, src.dentry, SIZE_OF_DIR_ENTRY * src.max);
data/f2fs-tools-1.11.0/fsck/dir.c:522: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.filename, src.filename, src.max * F2FS_SLOT_LEN);
data/f2fs-tools-1.11.0/fsck/dump.c:26:7:  [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 *seg_type_name[SEG_TYPE_MAX + 1] = {
data/f2fs-tools-1.11.0/fsck/dump.c:43: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[BUF_SZ];
data/f2fs-tools-1.11.0/fsck/dump.c:55: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("dump_nat", O_CREAT|O_WRONLY|O_TRUNC, 0666);
data/f2fs-tools-1.11.0/fsck/dump.c:132: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[BUF_SZ];
data/f2fs-tools-1.11.0/fsck/dump.c:139: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("dump_sit", O_CREAT|O_WRONLY|O_TRUNC, 0666);
data/f2fs-tools-1.11.0/fsck/dump.c:197: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[BUF_SZ];
data/f2fs-tools-1.11.0/fsck/dump.c:201: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("dump_ssa", O_CREAT|O_WRONLY|O_TRUNC, 0666);
data/f2fs-tools-1.11.0/fsck/dump.c:252: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[F2FS_BLKSIZE];
data/f2fs-tools-1.11.0/fsck/dump.c:326: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 xattr_name[F2FS_NAME_LEN] = {0};
data/f2fs-tools-1.11.0/fsck/dump.c:432: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[F2FS_NAME_LEN + 1] = {0};
data/f2fs-tools-1.11.0/fsck/dump.c:433: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[1024] = {0};
data/f2fs-tools-1.11.0/fsck/dump.c:434: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 ans[255] = {0};
data/f2fs-tools-1.11.0/fsck/dump.c:464: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).
		c.dump_fd = open(path, O_TRUNC|O_CREAT|O_RDWR, 0666);
data/f2fs-tools-1.11.0/fsck/dump.c:646: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 en[F2FS_NAME_LEN + 1];
data/f2fs-tools-1.11.0/fsck/f2fs.h:434:17:  [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 unsigned char f2fs_type_by_mode[S_IFMT >> S_SHIFT] = {
data/f2fs-tools-1.11.0/fsck/fsck.c:732: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 buf[MAX_INLINE_DATA(node_blk)];
data/f2fs-tools-1.11.0/fsck/fsck.c:1132: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, name, len);
data/f2fs-tools-1.11.0/fsck/fsck.c:1150: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 new[F2FS_NAME_LEN + 1];
data/f2fs-tools-1.11.0/fsck/fsck.c:1195: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 new[F2FS_NAME_LEN + 1];
data/f2fs-tools-1.11.0/fsck/fsck.c:1288: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(*filename, name, len);
data/f2fs-tools-1.11.0/fsck/fsck.c:1312: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 en[F2FS_NAME_LEN + 1];
data/f2fs-tools-1.11.0/fsck/fsck.c:1385: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, filenames[i], name_len);
data/f2fs-tools-1.11.0/fsck/fsck.c:2126: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[80];
data/f2fs-tools-1.11.0/fsck/fsck.c:2152: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(fnode->i.i_name, name, namelen);
data/f2fs-tools-1.11.0/fsck/fsck.c:2560: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 ans[255] = {0};
data/f2fs-tools-1.11.0/fsck/fsck.h:97: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/f2fs-tools-1.11.0/fsck/main.c:34: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 cwd[PATH_MAX];
data/f2fs-tools-1.11.0/fsck/main.c:195:20:  [2] (integer) atoi:
  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).
				c.preen_mode = atoi(optarg);
data/f2fs-tools-1.11.0/fsck/main.c:213:16:  [2] (integer) atoi:
  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).
				c.dbg_lv = atoi(optarg);
data/f2fs-tools-1.11.0/fsck/main.c:222:25:  [2] (integer) atoi:
  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).
				c.preserve_limits = atoi(optarg);
data/f2fs-tools-1.11.0/fsck/main.c:275:16:  [2] (integer) atoi:
  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).
				c.dbg_lv = atoi(optarg);
data/f2fs-tools-1.11.0/fsck/main.c:336:16:  [2] (integer) atoi:
  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).
				c.dbg_lv = atoi(optarg);
data/f2fs-tools-1.11.0/fsck/main.c:391:16:  [2] (integer) atoi:
  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).
				c.dbg_lv = atoi(optarg);
data/f2fs-tools-1.11.0/fsck/main.c:431:16:  [2] (integer) atoi:
  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).
				c.dbg_lv = atoi(optarg);
data/f2fs-tools-1.11.0/fsck/main.c:767: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 ans[255] = {0};
data/f2fs-tools-1.11.0/fsck/mount.c:177: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 en[F2FS_NAME_LEN + 1];
data/f2fs-tools-1.11.0/fsck/mount.c:292: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[MAX_VOLUME_NAME];
data/f2fs-tools-1.11.0/fsck/mount.c:610: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[F2FS_BLKSIZE];
data/f2fs-tools-1.11.0/fsck/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(sbi->raw_super, buf + F2FS_SUPER_OFFSET,
data/f2fs-tools-1.11.0/fsck/mount.c:635: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(c.sb_version, sbi->raw_super->version, VERSION_LEN);
data/f2fs-tools-1.11.0/fsck/mount.c:637: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(c.init_version, sbi->raw_super->init_version, VERSION_LEN);
data/f2fs-tools-1.11.0/fsck/mount.c:646: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(sbi->raw_super->version,
data/f2fs-tools-1.11.0/fsck/mount.c:834: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/f2fs-tools-1.11.0/fsck/mount.c:849: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(ckpt + i * blk_size, cur_page, blk_size);
data/f2fs-tools-1.11.0/fsck/mount.c:1155: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/f2fs-tools-1.11.0/fsck/mount.c:1204: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/f2fs-tools-1.11.0/fsck/mount.c:1248: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->journal.n_nats, kaddr, SUM_JOURNAL_SIZE);
data/f2fs-tools-1.11.0/fsck/mount.c:1251: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->journal.n_sits, kaddr + SUM_JOURNAL_SIZE,
data/f2fs-tools-1.11.0/fsck/mount.c:1342: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/f2fs-tools-1.11.0/fsck/mount.c:1361: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_blk->entries[offset], sum, sizeof(*sum));
data/f2fs-tools-1.11.0/fsck/mount.c:1497: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/f2fs-tools-1.11.0/fsck/mount.c:1577: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]),
data/f2fs-tools-1.11.0/fsck/mount.c:1605: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],
data/f2fs-tools-1.11.0/fsck/mount.c:1789: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/f2fs-tools-1.11.0/fsck/mount.c:1841: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(sit->valid_map, ptr, SIT_VBLOCK_MAP_SIZE);
data/f2fs-tools-1.11.0/fsck/mount.c:1848: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(se->cur_valid_map, ptr, SIT_VBLOCK_MAP_SIZE);
data/f2fs-tools-1.11.0/fsck/mount.c:1887: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(sit->valid_map, se->cur_valid_map, SIT_VBLOCK_MAP_SIZE);
data/f2fs-tools-1.11.0/fsck/mount.c:1928: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(&nat_block->entries[entry_off], &nat_in_journal(journal, i),
data/f2fs-tools-1.11.0/fsck/mount.c:1968: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(sit->valid_map, se->cur_valid_map, SIT_VBLOCK_MAP_SIZE);
data/f2fs-tools-1.11.0/fsck/mount.c:2066: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(curseg->sum_blk, &buf, SUM_ENTRIES_SIZE);
data/f2fs-tools-1.11.0/fsck/mount.c:2114: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(journal, i),
data/f2fs-tools-1.11.0/fsck/mount.c:2343: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(&raw_nat, &nat_in_journal(journal, i),
data/f2fs-tools-1.11.0/fsck/mount.c:2386: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(zero_buff + F2FS_SUPER_OFFSET, sb, sizeof(*sb));
data/f2fs-tools-1.11.0/fsck/quotaio.c:24: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.
static const char * const extensions[MAXQUOTAS] = {
data/f2fs-tools-1.11.0/fsck/quotaio.h:229: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(ptr, &pp, sizeof (pp));
data/f2fs-tools-1.11.0/fsck/quotaio.h:241: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(ptr, &pp, sizeof(pp));
data/f2fs-tools-1.11.0/fsck/quotaio.h:252: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(ptr, &p, sizeof(p));
data/f2fs-tools-1.11.0/fsck/resize.c:429: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(sit->valid_map, se->cur_valid_map, SIT_VBLOCK_MAP_SIZE);
data/f2fs-tools-1.11.0/fsck/resize.c:512: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_cp, cp, (unsigned char *)cp->sit_nat_version_bitmap -
data/f2fs-tools-1.11.0/fsck/resize.c:580: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 + F2FS_SUPER_OFFSET, new_sb, sizeof(*new_sb));
data/f2fs-tools-1.11.0/fsck/resize.c:602: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_sb, F2FS_RAW_SUPER(sbi), sizeof(*new_sb));
data/f2fs-tools-1.11.0/fsck/segment.c:147: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(buffer, blk_buffer + off_in_blk, len_in_blk);
data/f2fs-tools-1.11.0/fsck/segment.c:224: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(blk_buffer + off_in_blk, buffer, len_in_blk);
data/f2fs-tools-1.11.0/fsck/segment.c:284: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(de->full_path, O_RDONLY);
data/f2fs-tools-1.11.0/fsck/segment.c:314: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(inline_data_addr(node_blk), buffer, de->size);
data/f2fs-tools-1.11.0/fsck/sload.c:189:32:  [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.
		dentries[i].name = (unsigned char *)strdup(namelist[i]->d_name);
data/f2fs-tools-1.11.0/fsck/sload.c:194:29:  [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.
		dentries[i].len = strlen((char *)dentries[i].name);
data/f2fs-tools-1.11.0/fsck/xattr.c:30: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(txattr_addr, inline_xattr_addr(&inode->i), inline_size);
data/f2fs-tools-1.11.0/fsck/xattr.c:80: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(inline_xattr_addr(&inode->i), txattr_addr, inline_size);
data/f2fs-tools-1.11.0/fsck/xattr.c:106: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(xattr_addr, txattr_addr + inline_size,
data/f2fs-tools-1.11.0/fsck/xattr.c:213: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(last->e_name, name, len);
data/f2fs-tools-1.11.0/fsck/xattr.c:215: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(pval, value, size);
data/f2fs-tools-1.11.0/fsck/xattr.h:34: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 e_name[0];		/* attribute name */
data/f2fs-tools-1.11.0/include/f2fs_fs.h:353: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 *extension_list[2];
data/f2fs-tools-1.11.0/include/f2fs_fs.h:664: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/f2fs-tools-1.11.0/include/f2fs_fs.h:667: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/f2fs-tools-1.11.0/lib/libf2fs.c:544: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[32];
data/f2fs-tools-1.11.0/lib/libf2fs.c:547: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.
	static char rootdev[PATH_MAX + 1];
data/f2fs-tools-1.11.0/lib/libf2fs.c:555: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(buf, O_RDONLY);
data/f2fs-tools-1.11.0/lib/libf2fs.c:698: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(path, O_RDONLY | O_EXCL);
data/f2fs-tools-1.11.0/lib/libf2fs.c:781: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 reply_buffer[96] = {0};
data/f2fs-tools-1.11.0/lib/libf2fs.c:782: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 model_inq[6] = {MODELINQUIRY};
data/f2fs-tools-1.11.0/lib/libf2fs.c:787: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((char *)dev->path, O_RDWR | O_CREAT | O_BINARY, 0644);
data/f2fs-tools-1.11.0/lib/libf2fs.c:789: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((char *)dev->path, O_RDWR);
data/f2fs-tools-1.11.0/lib/libf2fs.c:805:10:  [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).
		c.kd = open("/proc/version", O_RDONLY);
data/f2fs-tools-1.11.0/lib/libf2fs.c:1016: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((char *)dev->path, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0644);
data/f2fs-tools-1.11.0/lib/libf2fs.c:1018: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((char *)dev->path, O_RDWR | O_BINARY);
data/f2fs-tools-1.11.0/lib/libf2fs_io.c:90: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(out + (i * F2FS_BLKSIZE),
data/f2fs-tools-1.11.0/lib/libf2fs_io.c:111: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(blocks[cur_block], in + (i * F2FS_BLKSIZE),
data/f2fs-tools-1.11.0/lib/libf2fs_io.c:145: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(buf + i * F2FS_BLKSIZE, blocks[start + i], F2FS_BLKSIZE);
data/f2fs-tools-1.11.0/lib/libf2fs_zoned.c:30: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 str[128];
data/f2fs-tools-1.11.0/lib/libf2fs_zoned.c:38:9:  [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 = fopen(str, "r");
data/f2fs-tools-1.11.0/lib/libf2fs_zoned.c:66: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 str[128];
data/f2fs-tools-1.11.0/lib/libf2fs_zoned.c:76:9:  [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 = fopen(str, "r");
data/f2fs-tools-1.11.0/lib/libf2fs_zoned.c:87:12:  [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).
	sectors = atol(str);
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:111: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->extension_list[pos++], *extlist, name_len);
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:131: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->extension_list[pos++], ue, name_len);
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:265: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->devs[i].path, c.devices[i].path, MAX_PATH_LEN);
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:494: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(sb->version, c.version, VERSION_LEN);
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:495: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(sb->init_version, c.version, VERSION_LEN);
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:761: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_compact_p, &journal->n_nats, SUM_JOURNAL_SIZE);
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:802: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_compact_p, &journal->n_sits, SUM_JOURNAL_SIZE);
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:979: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(zero_buff + F2FS_SUPER_OFFSET, sb, sizeof(*sb));
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:1155: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(filebuf, &ddqheader, sizeof(ddqheader));
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:1165: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(filebuf + V2_DQINFOOFF, &ddqinfo, sizeof(ddqinfo));
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:1191: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(filebuf + 5136, &dqblk, sizeof(struct v2r1_disk_dqblk));
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:1377: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(dent_blk->filename[0], ".", 1);
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:1383: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(dent_blk->filename[1], "..", 2);
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:1448: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_node->i.i_name, LPF, strlen(LPF));
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:1513: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(dent_blk->filename[0], ".", 1);
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:1519: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(dent_blk->filename[1], "..", 2);
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:1533: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(dent_blk->filename[2], LPF, F2FS_SLOT_LEN);
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:1535: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(dent_blk->filename[3], LPF + F2FS_SLOT_LEN,
data/f2fs-tools-1.11.0/mkfs/f2fs_format_main.c:123:13:  [2] (integer) atoi:
  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).
			c.heap = atoi(optarg);
data/f2fs-tools-1.11.0/mkfs/f2fs_format_main.c:139:15:  [2] (integer) atoi:
  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).
			c.dbg_lv = atoi(optarg);
data/f2fs-tools-1.11.0/mkfs/f2fs_format_main.c:168:21:  [2] (integer) atoi:
  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).
			c.segs_per_sec = atoi(optarg);
data/f2fs-tools-1.11.0/mkfs/f2fs_format_main.c:176:22:  [2] (integer) atoi:
  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).
			c.secs_per_zone = atoi(optarg);
data/f2fs-tools-1.11.0/mkfs/f2fs_format_main.c:179:13:  [2] (integer) atoi:
  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).
			c.trim = atoi(optarg);
data/f2fs-tools-1.11.0/mkfs/f2fs_format_main.c:185:27:  [2] (integer) atoi:
  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).
			c.wanted_sector_size = atoi(optarg);
data/f2fs-tools-1.11.0/tools/f2fs_io_parse.c:75: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[P_NAMELEN];
data/f2fs-tools-1.11.0/tools/f2fs_io_parse.c:210: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 line[300];
data/f2fs-tools-1.11.0/tools/f2fs_io_parse.c:308:9:  [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 = fopen(argv[opt], "r");
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:120: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 raw[F2FS_MAX_KEY_SIZE];
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:229: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 key_ref_str[F2FS_KEY_REF_STR_BUF_SIZE];
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:230: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 key_desc[F2FS_KEY_DESCRIPTOR_SIZE];
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:231: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 key[F2FS_MAX_KEY_SIZE];
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:237:1:  [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 in_passphrase[F2FS_MAX_PASSPHRASE_SIZE];
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:320: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[F2FS_MAX_SALT_SIZE];
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:335: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(cp, O_RDONLY | O_DIRECTORY);
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:337: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).
			fd = open(cp, O_RDONLY);
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:351: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 tmp[80];
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:388: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(salt_buf, buf, salt_len);
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:409: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(argv[x], O_DIRECTORY);
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:434: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(policy.master_key_descriptor, salt->key_desc,
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:450:33:  [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 void pbkdf2_sha512(const char *passphrase, struct salt *salt,
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:452:15:  [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 derived_key[F2FS_MAX_KEY_SIZE])
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:455: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[SHA512_LENGTH + F2FS_MAX_PASSPHRASE_SIZE] = {0};
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:456: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 tempbuf[SHA512_LENGTH] = {0};
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:457: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 final[SHA512_LENGTH] = {0};
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:458: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 saltbuf[F2FS_MAX_SALT_SIZE + F2FS_MAX_PASSPHRASE_SIZE] = {0};
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:477: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(saltbuf, salt->salt, salt->salt_len);
data/f2fs-tools-1.11.0/tools/f2fscrypt.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(&saltbuf[F2FS_MAX_SALT_SIZE], passphrase, passphrase_size);
data/f2fs-tools-1.11.0/tools/f2fscrypt.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(&buf[SHA512_LENGTH], passphrase, passphrase_size);
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:489: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(buf, tempbuf, SHA512_LENGTH);
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:495: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(derived_key, final, F2FS_MAX_KEY_SIZE);
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:534: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[4];
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:589: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 key_ref1[SHA512_LENGTH];
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:590: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 key_ref2[SHA512_LENGTH];
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:595: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(salt->key_desc, key_ref2, F2FS_KEY_DESCRIPTOR_SIZE);
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:597: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(&salt->key_ref_str[x * 2], "%02x",
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:607: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 key_ref_full[F2FS_KEY_DESC_PREFIX_SIZE +
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:631: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.raw, salt->key, F2FS_MAX_KEY_SIZE);
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:702:10:  [2] (integer) atoi:
  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).
			pad = atoi(optarg);
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:762:10:  [2] (integer) atoi:
  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).
			pad = atoi(optarg);
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:812: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(argv[i],
data/f2fs-tools-1.11.0/tools/f2fstat.c:54: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 partname[32];
data/f2fs-tools-1.11.0/tools/f2fstat.c:82: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 keyname[32];
data/f2fs-tools-1.11.0/tools/f2fstat.c:83: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[4096];
data/f2fs-tools-1.11.0/tools/f2fstat.c:113: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(F2FS_STATUS, O_RDONLY);
data/f2fs-tools-1.11.0/tools/f2fstat.c:200:17:  [2] (integer) atoi:
  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->delay = atoi(optarg);
data/f2fs-tools-1.11.0/tools/f2fstat.c:203:20:  [2] (integer) atoi:
  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->interval = atoi(optarg);
data/f2fs-tools-1.11.0/tools/f2fstat.c:217: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_h[5][20] = {"main segments", "page/slab caches", "cp/gc", "blks", "memory"};
data/f2fs-tools-1.11.0/tools/f2fstat.c:232: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[1024], head[1024];
data/f2fs-tools-1.11.0/tools/f2fstat.c:233: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[20][10] = {"util", "node", "data", "free", "valid", "dirty", "prefree", "node", "dent", "meta",
data/f2fs-tools-1.11.0/tools/f2fstat.c:280: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[1024], tmp[1024];
data/f2fs-tools-1.11.0/tools/fibmap.c:99: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 devname[32] = { 0, };
data/f2fs-tools-1.11.0/tools/fibmap.c:100: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 linkname[32] = { 0, };
data/f2fs-tools-1.11.0/tools/fibmap.c:103: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(devname, "/dev/block/%d:%d", major(st->st_dev), minor(st->st_dev));
data/f2fs-tools-1.11.0/tools/fibmap.c:105: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(devname, O_RDONLY);
data/f2fs-tools-1.11.0/tools/fibmap.c:157: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(filename, O_RDONLY|O_LARGEFILE);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_cmds_basic.h:211: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 vendor[9];             /* T10 field is 8 bytes, NUL char appended */
data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_cmds_basic.h:212: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 product[17];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_cmds_basic.h:213: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 revision[5];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/include/sg_pt_linux.h:119: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 tmf_request[4];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:126: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 b[512];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:192: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 b[1024];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:342: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 inq_cdb[INQUIRY_CMDLEN] = {INQUIRY_CMD, 0, 0, 0, 0, 0};
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:343: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:435: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 inq_resp[SAFE_STD_INQ_RESP_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:454: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(inq_data->vendor, inq_resp + 8, 8);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:455: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(inq_data->product, inq_resp + 16, 16);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:456: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(inq_data->revision, inq_resp + 32, 4);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:493: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 tur_cdb[TUR_CMDLEN] = {TUR_CMD, 0, 0, 0, 0, 0};
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:494: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:559: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 rs_cdb[REQUEST_SENSE_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:561: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:622: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 rl_cdb[REPORT_LUNS_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:624: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:110: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 sc_cdb[SYNCHRONIZE_CACHE_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:112: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:170: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 rc_cdb[SERVICE_ACTION_IN_16_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:173: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:226: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 rc_cdb[READ_CAPACITY_10_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:228: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:279: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 modes_cdb[MODE_SENSE6_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:281: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:378: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 modes_cdb[MODE_SENSE10_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:380: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:465: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 modes_cdb[MODE_SELECT6_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:467: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:525: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 modes_cdb[MODE_SELECT10_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:527: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:679: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 buff[MODE_RESP_ARB_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:680: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 ebuff[EBUFF_SZ];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:778:13:  [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(pcontrol_arr[k], buff + offset, xfer_len);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:814: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 logs_cdb[LOG_SENSE_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:816: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:898: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 logs_cdb[LOG_SELECT_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:900: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:968: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 ssuBlk[START_STOP_CMDLEN] = {START_STOP_CMD, 0, 0, 0, 0, 0};
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:969: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:1026: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 p_cdb[PREVENT_ALLOW_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic2.c:1028: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:141: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 getLbaStatCmd[SERVICE_ACTION_IN_16_CMDLEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:142: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:218: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 gls32_cmd[GLS32_CMD_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:219: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:295: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 rtpg_cdb[MAINTENANCE_IN_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:298: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:360: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 stpg_cdb[MAINTENANCE_OUT_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:363: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:416: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 repRef_cdb[SERVICE_ACTION_IN_16_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:419: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:486: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 senddiag_cdb[SEND_DIAGNOSTIC_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:488: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:571: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 rcvdiag_cdb[RECEIVE_DIAGNOSTICS_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:573: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:644: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 rdef_cdb[READ_DEFECT10_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:646: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:715: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 rmsn_cdb[SERVICE_ACTION_IN_12_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:718: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:779: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 rii_cdb[MAINTENANCE_IN_CMDLEN] = {MAINTENANCE_IN_CMD,
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:782: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:845: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 sii_cdb[MAINTENANCE_OUT_CMDLEN] = {MAINTENANCE_OUT_CMD,
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:848: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:929: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 fu_cdb[FORMAT_UNIT_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:931: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:999: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 reass_cdb[REASSIGN_BLKS_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1001: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1058: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 prin_cdb[PERSISTENT_RESERVE_IN_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1060: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1125: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 prout_cdb[PERSISTENT_RESERVE_OUT_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1127: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1204: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 readLong_cdb[READ_LONG10_CMDLEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1205: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1296: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 readLong_cdb[SERVICE_ACTION_IN_16_CMDLEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1297: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1389: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 writeLong_cdb[WRITE_LONG10_CMDLEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1390: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1468: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 writeLong_cdb[SERVICE_ACTION_OUT_16_CMDLEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1469: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1554: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 v_cdb[VERIFY10_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1556: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1634: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 v_cdb[VERIFY16_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1636: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1732: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 apt_cdb[ATA_PT_32_CMDLEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1733: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1738: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 b[256];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1746: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(apt_cdb + 1, cdbp + 1,  10);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1752: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(apt_cdb + 1, cdbp + 1,  14);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1761: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(apt_cdb + 10, cdbp + 10,  32 - 10);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1840:13:  [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(sensep, sp, k);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1848:17:  [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(ata_return_dp, bp, k);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1886: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 rbuf_cdb[READ_BUFFER_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1888: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1951: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 wbuf_cdb[WRITE_BUFFER_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:1953: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:2106: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 u_cdb[UNMAP_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:2108: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:2164: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 rl_cdb[READ_BLOCK_LIMITS_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:2166: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:2225: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 rcvcopyres_cdb[THIRD_PARTY_COPY_IN_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:2227: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:2229: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 b[64];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:2288: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 xcopy_cdb[THIRD_PARTY_COPY_OUT_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:2290: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:2348: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 xcopy_cdb[THIRD_PARTY_COPY_OUT_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:2350: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:2352: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 cname[80];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:2436: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 preFetchCdb[PRE_FETCH16_CMDLEN]; /* all use longest cdb */
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_extra.c:2437: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_mmc.c:80: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 scsCmdBlk[SET_CD_SPEED_CMDLEN] = {SET_CD_SPEED_CMD, 0,
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_mmc.c:82: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_mmc.c:141: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 gcCmdBlk[GET_CONFIG_CMD_LEN] = {GET_CONFIG_CMD, 0, 0, 0,
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_mmc.c:143: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_mmc.c:235: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 gpCmdBlk[GET_PERFORMANCE_CMD_LEN] = {GET_PERFORMANCE_CMD, 0,
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_mmc.c:237: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_mmc.c:330: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 ssCmdBlk[SET_STREAMING_CMDLEN] =
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_mmc.c:332: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 sense_b[SENSE_BUFF_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:153: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 buff[CMD_NAME_LEN];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:206: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 buff[128];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:752: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 e[64];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:1239: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 c[40];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:1293: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 z[64];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:1474:17:  [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 c[480];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:1619: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 ebuff[64];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:1620: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 b[256];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:1813: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 z[64];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:2112: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 b[80];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:2645: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 safe_errbuf[64] = {'u', 'n', 'k', 'n', 'o', 'w', 'n', ' ',
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:2690: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 buff[82];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:2799: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 buff[DSHS_LINE_BLEN + 2];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:2800: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 a[DSHS_BPL + 1];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:2828: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(buff, leadin, bpstart);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:2851:17:  [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, leadin, bpstart);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:2893: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 c[sizeof(uint16_t)];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:2950: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 buff[82];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:3044: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 lb[16];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:3062: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(lb, buf, len);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:3180: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 lb[32];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:3198: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(lb, buf, len);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib_data.c:1457:7:  [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 * sg_lib_pdt_strs[32] = {    /* should have 2**5 elements */
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_common.c:52: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 b[4];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_common.c:68: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(dop + 8, nvme_scsi_vendor_str, 8); /* N.B. this is "NVMe    " */
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_common.c:69: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(dop + 16, nvme_id_ctl_p + 24, 40);  /* MN */
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_common.c:81: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(dop + n, nvme_id_ctl_p + 4, 20); /* SN */
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_common.c:108: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(dop + n + 4, nvme_id_ns_p + 104, 16);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_common.c:115: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(dop + n + 4, "eui.", 4);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_common.c:118:13:  [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(dop + n + 8 + (2 * k), b, 2);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_common.c:127: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(dop + n + 4, nvme_id_ns_p + 120, 8);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_common.c:134: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(dop + n + 4, "eui.", 4);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_common.c:137:13:  [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(dop + n + 8 + (2 * k), b, 2);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux.c:147: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 a[128];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux.c: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 b[128];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux.c:151:23:  [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 (NULL == (fp = fopen(proc_devices, "r"))) {
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux.c:370:10:  [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/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:154: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 buff[8];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:167: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(b, nvme_block_devname, tlen);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:283: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(sbp + sl + 4, sks, 3);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:285: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(sbp + 15, sks, 3);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:361:13:  [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 b[80];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:459:13:  [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(inq_dout + 4, ptp->nvme_id_ctlp + 4, 20);    /* SN */
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:512:21:  [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((uint8_t *)ptp->io_hdr.din_xferp, inq_dout,
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:515:25:  [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((uint8_t *)ptp->io_hdr.din_xferp + 16,
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:518:21:  [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((uint8_t *)ptp->io_hdr.din_xferp, inq_dout, n);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:528: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(inq_dout + 8, nvme_scsi_vendor_str, 8);  /* NVMe not Intel */
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:529: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(inq_dout + 16, ptp->nvme_id_ctlp + 24, 16); /* Prod <-- MN */
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:530: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(inq_dout + 32, ptp->nvme_id_ctlp + 64, 4);  /* Rev <-- FR */
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:536:17:  [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((uint8_t *)ptp->io_hdr.din_xferp, inq_dout, n);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:601:13:  [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((uint8_t *)ptp->io_hdr.din_xferp, rl_doutp, n);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:706: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((uint8_t *)ptp->io_hdr.din_xferp, rs_dout, n);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:1033: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((uint8_t *)ptp->io_hdr.din_xferp, arr, len);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:1066: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((uint8_t *)ptp->io_hdr.din_xferp, arr, len);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:1136:17:  [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 b[64];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:1155: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(&cmd, (const uint8_t *)ptp->io_hdr.request, n);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_write_buffer.c:212: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 ebuff[EBUFF_SZ];
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_write_buffer.c:393:29:  [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 ((infd = open(file_name, O_RDONLY)) < 0) {
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_write_buffer.c:499: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 b[80];
data/f2fs-tools-1.11.0/tools/sha512.c:127: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[128];
data/f2fs-tools-1.11.0/tools/sha512.c:240: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(md->sha512.buf + md->sha512.curlen,
data/f2fs-tools-1.11.0/tools/sha512.c:254:33:  [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.
void f2fs_sha512(const unsigned char *in, unsigned long in_size,
data/f2fs-tools-1.11.0/tools/sha512.c:255:15:  [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 out[F2FS_SHA512_LENGTH])
data/f2fs-tools-1.11.0/tools/sha512.c:267: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[64];
data/f2fs-tools-1.11.0/tools/sha512.c: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 tmp[64];
data/f2fs-tools-1.11.0/tools/sha512.c:309:34:  [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 *msg = (unsigned char *) tests[i].msg;
data/f2fs-tools-1.11.0/fsck/dict.c:1241:11:  [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 sz = strlen(str) + 1;
data/f2fs-tools-1.11.0/fsck/dir.c:427: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).
		size = strlen(de->link);
data/f2fs-tools-1.11.0/fsck/dir.c:682: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).
		de.len = strlen(p);
data/f2fs-tools-1.11.0/fsck/dump.c:95:27:  [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).
					ret = write(fd, buf, strlen(buf));
data/f2fs-tools-1.11.0/fsck/dump.c:114:26:  [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).
				ret = write(fd, buf, strlen(buf));
data/f2fs-tools-1.11.0/fsck/dump.c:144:23:  [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).
	ret = write(fd, buf, strlen(buf));
data/f2fs-tools-1.11.0/fsck/dump.c:156: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).
		ret = write(fd, buf, strlen(buf));
data/f2fs-tools-1.11.0/fsck/dump.c:171:25:  [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).
			ret = write(fd, buf, strlen(buf));
data/f2fs-tools-1.11.0/fsck/dump.c:176:26:  [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).
				ret = write(fd, buf, strlen(buf));
data/f2fs-tools-1.11.0/fsck/dump.c:188:23:  [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).
	ret = write(fd, buf, strlen(buf));
data/f2fs-tools-1.11.0/fsck/dump.c:207:23:  [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).
	ret = write(fd, buf, strlen(buf));
data/f2fs-tools-1.11.0/fsck/dump.c:228: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).
		ret = write(fd, buf, strlen(buf));
data/f2fs-tools-1.11.0/fsck/dump.c:235:26:  [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).
				ret = write(fd, buf, strlen(buf));
data/f2fs-tools-1.11.0/fsck/dump.c:240:25:  [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).
			ret = write(fd, buf, strlen(buf));
data/f2fs-tools-1.11.0/fsck/dump.c:460:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(name, (const char *)inode->i_name, namelen);
data/f2fs-tools-1.11.0/fsck/fsck.c:2076:46:  [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).
	lpf_ino = f2fs_lookup(sbi, node, (u8 *)LPF, strlen(LPF));
data/f2fs-tools-1.11.0/fsck/fsck.c:2094: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).
		de.len = strlen(LPF);
data/f2fs-tools-1.11.0/fsck/main.c:41: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).
		ret = malloc(strlen(cwd) + 1 + strlen(file) + 1);
data/f2fs-tools-1.11.0/fsck/main.c:41:34:  [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).
		ret = malloc(strlen(cwd) + 1 + strlen(file) + 1);
data/f2fs-tools-1.11.0/fsck/main.c:121: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).
	for (i = 0; i < strlen(optarg); i++)
data/f2fs-tools-1.11.0/fsck/main.c:124: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).
	return i == strlen(optarg);
data/f2fs-tools-1.11.0/fsck/main.c:152: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).
	for (i = 0; i < strlen(prog); i++) {
data/f2fs-tools-1.11.0/fsck/quotaio.h:118:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	unsigned int (*read)(struct quota_file *qf, long offset,
data/f2fs-tools-1.11.0/fsck/quotaio_tree.c:67:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	err = h->read(&h->qh_qf, blk << QT_BLKSIZE_BITS, buf,
data/f2fs-tools-1.11.0/fsck/quotaio_tree.c:532:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = h->read(&h->qh_qf, offset, ddquot,
data/f2fs-tools-1.11.0/fsck/quotaio_v2.c:141:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (h->read(&h->qh_qf, 0, dqh, sizeof(struct v2_disk_dqheader)) !=
data/f2fs-tools-1.11.0/fsck/quotaio_v2.c:182:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (h->read(&h->qh_qf, V2_DQINFOOFF, &ddqinfo,
data/f2fs-tools-1.11.0/fsck/segment.c:312:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		n = read(fd, buffer, BLOCK_SZ);
data/f2fs-tools-1.11.0/fsck/segment.c:319:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		while ((n = read(fd, buffer, BLOCK_SZ)) > 0) {
data/f2fs-tools-1.11.0/fsck/sload.c:194: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).
		dentries[i].len = strlen((char *)dentries[i].name);
data/f2fs-tools-1.11.0/fsck/xattr.c:132:8:  [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(name);
data/f2fs-tools-1.11.0/fsck/xattr.c:236: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).
			XATTR_SELINUX_SUFFIX, secon, strlen(secon), 1);
data/f2fs-tools-1.11.0/lib/libf2fs.c:571:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, uevent, ret);
data/f2fs-tools-1.11.0/lib/libf2fs_io.c:75:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(c.kd, buf, len) < 0)
data/f2fs-tools-1.11.0/lib/libf2fs_io.c:175:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(fd, buf, len) < 0)
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:110: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).
			name_len = strlen(*extlist);
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:125: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).
			name_len = strlen(ue);
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:430: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).
				MAX_VOLUME_NAME, strlen(c.vol_label));
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:1447:38:  [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).
	raw_node->i.i_namelen = le32_to_cpu(strlen(LPF));
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:1448:34:  [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(raw_node->i.i_name, LPF, strlen(LPF));
data/f2fs-tools-1.11.0/mkfs/f2fs_format.c:1526: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(LPF);
data/f2fs-tools-1.11.0/mkfs/f2fs_format_main.c:131:8:  [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(optarg) > MAX_PATH_LEN) {
data/f2fs-tools-1.11.0/mkfs/f2fs_format_main.c:151:8:  [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(optarg) > 512) {
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:329: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).
		salt_len = strlen(cp);
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:332:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy((char *) buf, cp, sizeof(buf));
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:363: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(cp) & 1)
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:454:27:  [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 passphrase_size = strlen(passphrase);
data/f2fs-tools-1.11.0/tools/f2fscrypt.c:774: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(argv[optind]) != (F2FS_KEY_DESCRIPTOR_SIZE * 2)) ||
data/f2fs-tools-1.11.0/tools/f2fstat.c:119:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, 4096);
data/f2fs-tools-1.11.0/tools/f2fstat.c:140: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(head) >= sizeof(keyname)) {
data/f2fs-tools-1.11.0/tools/f2fstat.c:218: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).
	int half = (len - strlen(name_h[i])) / 2;
data/f2fs-tools-1.11.0/tools/f2fstat.c:225:11:  [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).
	index += strlen(name_h[i]);
data/f2fs-tools-1.11.0/tools/f2fstat.c:243:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
		strncpy(ptr_buf, name[i], strlen(name[i]));
data/f2fs-tools-1.11.0/tools/f2fstat.c:243:29:  [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).
		strncpy(ptr_buf, name[i], strlen(name[i]));
data/f2fs-tools-1.11.0/tools/f2fstat.c:264: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(ptr);
data/f2fs-tools-1.11.0/tools/f2fstat.c:265: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).
		ptr_buf += (len > strlen(name[i]) ? len : strlen(name[i])) + 1;
data/f2fs-tools-1.11.0/tools/f2fstat.c:265:45:  [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).
		ptr_buf += (len > strlen(name[i]) ? len : strlen(name[i])) + 1;
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_cmds_basic.c:157: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).
        if (leadin && (strlen(leadin) > 0))
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:1696: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).
            if (strlen(lip) > 0)
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:1796: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).
        if (strlen(lip) > 0)
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:2582:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(b, vp->name, b_len);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:2658: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).
        len = strlen(safe_errbuf);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:2670: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).
    for (k = ((int)strlen(b) - 1); k >= 0; --k) {
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:2816:19:  [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).
        bpstart = strlen(leadin);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:3048:11:  [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(buf);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:3145:11:  [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(buf);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:3184:11:  [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(buf);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_lib.c:3298:11:  [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(buf);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux.c:157:19:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
        if ((1 == sscanf(b, "%126s", a)) &&
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux.c:162:18:  [1] (buffer) sscanf:
  It's unclear if the %s limit in the format string is small enough
  (CWE-120). Check that the limit is sufficiently small, or use a different
  input function.
        if (2 == sscanf(b, "%d %126s", &n, a)) {
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux.c:803:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy(b, cp, max_b_len);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux.c:804: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).
    if ((int)strlen(cp) >= max_b_len)
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_pt_linux_nvme.c:164: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).
    tlen = (cp - nvme_block_devname) + 4 + strlen(buff);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_write_buffer.c:270:23:  [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(optarg);
data/f2fs-tools-1.11.0/tools/sg_write_buffer/sg_write_buffer.c:412:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            res = read(infd, dop, wb_len);
data/f2fs-tools-1.11.0/tools/sha512.c:310: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(tests[i].msg);

ANALYSIS SUMMARY:

Hits = 525
Lines analyzed = 37618 in approximately 1.02 seconds (36968 lines/second)
Physical Source Lines of Code (SLOC) = 29790
Hits@level = [0] 227 [1]  76 [2] 381 [3]  12 [4]  54 [5]   2
Hits@level+ = [0+] 752 [1+] 525 [2+] 449 [3+]  68 [4+]  56 [5+]   2
Hits/KSLOC@level+ = [0+] 25.2434 [1+] 17.6234 [2+] 15.0722 [3+] 2.28265 [4+] 1.87983 [5+] 0.0671366
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.