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/mtd-utils-2.1.2/include/common.h
Examining data/mtd-utils-2.1.2/include/crc32.h
Examining data/mtd-utils-2.1.2/include/dictionary.h
Examining data/mtd-utils-2.1.2/include/libfec.h
Examining data/mtd-utils-2.1.2/include/libiniparser.h
Examining data/mtd-utils-2.1.2/include/libmissing.h
Examining data/mtd-utils-2.1.2/include/libmtd.h
Examining data/mtd-utils-2.1.2/include/libscan.h
Examining data/mtd-utils-2.1.2/include/libubi.h
Examining data/mtd-utils-2.1.2/include/libubigen.h
Examining data/mtd-utils-2.1.2/include/linux/jffs2.h
Examining data/mtd-utils-2.1.2/include/mtd/ftl-user.h
Examining data/mtd-utils-2.1.2/include/mtd/inftl-user.h
Examining data/mtd-utils-2.1.2/include/mtd/jffs2-user.h
Examining data/mtd-utils-2.1.2/include/mtd/mtd-abi.h
Examining data/mtd-utils-2.1.2/include/mtd/mtd-user.h
Examining data/mtd-utils-2.1.2/include/mtd/nftl-user.h
Examining data/mtd-utils-2.1.2/include/mtd/ubi-media.h
Examining data/mtd-utils-2.1.2/include/mtd/ubi-user.h
Examining data/mtd-utils-2.1.2/include/mtd/ubifs-media.h
Examining data/mtd-utils-2.1.2/include/mtd_swab.h
Examining data/mtd-utils-2.1.2/include/xalloc.h
Examining data/mtd-utils-2.1.2/jffsX-utils/compr.c
Examining data/mtd-utils-2.1.2/jffsX-utils/compr.h
Examining data/mtd-utils-2.1.2/jffsX-utils/compr_lzo.c
Examining data/mtd-utils-2.1.2/jffsX-utils/compr_rtime.c
Examining data/mtd-utils-2.1.2/jffsX-utils/compr_zlib.c
Examining data/mtd-utils-2.1.2/jffsX-utils/jffs2dump.c
Examining data/mtd-utils-2.1.2/jffsX-utils/jffs2reader.c
Examining data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c
Examining data/mtd-utils-2.1.2/jffsX-utils/rbtree.c
Examining data/mtd-utils-2.1.2/jffsX-utils/rbtree.h
Examining data/mtd-utils-2.1.2/jffsX-utils/summary.h
Examining data/mtd-utils-2.1.2/jffsX-utils/sumtool.c
Examining data/mtd-utils-2.1.2/lib/common.c
Examining data/mtd-utils-2.1.2/lib/dictionary.c
Examining data/mtd-utils-2.1.2/lib/execinfo.c
Examining data/mtd-utils-2.1.2/lib/libcrc32.c
Examining data/mtd-utils-2.1.2/lib/libfec.c
Examining data/mtd-utils-2.1.2/lib/libiniparser.c
Examining data/mtd-utils-2.1.2/lib/libmtd.c
Examining data/mtd-utils-2.1.2/lib/libmtd_int.h
Examining data/mtd-utils-2.1.2/lib/libmtd_legacy.c
Examining data/mtd-utils-2.1.2/lib/libscan.c
Examining data/mtd-utils-2.1.2/lib/libubi.c
Examining data/mtd-utils-2.1.2/lib/libubi_int.h
Examining data/mtd-utils-2.1.2/lib/libubigen.c
Examining data/mtd-utils-2.1.2/misc-utils/doc_loadbios.c
Examining data/mtd-utils-2.1.2/misc-utils/docfdisk.c
Examining data/mtd-utils-2.1.2/misc-utils/fectest.c
Examining data/mtd-utils-2.1.2/misc-utils/flash_erase.c
Examining data/mtd-utils-2.1.2/misc-utils/flash_lock.c
Examining data/mtd-utils-2.1.2/misc-utils/flash_otp_dump.c
Examining data/mtd-utils-2.1.2/misc-utils/flash_otp_info.c
Examining data/mtd-utils-2.1.2/misc-utils/flash_otp_lock.c
Examining data/mtd-utils-2.1.2/misc-utils/flash_otp_write.c
Examining data/mtd-utils-2.1.2/misc-utils/flash_unlock.c
Examining data/mtd-utils-2.1.2/misc-utils/flashcp.c
Examining data/mtd-utils-2.1.2/misc-utils/ftl_check.c
Examining data/mtd-utils-2.1.2/misc-utils/ftl_format.c
Examining data/mtd-utils-2.1.2/misc-utils/lsmtd.c
Examining data/mtd-utils-2.1.2/misc-utils/lsmtd.h
Examining data/mtd-utils-2.1.2/misc-utils/lsmtd_scan.c
Examining data/mtd-utils-2.1.2/misc-utils/mcast_image.h
Examining data/mtd-utils-2.1.2/misc-utils/mtd_debug.c
Examining data/mtd-utils-2.1.2/misc-utils/mtdpart.c
Examining data/mtd-utils-2.1.2/misc-utils/recv_image.c
Examining data/mtd-utils-2.1.2/misc-utils/serve_image.c
Examining data/mtd-utils-2.1.2/nand-utils/nanddump.c
Examining data/mtd-utils-2.1.2/nand-utils/nandtest.c
Examining data/mtd-utils-2.1.2/nand-utils/nandwrite.c
Examining data/mtd-utils-2.1.2/nand-utils/nftl_format.c
Examining data/mtd-utils-2.1.2/nand-utils/nftldump.c
Examining data/mtd-utils-2.1.2/nor-utils/rfddump.c
Examining data/mtd-utils-2.1.2/nor-utils/rfdformat.c
Examining data/mtd-utils-2.1.2/tests/checkfs/checkfs.c
Examining data/mtd-utils-2.1.2/tests/checkfs/comm.c
Examining data/mtd-utils-2.1.2/tests/checkfs/common.h
Examining data/mtd-utils-2.1.2/tests/checkfs/makefiles.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.h
Examining data/mtd-utils-2.1.2/tests/fs-tests/simple/ftrunc.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/simple/orph.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/simple/perf.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/simple/test_1.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/simple/test_2.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/fwrite00.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/gcd_hupper.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/pdfrun.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rmdir00.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndrm00.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndrm99.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndwrite00.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/stress_1.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/stress_2.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/stress_3.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/utils/free_space.c
Examining data/mtd-utils-2.1.2/tests/fs-tests/utils/fstest_monitor.c
Examining data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c
Examining data/mtd-utils-2.1.2/tests/jittertest/plotJittervsFill.c
Examining data/mtd-utils-2.1.2/tests/mtd-tests/flash_readtest.c
Examining data/mtd-utils-2.1.2/tests/mtd-tests/flash_speed.c
Examining data/mtd-utils-2.1.2/tests/mtd-tests/flash_stress.c
Examining data/mtd-utils-2.1.2/tests/mtd-tests/flash_torture.c
Examining data/mtd-utils-2.1.2/tests/mtd-tests/nandbiterrs.c
Examining data/mtd-utils-2.1.2/tests/mtd-tests/nandpagetest.c
Examining data/mtd-utils-2.1.2/tests/mtd-tests/nandsubpagetest.c
Examining data/mtd-utils-2.1.2/tests/ubi-tests/helpers.c
Examining data/mtd-utils-2.1.2/tests/ubi-tests/helpers.h
Examining data/mtd-utils-2.1.2/tests/ubi-tests/integ.c
Examining data/mtd-utils-2.1.2/tests/ubi-tests/io_basic.c
Examining data/mtd-utils-2.1.2/tests/ubi-tests/io_paral.c
Examining data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c
Examining data/mtd-utils-2.1.2/tests/ubi-tests/io_update.c
Examining data/mtd-utils-2.1.2/tests/ubi-tests/mkvol_bad.c
Examining data/mtd-utils-2.1.2/tests/ubi-tests/mkvol_basic.c
Examining data/mtd-utils-2.1.2/tests/ubi-tests/mkvol_paral.c
Examining data/mtd-utils-2.1.2/tests/ubi-tests/rsvol.c
Examining data/mtd-utils-2.1.2/tests/ubi-tests/volrefcnt.c
Examining data/mtd-utils-2.1.2/tests/unittests/libmtd_test.c
Examining data/mtd-utils-2.1.2/tests/unittests/libubi_test.c
Examining data/mtd-utils-2.1.2/tests/unittests/test_lib.h
Examining data/mtd-utils-2.1.2/ubi-utils/mtdinfo.c
Examining data/mtd-utils-2.1.2/ubi-utils/ubiattach.c
Examining data/mtd-utils-2.1.2/ubi-utils/ubiblock.c
Examining data/mtd-utils-2.1.2/ubi-utils/ubicrc32.c
Examining data/mtd-utils-2.1.2/ubi-utils/ubidetach.c
Examining data/mtd-utils-2.1.2/ubi-utils/ubiformat.c
Examining data/mtd-utils-2.1.2/ubi-utils/ubihealthd.c
Examining data/mtd-utils-2.1.2/ubi-utils/ubimkvol.c
Examining data/mtd-utils-2.1.2/ubi-utils/ubinfo.c
Examining data/mtd-utils-2.1.2/ubi-utils/ubinize.c
Examining data/mtd-utils-2.1.2/ubi-utils/ubirename.c
Examining data/mtd-utils-2.1.2/ubi-utils/ubirmvol.c
Examining data/mtd-utils-2.1.2/ubi-utils/ubirsvol.c
Examining data/mtd-utils-2.1.2/ubi-utils/ubiupdatevol.c
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/compr.c
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/compr.h
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/crc16.c
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/crc16.h
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/crypto.c
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/crypto.h
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/defs.h
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/devtable.c
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/fscrypt.c
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/fscrypt.h
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/hashtable/hashtable.c
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/hashtable/hashtable.h
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/hashtable/hashtable_itr.c
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/hashtable/hashtable_itr.h
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/hashtable/hashtable_private.h
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/key.h
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/lpt.c
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/lpt.h
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.h
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/sign.c
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/sign.h
Examining data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/ubifs.h

FINAL RESULTS:

data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:151:14:  [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.
		readsize = readlink(path, buf, bufsize); /* 1st try */
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1660:8:  [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.
	len = readlink(path, buf, 8192);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2114:10:  [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.
	bytes = readlink(path, buf, PATH_MAX);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2768:10:  [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.
			CHECK(readlink(dent->d_name, b, IO_BUFFER_SIZE) != -1);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1684:8:  [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.
	len = readlink(path_name, buf, UBIFS_MAX_INO_DATA + 1);
data/mtd-utils-2.1.2/include/common.h:85: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(fmt, ##__VA_ARGS__);                        \
data/mtd-utils-2.1.2/include/common.h:92:2:  [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: " fmt, PROGRAM_NAME, ##__VA_ARGS__);           \
data/mtd-utils-2.1.2/jffsX-utils/compr.c:387:14:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		act_buf += sprintf(act_buf, "%10s priority:%d ", this->name, this->priority);
data/mtd-utils-2.1.2/jffsX-utils/compr.c:423:13:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	act_buf += sprintf(act_buf,"%10s             ","none");
data/mtd-utils-2.1.2/jffsX-utils/compr.c:427:14:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		act_buf += sprintf(act_buf,"%10s (prio:%d) ",this->name,this->priority);
data/mtd-utils-2.1.2/jffsX-utils/compr.h:43:37:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define printk(...)                 fprintf(stderr,__VA_ARGS__)
data/mtd-utils-2.1.2/jffsX-utils/jffs2reader.c:374:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(tmp, "%s/%s", path, d->name);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:392:12:  [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.
inline int snprintf(char *str, size_t n, const char *fmt, ...)
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:398:8:  [4] (format) vsprintf:
  Potential format string problem (CWE-134). Make format string constant.
	ret = vsprintf(str, fmt, ap);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1078: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(xe->xname, xname);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1728: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.
					  sscanf(optarg,"%d:%s",&compr_prior,compr_name);
data/mtd-utils-2.1.2/lib/dictionary.c:74:9:  [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(t,s);
data/mtd-utils-2.1.2/lib/libiniparser.c:90: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(l, s);
data/mtd-utils-2.1.2/lib/libiniparser.c:237:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(keym, "%s:", secname);
data/mtd-utils-2.1.2/lib/libiniparser.c:425:5:  [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(line, strstrip(input_line));
data/mtd-utils-2.1.2/lib/libiniparser.c:438:9:  [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(section, strstrip(section));
data/mtd-utils-2.1.2/lib/libiniparser.c:439:9:  [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(section, strlwc(section));
data/mtd-utils-2.1.2/lib/libiniparser.c:445:9:  [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(key, strstrip(key));
data/mtd-utils-2.1.2/lib/libiniparser.c:446:9:  [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(key, strlwc(key));
data/mtd-utils-2.1.2/lib/libiniparser.c:447:9:  [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(value, strstrip(value));
data/mtd-utils-2.1.2/lib/libiniparser.c:464:9:  [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(key, strstrip(key));
data/mtd-utils-2.1.2/lib/libiniparser.c:465:9:  [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(key, strlwc(key));
data/mtd-utils-2.1.2/lib/libiniparser.c:560:13:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
            sprintf(tmp, "%s:%s", section, key);
data/mtd-utils-2.1.2/lib/libmtd.c:168:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, lib->mtd_dev, mtd_num);
data/mtd-utils-2.1.2/lib/libmtd.c:186:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, patt, mtd_num);
data/mtd-utils-2.1.2/lib/libmtd.c:362:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, patt, mtd_num);
data/mtd-utils-2.1.2/lib/libmtd.c:378:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, patt, mtd_num);
data/mtd-utils-2.1.2/lib/libmtd.c:394:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, patt, mtd_num);
data/mtd-utils-2.1.2/lib/libmtd.c:530:9:  [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.
		ret = sscanf(dirent->d_name, MTD_NAME_PATT"%s",
data/mtd-utils-2.1.2/lib/libmtd.c:545:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, lib->mtd_name, num);
data/mtd-utils-2.1.2/lib/libmtd.c:668:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(file, lib->mtd, mtd_num);
data/mtd-utils-2.1.2/lib/libmtd.c:711:9:  [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.
		ret = sscanf(dirent->d_name, MTD_NAME_PATT"%s",
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:115: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. If the scanf format is influenceable by an
  attacker, it's exploitable.
	ret = sscanf(pi->next, PROC_MTD_PATT, &pi->mtd_num, &pi->size,
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:155:6:  [4] (race) access:
  This usually indicates a security flaw. If an attacker can change anything
  along the path between the call to access() and the file's actual use
  (e.g., by moving files), the attacker can exploit the race condition
  (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid())
  and try to open the file directly.
	if (access(MTD_PROC_FILE, R_OK) != 0) {
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:259:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(node, MTD_DEV_PATT, mtd_num);
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:402: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((char *)mtd->name, pi.name);
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:428:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(node, MTD_DEV_PATT, mtd_num);
data/mtd-utils-2.1.2/lib/libubi.c:247:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, patt, dev_num);
data/mtd-utils-2.1.2/lib/libubi.c:264:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, patt, dev_num, vol_id);
data/mtd-utils-2.1.2/lib/libubi.c:280:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, patt, dev_num);
data/mtd-utils-2.1.2/lib/libubi.c:298:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, patt, dev_num, vol_id);
data/mtd-utils-2.1.2/lib/libubi.c:318:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, patt, dev_num, vol_id);
data/mtd-utils-2.1.2/lib/libubi.c:335:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, lib->dev_dev, dev_num);
data/mtd-utils-2.1.2/lib/libubi.c:354:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, lib->vol_dev, dev_num, vol_id);
data/mtd-utils-2.1.2/lib/libubi.c:416:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, lib->ubi_vol, i, minor - 1);
data/mtd-utils-2.1.2/lib/libubi.c:900:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, lib->ubi_vol, i, minor - 1);
data/mtd-utils-2.1.2/lib/libubi.c:960:9:  [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.
		ret = sscanf(dirent->d_name, UBI_DEV_NAME_PATT"%s",
data/mtd-utils-2.1.2/lib/libubi.c:1128:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(file, lib->ubi_dev, dev_num);
data/mtd-utils-2.1.2/lib/libubi.c:1165:9:  [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.
		ret = sscanf(dirent->d_name, UBI_VOL_NAME_PATT"%s", &devno, &vol_id, tmp_buf);
data/mtd-utils-2.1.2/misc-utils/flashcp.c:80:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf (fp,fmt,ap);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:292:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(buffer, flags & FLAG_LIST ? "%3d:%d" : "%d:%d", major, minor);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:298:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
		strcpy(buffer, value ? "true" : "false");
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:300:3:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
		strcpy(buffer, value ? "1" : "0");
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:514:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
				sprintf(value, "%subi%d", tree_prefix(true),
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:578:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
				sprintf(buffer, "  %subi%d_%d",
data/mtd-utils-2.1.2/nand-utils/nanddump.c:290:8:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	lx += sprintf(linebuf + lx, "%*s",
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:326: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(str, a);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:327:2:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
	strcat(str, b);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:354: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(str, a);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:356:2:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
	strcat(str, b);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1444:2:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
	strcat(name, read_suffix);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1466:2:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
	strcat(name, write_suffix);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1639:2:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
	strcat(p, target_pathname);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2075:3:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
		strcat(rel, p2);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:885: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(return_name, name);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:1279:2:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
	strcat(buf, name);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:1280:2:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
	strcat(buf, p);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/gcd_hupper.c:63:6:  [4] (buffer) fscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
	if (fscanf(f, "%d %s", &pid, program_name) != 2) {
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/gcd_hupper.c:78: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(g->name, program_name);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/pdfrun.c:43:6:  [4] (buffer) fscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
	if (fscanf(f, "%s %lu", dummy, &total_memory) != 2)
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndrm99.c:197: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(return_name, name);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:608:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		  sprintf(&tmpBuf[strlen(tmpBuf)],"<Profile saved in file:%s>",
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:934:5:  [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(OutFileName, pFileName);
data/mtd-utils-2.1.2/tests/jittertest/plotJittervsFill.c:224:25:  [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.
            converted = sscanf(lineBuf, "%s %i %i %i %i\n",
data/mtd-utils-2.1.2/tests/jittertest/plotJittervsFill.c:260:21:  [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.
        converted = sscanf(lineBuf, "%f %s %f %s\n", &junkFloat1, junkStr1, &jitter_ms, junkStr2);
data/mtd-utils-2.1.2/tests/ubi-tests/helpers.c:110:2:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
	vfprintf(stderr, fmt, args);
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:490:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(dev_name, "%s_%d", ubi_device->device_file_name, req.vol_id);
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:499:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(dev_name, "mknod %s c %d %d", s->device_file_name, maj, req.vol_id + 1);
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:500:8:  [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.
			if (system(dev_name))
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:565:6:  [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.
	if (system("modprobe -r ubi"))
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:568:6:  [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.
	if (system(ubi_module_load_string) != 0)
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:589:6:  [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.
	if (system("rmmod ubi") != 0)
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:592:6:  [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.
	if (system(ubi_module_load_string) != 0)
data/mtd-utils-2.1.2/tests/ubi-tests/io_basic.c:65:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(vol_node, UBI_VOLUME_PATTERN, dev_info.dev_num, req.vol_id);
data/mtd-utils-2.1.2/tests/ubi-tests/io_basic.c:124:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(vol_node, UBI_VOLUME_PATTERN, dev_info.dev_num, req.vol_id);
data/mtd-utils-2.1.2/tests/ubi-tests/io_paral.c:266:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(vol_name[i], PROGRAM_NAME":%d", i);
data/mtd-utils-2.1.2/tests/ubi-tests/io_paral.c:272:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(vol_nodes[i], UBI_VOLUME_PATTERN, dev_info.dev_num, i);
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:84:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(vol_node, UBI_VOLUME_PATTERN, dev_info.dev_num, req.vol_id);
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:253:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(vol_node, UBI_VOLUME_PATTERN, dev_info.dev_num,
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:352:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(vol_node, UBI_VOLUME_PATTERN, dev_info.dev_num,
data/mtd-utils-2.1.2/tests/ubi-tests/io_update.c:96:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(vol_node, UBI_VOLUME_PATTERN, dev_info.dev_num,
data/mtd-utils-2.1.2/tests/ubi-tests/io_update.c:251:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(vol_node, UBI_VOLUME_PATTERN, dev_info.dev_num,
data/mtd-utils-2.1.2/tests/ubi-tests/mkvol_bad.c:195:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(nm, "%s:%d", name, i);
data/mtd-utils-2.1.2/tests/ubi-tests/mkvol_basic.c:177:3:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
		sprintf(nm, "%s:%d", name, i);
data/mtd-utils-2.1.2/tests/ubi-tests/mkvol_paral.c:55:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(nm, "%s:%d", name, n);
data/mtd-utils-2.1.2/tests/ubi-tests/rsvol.c:147:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(vol_node, UBI_VOLUME_PATTERN, dev_info.dev_num,
data/mtd-utils-2.1.2/tests/ubi-tests/rsvol.c:256:3:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
		sprintf(vol_node, UBI_VOLUME_PATTERN, dev_info.dev_num,
data/mtd-utils-2.1.2/tests/ubi-tests/volrefcnt.c:78:2:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
	sprintf(fname, SYSFS_FILE, dev_info.dev_num, req.vol_id);
data/mtd-utils-2.1.2/ubi-utils/ubihealthd.c:74:3:  [4] (format) vfprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
		vfprintf(stderr, fmt, ap);
data/mtd-utils-2.1.2/ubi-utils/ubinize.c:256:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf, "%s:mode", sname);
data/mtd-utils-2.1.2/ubi-utils/ubinize.c:274:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf, "%s:vol_type", sname);
data/mtd-utils-2.1.2/ubi-utils/ubinize.c:294:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf, "%s:image", sname);
data/mtd-utils-2.1.2/ubi-utils/ubinize.c:309:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf, "%s:vol_id", sname);
data/mtd-utils-2.1.2/ubi-utils/ubinize.c:323:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf, "%s:vol_size", sname);
data/mtd-utils-2.1.2/ubi-utils/ubinize.c:360:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf, "%s:vol_name", sname);
data/mtd-utils-2.1.2/ubi-utils/ubinize.c:374:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf, "%s:vol_alignment", sname);
data/mtd-utils-2.1.2/ubi-utils/ubinize.c:385:2:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
	sprintf(buf, "%s:vol_flags", sname);
data/mtd-utils-2.1.2/ubi-utils/ubirename.c:136: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(rnvol.ents[count++].name, argv[i + 1]);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/devtable.c:283:4:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
			sprintf(nm, "%s%d", name, i);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1964: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(im->path_name, path_name);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/sign.c:128: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(buf, key_pass);
data/mtd-utils-2.1.2/jffsX-utils/jffs2dump.c:119:11:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
		int c = getopt_long(argc, argv, short_options,
data/mtd-utils-2.1.2/jffsX-utils/jffs2reader.c:861:16:  [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 ((opt = getopt_long(argc, argv, short_opt, long_opt, &c)) > 0) {
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1580:16:  [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 ((opt = getopt_long(argc, argv,
data/mtd-utils-2.1.2/jffsX-utils/sumtool.c:135:16:  [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 ((opt = getopt_long(argc, argv, short_options, long_options, &c)) >= 0) {
data/mtd-utils-2.1.2/lib/common.c:162: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(seed);
data/mtd-utils-2.1.2/misc-utils/fectest.c:29: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(3453);
data/mtd-utils-2.1.2/misc-utils/flash_erase.c:120:11:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
		int c = getopt_long(argc, argv, short_options,
data/mtd-utils-2.1.2/misc-utils/flash_unlock.c:84:7:  [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, short_opts, long_opts, NULL);
data/mtd-utils-2.1.2/misc-utils/flashcp.c:193:11:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
		int c = getopt_long(argc, argv, short_options,
data/mtd-utils-2.1.2/misc-utils/ftl_check.c:193:18:  [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 ((optch = getopt_long(argc, argv, "hV", long_opts, &c)) != -1) {
data/mtd-utils-2.1.2/misc-utils/ftl_format.c:285:18:  [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 ((optch = getopt_long(argc, argv, short_opts, long_opts, &c)) != -1) {
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:219:7:  [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.
		i = getopt_long(argc, argv, short_opts, long_opts, NULL);
data/mtd-utils-2.1.2/misc-utils/mtdpart.c:86:11:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
		int c = getopt_long(argc, argv, short_options,
data/mtd-utils-2.1.2/misc-utils/serve_image.c:182: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((unsigned)then.tv_usec);
data/mtd-utils-2.1.2/nand-utils/nanddump.c:125:11:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
		int c = getopt_long(argc, argv, short_options,
data/mtd-utils-2.1.2/nand-utils/nandtest.c:180:11:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
		int c = getopt_long(argc, argv, short_options, long_options, &option_index);
data/mtd-utils-2.1.2/nand-utils/nandtest.c:280: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(seed);
data/mtd-utils-2.1.2/nand-utils/nandtest.c:289:4:  [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(seed);
data/mtd-utils-2.1.2/nand-utils/nandwrite.c:132:11:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
		int c = getopt_long(argc, argv, short_options,
data/mtd-utils-2.1.2/nand-utils/nftl_format.c:241:14:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
	while ((c = getopt_long(argc, argv, "?hibV", long_opts, &idx)) != -1) {
data/mtd-utils-2.1.2/nor-utils/rfddump.c:97:11:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
		int c = getopt_long(argc, argv, short_options,
data/mtd-utils-2.1.2/nor-utils/rfdformat.c:65:11:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
		int c = getopt_long(argc, argv, short_options,
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:673:5:  [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(seed);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:3053:9:  [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.
		key = getopt_long(argc, argv, "n:pm:evVh?", long_options, NULL);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:177:6:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	s = getenv("TEST_FILE_SYSTEM_MOUNT_DIR");
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:180:6:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	s = getenv("TEST_FILE_SYSTEM_TYPE");
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:424:3:  [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(1);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:639: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(file_number);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:746: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(file_number);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:774: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(file_number);
data/mtd-utils-2.1.2/tests/fs-tests/simple/ftrunc.c:51: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(pid);
data/mtd-utils-2.1.2/tests/fs-tests/simple/perf.c:85: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(pid);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/fwrite00.c:52: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(pid);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/pdfrun.c:72: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(pid);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndrm99.c:98:3:  [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(1);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndwrite00.c:83: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(pid);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/stress_1.c:50: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(pid);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/stress_2.c:52: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(pid);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/stress_3.c:51: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(pid);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:632:6:  [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) + seedStarter);
data/mtd-utils-2.1.2/tests/mtd-tests/flash_readtest.c:90:7:  [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, "hb:c:s:v", options, NULL);
data/mtd-utils-2.1.2/tests/mtd-tests/flash_speed.c:96:7:  [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, "hb:c:s:d", options, NULL);
data/mtd-utils-2.1.2/tests/mtd-tests/flash_stress.c:98:7:  [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, "hc:s:k", options, NULL);
data/mtd-utils-2.1.2/tests/mtd-tests/flash_stress.c:111:4:  [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(read_num(c, optarg));
data/mtd-utils-2.1.2/tests/mtd-tests/flash_stress.c:137:3:  [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/mtd-utils-2.1.2/tests/mtd-tests/flash_torture.c:104:7:  [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, "hb:c:s:kr", options, NULL);
data/mtd-utils-2.1.2/tests/mtd-tests/nandbiterrs.c:127:7:  [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, "hkb:p:s:eiow:", options, NULL);
data/mtd-utils-2.1.2/tests/mtd-tests/nandpagetest.c:95:7:  [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, "hb:c:s:Sk", options, NULL);
data/mtd-utils-2.1.2/tests/mtd-tests/nandsubpagetest.c:94:7:  [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, "hb:c:s:Sk", options, NULL);
data/mtd-utils-2.1.2/tests/ubi-tests/helpers.c:363: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(seed);
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:216: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(seed);
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:219: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(r);
data/mtd-utils-2.1.2/ubi-utils/mtdinfo.c:93:9:  [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.
		key = getopt_long(argc, argv, "auMhV", long_options, NULL);
data/mtd-utils-2.1.2/ubi-utils/ubiattach.c:106:9:  [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.
		key = getopt_long(argc, argv, "p:m:d:O:b:hV", long_options, NULL);
data/mtd-utils-2.1.2/ubi-utils/ubiblock.c:70:9:  [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.
		key = getopt_long(argc, argv, "c:r:h?V", long_options, NULL);
data/mtd-utils-2.1.2/ubi-utils/ubicrc32.c:60:9:  [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.
		key = getopt_long(argc, argv, "hV", long_options, NULL);
data/mtd-utils-2.1.2/ubi-utils/ubidetach.c:86:9:  [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.
		key = getopt_long(argc, argv, "p:m:d:hV", long_options, NULL);
data/mtd-utils-2.1.2/ubi-utils/ubiformat.c:137:9:  [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.
		key = getopt_long(argc, argv, "nh?Vyqve:x:s:O:f:S:Q:", long_options, NULL);
data/mtd-utils-2.1.2/ubi-utils/ubihealthd.c:222: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(seed);
data/mtd-utils-2.1.2/ubi-utils/ubihealthd.c:229:14:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
	while ((c = getopt_long(argc, argv, opt_string, options, &i)) != -1) {
data/mtd-utils-2.1.2/ubi-utils/ubimkvol.c:130:9:  [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.
		key = getopt_long(argc, argv, "a:n:N:s:S:t:h?Vmk", long_options, NULL);
data/mtd-utils-2.1.2/ubi-utils/ubinfo.c:92:9:  [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.
		key = getopt_long(argc, argv, "an:N:d:hV", long_options, NULL);
data/mtd-utils-2.1.2/ubi-utils/ubinize.c:119:9:  [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.
		key = getopt_long(argc, argv, "o:p:m:s:O:e:x:Q:vhV", long_options, NULL);
data/mtd-utils-2.1.2/ubi-utils/ubirmvol.c:93:9:  [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.
		key = getopt_long(argc, argv, "n:N:h?V", long_options, NULL);
data/mtd-utils-2.1.2/ubi-utils/ubirsvol.c:110:9:  [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.
		key = getopt_long(argc, argv, "s:S:n:N:h?V", long_options, NULL);
data/mtd-utils-2.1.2/ubi-utils/ubiupdatevol.c:86:9:  [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.
		key = getopt_long(argc, argv, "ts:h?V", long_options, &option_index);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:331:7:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
	if (!realpath(file_base, real_file)) {
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:335:7:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
	if (!realpath(dir, real_dir)) {
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:577:9:  [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.
		opt = getopt_long(argc, argv, optstring, longopts, &i);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/sign.c:260:13:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
	key_pass = getenv("MKFS_UBIFS_SIGN_PIN");
data/mtd-utils-2.1.2/include/common.h:137: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[64];
data/mtd-utils-2.1.2/include/libmtd.h:80:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	const char type_str[MTD_TYPE_MAX + 1];
data/mtd-utils-2.1.2/include/libmtd.h:81:8:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	const char name[MTD_NAME_MAX + 1];
data/mtd-utils-2.1.2/include/libubi.h:178: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[UBI_VOL_NAME_MAX + 1];
data/mtd-utils-2.1.2/include/mtd/inftl-user.h:73:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char bootRecordID[8];
data/mtd-utils-2.1.2/include/mtd/nftl-user.h:14: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 ECCSig[6];
data/mtd-utils-2.1.2/include/mtd/nftl-user.h: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 DataOrgID[6];
data/mtd-utils-2.1.2/include/mtd/ubi-user.h:333: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[UBI_MAX_VOLUME_NAME + 1];
data/mtd-utils-2.1.2/include/mtd/ubi-user.h:390:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		char    name[UBI_MAX_VOLUME_NAME + 1];
data/mtd-utils-2.1.2/jffsX-utils/compr.c:389:15:  [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.
			act_buf += sprintf(act_buf,"disabled");
data/mtd-utils-2.1.2/jffsX-utils/compr.c:391:15:  [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.
			act_buf += sprintf(act_buf,"enabled");
data/mtd-utils-2.1.2/jffsX-utils/compr.c:404:13:  [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.
	act_buf += sprintf(act_buf,"Compression mode: ");
data/mtd-utils-2.1.2/jffsX-utils/compr.c:407:15:  [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.
			act_buf += sprintf(act_buf,"none");
data/mtd-utils-2.1.2/jffsX-utils/compr.c:410:15:  [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.
			act_buf += sprintf(act_buf,"priority");
data/mtd-utils-2.1.2/jffsX-utils/compr.c:413:15:  [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.
			act_buf += sprintf(act_buf,"size");
data/mtd-utils-2.1.2/jffsX-utils/compr.c:416:15:  [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.
			act_buf += sprintf(act_buf, "favourlzo");
data/mtd-utils-2.1.2/jffsX-utils/compr.c:419:15:  [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.
			act_buf += sprintf(act_buf, "unknown");
data/mtd-utils-2.1.2/jffsX-utils/compr.c:422:13:  [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.
	act_buf += sprintf(act_buf,"\nCompressors:\n");
data/mtd-utils-2.1.2/jffsX-utils/compr.c:424:13:  [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.
	act_buf += sprintf(act_buf,"compr: %d blocks (%d)  decompr: %d blocks\n", none_stat_compr_blocks,
data/mtd-utils-2.1.2/jffsX-utils/compr.c:429:15:  [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.
			act_buf += sprintf(act_buf,"- ");
data/mtd-utils-2.1.2/jffsX-utils/compr.c:431:15:  [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.
			act_buf += sprintf(act_buf,"+ ");
data/mtd-utils-2.1.2/jffsX-utils/compr.c:432:14:  [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.
		act_buf += sprintf(act_buf,"compr: %d blocks (%d/%d)  decompr: %d blocks ", this->stat_compr_blocks,
data/mtd-utils-2.1.2/jffsX-utils/compr_lzo.c:64: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(cpage_out, lzo_compress_buf, compress_size);
data/mtd-utils-2.1.2/jffsX-utils/compr_rtime.c:93:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
				memcpy(&cpage_out[outpos],&cpage_out[backoffs],repeat);
data/mtd-utils-2.1.2/jffsX-utils/jffs2dump.c:94: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	cnvfile[256];		// filename for conversion output
data/mtd-utils-2.1.2/jffsX-utils/jffs2dump.c:145: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).
				datsize = atoi(optarg);
data/mtd-utils-2.1.2/jffsX-utils/jffs2dump.c:148: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).
				oobsize = atoi(optarg);
data/mtd-utils-2.1.2/jffsX-utils/jffs2dump.c:179: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[256];
data/mtd-utils-2.1.2/jffsX-utils/jffs2dump.c:257: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 (name, node->d.name, node->d.nsize);
data/mtd-utils-2.1.2/jffsX-utils/jffs2dump.c:285: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(name, node->x.data, node->x.name_len);
data/mtd-utils-2.1.2/jffsX-utils/jffs2dump.c:378:25:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (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[255];
data/mtd-utils-2.1.2/jffsX-utils/jffs2dump.c:382: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(name,spd->name,spd->nsize);
data/mtd-utils-2.1.2/jffsX-utils/jffs2dump.c:491: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 (cnvfile, O_WRONLY | O_CREAT, 0644);
data/mtd-utils-2.1.2/jffsX-utils/jffs2dump.c:753:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(img, O_RDONLY)) == -1) {
data/mtd-utils-2.1.2/jffsX-utils/jffs2reader.c:104: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[256];
data/mtd-utils-2.1.2/jffsX-utils/jffs2reader.c:142: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(b + je32_to_cpu(n->offset),
data/mtd-utils-2.1.2/jffsX-utils/jffs2reader.c:179: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(d->name, n->name, n->nsize);
data/mtd-utils-2.1.2/jffsX-utils/jffs2reader.c:199: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(dd->next->name, n->name, n->nsize);
data/mtd-utils-2.1.2/jffsX-utils/jffs2reader.c:266: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 buf[12];
data/mtd-utils-2.1.2/jffsX-utils/jffs2reader.c:363: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 symbuf[1024];
data/mtd-utils-2.1.2/jffsX-utils/jffs2reader.c:680: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 symbuf[1024];
data/mtd-utils-2.1.2/jffsX-utils/jffs2reader.c:886: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(argv[optind], O_RDONLY);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:167:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fp = fopen(path, mode)) == NULL)
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:616: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 ffbuf[16] =
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:741: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(e->hostname, O_RDONLY);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1017: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[XATTR_BUFFER_SIZE];
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1058: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(xvalue, buffer, offset);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1079: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(xe->xvalue, xvalue, value_len);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1140: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 xlist[XATTR_BUFFER_SIZE], xvalue[XATTR_BUFFER_SIZE];
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1450: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[256];
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1497: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 (name, node->d.name, node->d.nsize);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1609:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
				out_fd = open(optarg, O_CREAT | O_TRUNC | O_RDWR, 0644);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1742:16:  [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).
					  in_fd = open(optarg, O_RDONLY);
data/mtd-utils-2.1.2/jffsX-utils/sumtool.c:116: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 ffbuf[16] = {
data/mtd-utils-2.1.2/jffsX-utils/sumtool.c:140:14:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
				out_fd = open(optarg, O_CREAT | O_TRUNC | O_RDWR, 0644);
data/mtd-utils-2.1.2/jffsX-utils/sumtool.c:148:13:  [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).
				in_fd = open(optarg, O_RDONLY);
data/mtd-utils-2.1.2/jffsX-utils/sumtool.c:371: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(sdrnt_ptr->name, sum_collected->sum_list_head->d.name,
data/mtd-utils-2.1.2/jffsX-utils/sumtool.c:434: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(target_buff, buf, len);
data/mtd-utils-2.1.2/jffsX-utils/sumtool.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(temp->name,node->d.name,node->d.nsize);
data/mtd-utils-2.1.2/jffsX-utils/sumtool.c:650: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[256];
data/mtd-utils-2.1.2/jffsX-utils/sumtool.c:721: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 (name, node->d.name, node->d.nsize);
data/mtd-utils-2.1.2/lib/dictionary.c:52: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(newptr, ptr, size);
data/mtd-utils-2.1.2/lib/dictionary.c:372: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		cval[90] ;
data/mtd-utils-2.1.2/lib/dictionary.c:381: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(cval, "%04d", i);
data/mtd-utils-2.1.2/lib/dictionary.c:386: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(cval, "%04d", i);
data/mtd-utils-2.1.2/lib/dictionary.c:394: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(cval, "%04d", i);
data/mtd-utils-2.1.2/lib/libfec.c:721:10:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
         memcpy(fec, src[index], sz*sizeof(gf) ) ;
data/mtd-utils-2.1.2/lib/libfec.c:741:6:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	    memcpy(fec, src + (index * sz), sz*sizeof(gf) ) ;
data/mtd-utils-2.1.2/lib/libfec.c:809:6:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	    memcpy(p,  &(code->enc_matrix[index[i]*k]), k*sizeof(gf) );
data/mtd-utils-2.1.2/lib/libfec.c:870:6:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	    memcpy(pkt[row], new_pkt[row], sz*sizeof(gf));
data/mtd-utils-2.1.2/lib/libiniparser.c:53: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.
    static char l[ASCIILINESZ+1];
data/mtd-utils-2.1.2/lib/libiniparser.c:83: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.
    static char l[ASCIILINESZ+1];
data/mtd-utils-2.1.2/lib/libiniparser.c:216: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    keym[ASCIILINESZ+1];
data/mtd-utils-2.1.2/lib/libiniparser.c:422: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        line[ASCIILINESZ+1];
data/mtd-utils-2.1.2/lib/libiniparser.c:493: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 line    [ASCIILINESZ+1] ;
data/mtd-utils-2.1.2/lib/libiniparser.c:494: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 section [ASCIILINESZ+1] ;
data/mtd-utils-2.1.2/lib/libiniparser.c:495: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 key     [ASCIILINESZ+1] ;
data/mtd-utils-2.1.2/lib/libiniparser.c:496: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 tmp     [ASCIILINESZ+1] ;
data/mtd-utils-2.1.2/lib/libiniparser.c:497: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 val     [ASCIILINESZ+1] ;
data/mtd-utils-2.1.2/lib/libiniparser.c:506:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if ((in=fopen(ininame, "r"))==NULL) {
data/mtd-utils-2.1.2/lib/libmtd.c:58:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy(n, path, len1);
data/mtd-utils-2.1.2/lib/libmtd.c:62: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(n + len1, name, len2 + 1);
data/mtd-utils-2.1.2/lib/libmtd.c:80:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file, O_RDONLY | O_CLOEXEC);
data/mtd-utils-2.1.2/lib/libmtd.c:96: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)[rd] = '\0';
data/mtd-utils-2.1.2/lib/libmtd.c:134:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[50];
data/mtd-utils-2.1.2/lib/libmtd.c:166: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 file[strlen(lib->mtd_dev) + 50];
data/mtd-utils-2.1.2/lib/libmtd.c:184: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 file[strlen(patt) + 100];
data/mtd-utils-2.1.2/lib/libmtd.c:202: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[50];
data/mtd-utils-2.1.2/lib/libmtd.c:204:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file, O_RDONLY | O_CLOEXEC);
data/mtd-utils-2.1.2/lib/libmtd.c:255: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[50];
data/mtd-utils-2.1.2/lib/libmtd.c:258:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file, O_RDONLY | O_CLOEXEC);
data/mtd-utils-2.1.2/lib/libmtd.c:360: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 file[strlen(patt) + 50];
data/mtd-utils-2.1.2/lib/libmtd.c:376: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 file[strlen(patt) + 50];
data/mtd-utils-2.1.2/lib/libmtd.c:392: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 file[strlen(patt) + 50];
data/mtd-utils-2.1.2/lib/libmtd.c:498: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 file[strlen(lib->mtd_name) + 10];
data/mtd-utils-2.1.2/lib/libmtd.c:515: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 tmp_buf[256];
data/mtd-utils-2.1.2/lib/libmtd.c:546:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file, O_RDONLY | O_CLOEXEC);
data/mtd-utils-2.1.2/lib/libmtd.c:666: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 file[strlen(lib->mtd) + 10];
data/mtd-utils-2.1.2/lib/libmtd.c:697: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 tmp_buf[256];
data/mtd-utils-2.1.2/lib/libmtd.c:1123: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(tmp_buf, oob, ooblen);
data/mtd-utils-2.1.2/lib/libmtd.c:1135: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(oob + start, tmp_buf + tags_pos, len);
data/mtd-utils-2.1.2/lib/libmtd.c:1142: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(oob + start, tmp_buf + start, len);
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:63: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[MTD_NAME_MAX + 1];
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:74: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(MTD_PROC_FILE, O_RDONLY);
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:139: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(pi->name, p, len);
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:224: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(node, O_RDONLY);
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:257: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 node[sizeof(MTD_DEV_PATT) + 20];
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:279: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(node, O_RDONLY);
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:359:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcpy((char *)mtd->type_str, "ram");
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:362:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcpy((char *)mtd->type_str, "rom");
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:365:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcpy((char *)mtd->type_str, "nor");
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:368:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcpy((char *)mtd->type_str, "nand");
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:371:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcpy((char *)mtd->type_str, "mlc-nand");
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:374:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcpy((char *)mtd->type_str, "dataflash");
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:377:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcpy((char *)mtd->type_str, "ubi");
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:426: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 node[sizeof(MTD_DEV_PATT) + 20];
data/mtd-utils-2.1.2/lib/libubi.c:59: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(n, path, len1);
data/mtd-utils-2.1.2/lib/libubi.c:63: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(n + len1, name, len2 + 1);
data/mtd-utils-2.1.2/lib/libubi.c:79:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[50];
data/mtd-utils-2.1.2/lib/libubi.c:81:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file, O_RDONLY);
data/mtd-utils-2.1.2/lib/libubi.c:162:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file, O_RDONLY);
data/mtd-utils-2.1.2/lib/libubi.c:178: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)[rd] = '\0';
data/mtd-utils-2.1.2/lib/libubi.c:214: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[50];
data/mtd-utils-2.1.2/lib/libubi.c:245: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 file[strlen(patt) + 50];
data/mtd-utils-2.1.2/lib/libubi.c:262: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 file[strlen(patt) + 100];
data/mtd-utils-2.1.2/lib/libubi.c:278: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 file[strlen(patt) + 50];
data/mtd-utils-2.1.2/lib/libubi.c:296: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 file[strlen(patt) + 100];
data/mtd-utils-2.1.2/lib/libubi.c:316: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 file[strlen(patt) + 100];
data/mtd-utils-2.1.2/lib/libubi.c:333: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 file[strlen(lib->dev_dev) + 50];
data/mtd-utils-2.1.2/lib/libubi.c:352: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 file[strlen(lib->vol_dev) + 100];
data/mtd-utils-2.1.2/lib/libubi.c:374: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 file[strlen(lib->ubi_vol) + 100];
data/mtd-utils-2.1.2/lib/libubi.c:417:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file, O_RDONLY);
data/mtd-utils-2.1.2/lib/libubi.c:542: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(lib->sysfs_ubi, O_RDONLY);
data/mtd-utils-2.1.2/lib/libubi.c:696: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(node, O_RDONLY);
data/mtd-utils-2.1.2/lib/libubi.c:842: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(node, O_RDONLY);
data/mtd-utils-2.1.2/lib/libubi.c:860: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 file[strlen(lib->ubi_vol) + 100];
data/mtd-utils-2.1.2/lib/libubi.c:901:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file, O_RDONLY);
data/mtd-utils-2.1.2/lib/libubi.c:946: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 tmp_buf[256];
data/mtd-utils-2.1.2/lib/libubi.c:1015: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(node, O_RDONLY);
data/mtd-utils-2.1.2/lib/libubi.c:1036: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(node, O_RDONLY);
data/mtd-utils-2.1.2/lib/libubi.c:1056: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(node, O_RDONLY);
data/mtd-utils-2.1.2/lib/libubi.c:1077: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(node, O_RDONLY);
data/mtd-utils-2.1.2/lib/libubi.c:1126: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 file[strlen(lib->ubi_dev) + 50];
data/mtd-utils-2.1.2/lib/libubi.c:1152: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 tmp_buf[256];
data/mtd-utils-2.1.2/lib/libubi.c:1241: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[50];
data/mtd-utils-2.1.2/lib/libubigen.c:116: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(vtbl_rec->name, vi->name, vi->name_len);
data/mtd-utils-2.1.2/lib/libubigen.c:227: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(outbuf + ui->data_offs, inbuf, len);
data/mtd-utils-2.1.2/lib/libubigen.c:278: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(outbuf + ui->data_offs, vtbl, ui->vtbl_size);
data/mtd-utils-2.1.2/misc-utils/doc_loadbios.c:15:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (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 databuf[512];
data/mtd-utils-2.1.2/misc-utils/doc_loadbios.c:34:13:  [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 ((ofd = open(argv[1],O_RDWR)) < 0) {
data/mtd-utils-2.1.2/misc-utils/doc_loadbios.c:39:13:  [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 ((ifd = open(argv[2], O_RDONLY)) < 0) {
data/mtd-utils-2.1.2/misc-utils/docfdisk.c:154: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[20];
data/mtd-utils-2.1.2/misc-utils/docfdisk.c:182:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(argv[1], O_RDWR)) < 0) {
data/mtd-utils-2.1.2/misc-utils/docfdisk.c:272: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((void *) mh2, (void *) mh, sizeof(struct INFTLMediaHeader));
data/mtd-utils-2.1.2/misc-utils/fectest.c:21: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[NR_PKTS * PKT_SIZE];
data/mtd-utils-2.1.2/misc-utils/fectest.c:22: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 pktbuf[(NR_PKTS + DROPS) * PKT_SIZE];
data/mtd-utils-2.1.2/misc-utils/fectest.c:24: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 *srcs[NR_PKTS];
data/mtd-utils-2.1.2/misc-utils/fectest.c:25: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 *pkt[NR_PKTS + DROPS];
data/mtd-utils-2.1.2/misc-utils/fectest.c:67: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(pktbuf + (i*PKT_SIZE), pkt[i], PKT_SIZE);
data/mtd-utils-2.1.2/misc-utils/fectest.c:79: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("before", O_WRONLY|O_TRUNC|O_CREAT, 0644);
data/mtd-utils-2.1.2/misc-utils/fectest.c:83: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("after", O_WRONLY|O_TRUNC|O_CREAT, 0644);
data/mtd-utils-2.1.2/misc-utils/flash_erase.c:177:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(mtd_device, O_RDWR)) < 0)
data/mtd-utils-2.1.2/misc-utils/flash_otp_dump.c:21: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[16];
data/mtd-utils-2.1.2/misc-utils/flash_otp_dump.c:28: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(argv[2], O_RDONLY);
data/mtd-utils-2.1.2/misc-utils/flash_otp_info.c:25: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(argv[2], O_RDONLY);
data/mtd-utils-2.1.2/misc-utils/flash_otp_lock.c:30: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(argv[2], O_WRONLY);
data/mtd-utils-2.1.2/misc-utils/flash_otp_write.c:41:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char *p, buf[2048];
data/mtd-utils-2.1.2/misc-utils/flash_otp_write.c:50: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(argv[2], O_WRONLY);
data/mtd-utils-2.1.2/misc-utils/flash_unlock.c:155:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(dev, O_RDWR);
data/mtd-utils-2.1.2/misc-utils/flashcp.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 (pathname,flags);
data/mtd-utils-2.1.2/misc-utils/flashcp.c:176: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 src[BUFSIZE],dest[BUFSIZE];
data/mtd-utils-2.1.2/misc-utils/ftl_check.c:209: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(argv[optind], O_RDONLY);
data/mtd-utils-2.1.2/misc-utils/ftl_format.c:86: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(hdr->LinkTargetTuple, LinkTarget, 5);
data/mtd-utils-2.1.2/misc-utils/ftl_format.c:87: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(hdr->DataOrgTuple, DataOrg, 10);
data/mtd-utils-2.1.2/misc-utils/ftl_format.c:315: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(argv[optind], O_RDWR);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:310: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(buffer, "%lld", size);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:326:6:  [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.
	i = sprintf(buffer, "%lld", size);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:448: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[128];
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:454:4:  [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(buffer, "mtd%d", info->mtd_num);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:472:4:  [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(buffer, "%d", info->eb_cnt);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:490:4:  [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(buffer, "%d", info->region_cnt);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:508: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 value[128];
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:517:5:  [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(value, "ubi%d", info->dev_num);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:530:4:  [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(value, "%d", info->total_lebs);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:536:4:  [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(value, "%lld", info->max_ec);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:542:4:  [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(value, "%d", info->avail_lebs);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:545:4:  [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(value, "%d", info->bad_count);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:548:4:  [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(value, "%d", info->bad_rsvd);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:570: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[128];
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:582:5:  [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(buffer, "ubi%d_%d", info->dev_num,
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:606:4:  [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(buffer, "%d", info->rsvd_lebs);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:617:4:  [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(buffer, "%d", info->rsvd_lebs - used);
data/mtd-utils-2.1.2/misc-utils/lsmtd_scan.c:205: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(&(mtd_dev[idx++].info), &dev_info, sizeof(dev_info));
data/mtd-utils-2.1.2/misc-utils/mcast_image.h:21: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 data[PKT_SIZE];
data/mtd-utils-2.1.2/misc-utils/mtd_debug.c:184:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fp = fopen(filename, "r")) == NULL) {
data/mtd-utils-2.1.2/misc-utils/mtd_debug.c:373:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(argv[2], O_SYNC | open_flag)) < 0)
data/mtd-utils-2.1.2/misc-utils/mtdpart.c:163: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(mtddev, O_RDWR | O_CLOEXEC);
data/mtd-utils-2.1.2/misc-utils/recv_image.c:30: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 wbuf[WBUF_SIZE];
data/mtd-utils-2.1.2/misc-utils/recv_image.c:72: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).
	flfd = open(argv[3], O_RDWR);
data/mtd-utils-2.1.2/misc-utils/recv_image.c:86: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).
		flfd = open(argv[3], O_CREAT|O_TRUNC|O_RDWR, 0644);
data/mtd-utils-2.1.2/misc-utils/recv_image.c:281: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(eraseblocks[block_nr].wbuf + eraseblocks[block_nr].wbuf_ofs,
data/mtd-utils-2.1.2/misc-utils/recv_image.c:289: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(eraseblocks[block_nr].wbuf + eraseblocks[block_nr].wbuf_ofs,
data/mtd-utils-2.1.2/misc-utils/recv_image.c:342: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(eraseblocks[block_nr].wbuf, &thispkt.data[fits], PKT_SIZE - fits);
data/mtd-utils-2.1.2/misc-utils/recv_image.c:376: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(eb_buf + meminfo.erasesize, eraseblocks[block_nr].wbuf,
data/mtd-utils-2.1.2/misc-utils/recv_image.c:393: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(&decode_buf[i*PKT_SIZE], src_pkts[i], PKT_SIZE);
data/mtd-utils-2.1.2/misc-utils/serve_image.c:57:13:  [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).
		tx_rate = atol(argv[5]) * 1024;
data/mtd-utils-2.1.2/misc-utils/serve_image.c:73:14:  [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).
	erasesize = atol(argv[4]);
data/mtd-utils-2.1.2/misc-utils/serve_image.c:120: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).
	rfd = open(argv[3], O_RDONLY);
data/mtd-utils-2.1.2/misc-utils/serve_image.c:150: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(last_block, image + (nr_blocks - 1) * erasesize, erasesize);
data/mtd-utils-2.1.2/nand-utils/nanddump.c:266:9:  [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.
		lx += sprintf(linebuf, "0x%.8llx: ", prefix);
data/mtd-utils-2.1.2/nand-utils/nanddump.c:268:9:  [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.
		lx += sprintf(linebuf, "  OOB Data: ");
data/mtd-utils-2.1.2/nand-utils/nanddump.c:339: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 pretty_buf[PRETTY_BUF_LEN];
data/mtd-utils-2.1.2/nand-utils/nanddump.c:355:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(mtddev, O_RDONLY)) == -1) {
data/mtd-utils-2.1.2/nand-utils/nanddump.c:391:20:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	} else if ((ofd = open(dumpfile, O_WRONLY | O_TRUNC | O_CREAT, 0644))== -1) {
data/mtd-utils-2.1.2/nand-utils/nandtest.c:203:11:  [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).
			seed = atol(optarg);
data/mtd-utils-2.1.2/nand-utils/nandtest.c:207:16:  [2] (integer) atol:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
			nr_passes = atol(optarg);
data/mtd-utils-2.1.2/nand-utils/nandtest.c:211:15:  [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).
			nr_reads = atol(optarg);
data/mtd-utils-2.1.2/nand-utils/nandtest.c:229: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(argv[optind], O_RDWR);
data/mtd-utils-2.1.2/nand-utils/nandwrite.c:180: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).
			blockalign = atoi(optarg);
data/mtd-utils-2.1.2/nand-utils/nandwrite.c:287:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(mtd_device, O_RDWR)) == -1)
data/mtd-utils-2.1.2/nand-utils/nandwrite.c:334: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).
		ifd = open(img, O_RDONLY);
data/mtd-utils-2.1.2/nand-utils/nftl_format.c:46:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (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 BadUnitTable[MAX_ERASE_ZONES];
data/mtd-utils-2.1.2/nand-utils/nftl_format.c:48:10:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (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 *writebuf[4];
data/mtd-utils-2.1.2/nand-utils/nftl_format.c:67: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 oobbuf[16];
data/mtd-utils-2.1.2/nand-utils/nftl_format.c:180: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 bbt[512];
data/mtd-utils-2.1.2/nand-utils/nftl_format.c:229: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 oobbuf[16];
data/mtd-utils-2.1.2/nand-utils/nftl_format.c:270:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(mtddevice, O_RDWR)) < 0) {
data/mtd-utils-2.1.2/nand-utils/nftl_format.c:356:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcpy(INFTLhdr->bootRecordID, "BNAND");
data/mtd-utils-2.1.2/nand-utils/nftl_format.c:393:3:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
		strcpy(NFTLhdr->DataOrgID, "ANAND");
data/mtd-utils-2.1.2/nand-utils/nftldump.c:53: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 BadUnitTable[MAX_ERASE_ZONES];
data/mtd-utils-2.1.2/nand-utils/nftldump.c:135: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(&UCItable[i][j], &oobbuf.u, 8);
data/mtd-utils-2.1.2/nand-utils/nftldump.c:186: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 readbuf[512];
data/mtd-utils-2.1.2/nand-utils/nftldump.c:254: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(argv[1], O_RDONLY);
data/mtd-utils-2.1.2/nand-utils/nftldump.c:261: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).
		ofd = open(argv[2], O_WRONLY | O_TRUNC | O_CREAT, 0644);
data/mtd-utils-2.1.2/nor-utils/rfddump.c:113:23:  [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).
				rfd->block_size = atoi(optarg);
data/mtd-utils-2.1.2/nor-utils/rfddump.c:190: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(rfd.mtd_filename, O_RDONLY);
data/mtd-utils-2.1.2/nor-utils/rfddump.c:291:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	out_fd = open(rfd.out_filename, O_WRONLY | O_TRUNC | O_CREAT, 0666);
data/mtd-utils-2.1.2/nor-utils/rfdformat.c:94:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[512];
data/mtd-utils-2.1.2/nor-utils/rfdformat.c:99: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(mtd_filename, O_RDWR);
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:107: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 SerialDevice[255] = "/dev/ttyS0"; /* default, can be changed
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:168: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(dev,O_RDWR | O_NDELAY );
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:228:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fp =   fopen(filename,"rb");
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:230:17:  [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).
        logfp = fopen("logfile","a"); /*open for appending only.*/
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:239:17:  [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).
        logfp = fopen("logfile","a"); /*open for appending only.*/
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:254:17:  [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).
        logfp = fopen("logfile","a"); /*open for appending only.*/
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:281:21:  [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).
            logfp = fopen("logfile","a"); /*open for appending only.*/
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:315:17:  [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).
    cyclefp =   fopen("cycleCnt","rb");
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:329:16:  [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).
    cyclefp  = fopen("cycleCnt","wb");
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:417:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if((dfd = open(filename, O_RDWR | O_CREAT | O_SYNC, S_IRWXU)) <= 0)
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:521: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).
                FileSizeMax = (float)atoi(argv[++cnt]);
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:545:45:  [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).
                            MaxErrAllowed = atoi(argv[++cnt]);
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:567: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 filename[30];
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:589:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    logfp = fopen("logfile","a"); /*open for appending only.*/
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:611:9:  [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(filename,"file%i",filenameCounter++);
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:617:21:  [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).
            logfp = fopen("logfile","a"); /*open for appending only.*/
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:630:25:  [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).
                logfp = fopen("logfile","a"); /*open for appending only.*/
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:651:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    logfp = fopen("logfile","a"); /*open for appending only.*/
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:682:13:  [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(filename,"file%i",filenameCounter);
data/mtd-utils-2.1.2/tests/checkfs/comm.c:40: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 buf[200];
data/mtd-utils-2.1.2/tests/checkfs/comm.c:42:5:  [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(buf, "ok to power me down!\nCount = %i\n", cycleCnt);
data/mtd-utils-2.1.2/tests/checkfs/makefiles.c:90:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  fp =   fopen(filename,"rb");
data/mtd-utils-2.1.2/tests/checkfs/makefiles.c:138:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  fp =   fopen(filename,"rb");
data/mtd-utils-2.1.2/tests/checkfs/makefiles.c:169:10:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  fp =   fopen(filename,"ab"); /*open in append mode. CRC goes at the end.*/
data/mtd-utils-2.1.2/tests/checkfs/makefiles.c:195:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char filename[30];
data/mtd-utils-2.1.2/tests/checkfs/makefiles.c:204:5:  [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(filename,"file%i",filenameCounter++);
data/mtd-utils-2.1.2/tests/checkfs/makefiles.c:205:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    fp =   fopen(filename,"wb");
data/mtd-utils-2.1.2/tests/checkfs/makefiles.c:246:15:  [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).
  cyclefp =   fopen("cycleCnt","wb");
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:639:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(path, O_CREAT | O_EXCL | O_RDWR, mode);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:866:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(path, flags);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:894: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[IO_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1178:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(path, O_RDWR);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1322:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(path, O_RDWR);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1359:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(path, O_WRONLY);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1433: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[IO_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1434: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[FILENAME_MAX];
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1440:2:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
	strcpy(name, "/tmp/");
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1446: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).
	w_fd = open(name, O_CREAT | O_WRONLY, 0777);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1462:2:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
	strcpy(name, "/tmp/");
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1468: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).
	w_fd = open(name, O_CREAT | O_WRONLY, 0777);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1481: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[IO_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1510: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 read_buf[IO_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1511: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 check_buf[IO_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1582:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		fd = open(path, O_RDONLY);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1645: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, buf[8192], *target;
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1828:4:  [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(random_name_buf, "%u", random_no(1000000));
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2068:3:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
		strcat(rel, "..");
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2070:4:  [2] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant string.
			strcat(rel, "/..");
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2112:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[PATH_MAX + 1];
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2270:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(path, O_RDONLY);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2512:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[PATH_MAX];
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2713: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[IO_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2716: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(name, O_RDONLY);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2736:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[PATH_MAX];
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2766: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 b[IO_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2898: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(p, opt, len);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2921:6:  [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).
	f = fopen(mp, "rb");
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2924:7:  [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).
		f = fopen(mp, "rb");
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2987:8:  [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.
	CHECK(sprintf(p, "integck_test_dir_%u", pid) > 0);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:121: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[1024];
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:410: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 write_buffer[WRITE_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:510: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[WRITE_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:527:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file_name, O_RDONLY);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:544: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(dir,O_RDONLY | tests_maybe_sync_flag());
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:568:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file_name, flags, mode);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:599: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 file_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:601: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(file_name, "fragment_%u", file_number);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:604:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file_name, flags, mode);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:625: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[WRITE_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:683: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 file_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:685: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(file_name, "fragment_%u", file_number);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:691:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file_name, flags, mode);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:713: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 file_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:715: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(file_name, "fragment_%u", file_number);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:716:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file_name, O_RDWR | tests_maybe_sync_flag());
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:731: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 file_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:733: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(file_name, "fragment_%u", file_number);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:743: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[8192];
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:768: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 file_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:769: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[8192];
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:771: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(file_name, "fragment_%u", file_number);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:772:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file_name, O_RDONLY);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:844: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/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:875: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[256];
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:878: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(name, "%u", (unsigned) tests_random_no(10000000));
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:879: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(name, O_RDONLY);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:958:6:  [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).
	f = fopen("/proc/mounts", "rb");
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:960:7:  [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).
		f = fopen("/etc/mtab", "rb");
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:1035: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(p, opt, len);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:1062: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[4096], *data;
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:1160: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 cwd[4096];
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:1213: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/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:1266: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 pid_buf[PID_BUF_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/simple/ftrunc.c:44: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[WRITE_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/simple/ftrunc.c:47:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file_name, O_CREAT | O_WRONLY,
data/mtd-utils-2.1.2/tests/fs-tests/simple/orph.c:42: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 dir_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/simple/perf.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 file_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/simple/perf.c:91:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file_name, O_CREAT | O_RDWR | O_TRUNC,
data/mtd-utils-2.1.2/tests/fs-tests/simple/perf.c:126:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file_name, O_RDONLY);
data/mtd-utils-2.1.2/tests/fs-tests/simple/test_1.c:38: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[256];
data/mtd-utils-2.1.2/tests/fs-tests/simple/test_1.c:39: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 old[16];
data/mtd-utils-2.1.2/tests/fs-tests/simple/test_1.c:40:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[16];
data/mtd-utils-2.1.2/tests/fs-tests/simple/test_1.c:42: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 dir_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/simple/test_1.c:53: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("big_file", O_RDWR | tests_maybe_sync_flag());
data/mtd-utils-2.1.2/tests/fs-tests/simple/test_1.c:67:4:  [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(name, "fill_up_%llu", (unsigned long long)i);
data/mtd-utils-2.1.2/tests/fs-tests/simple/test_1.c:88: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(name, "fill_up_%llu", (unsigned long long)i);
data/mtd-utils-2.1.2/tests/fs-tests/simple/test_2.c:41: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 dir_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/simple/test_2.c:85: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("big_file",O_RDWR | tests_maybe_sync_flag());
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/fwrite00.c:45: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 file_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/fwrite00.c:46:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[WRITE_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/fwrite00.c:57: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(file_name, O_CREAT | O_WRONLY,
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/gcd_hupper.c:53: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 file_name[MAX_NAME_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/gcd_hupper.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 program_name[MAX_NAME_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/gcd_hupper.c:56:8:  [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).
	pid = atoi(number);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/gcd_hupper.c:60:6:  [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).
	f = fopen(file_name, "r");
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/gcd_hupper.c:81: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).
		g->mtd_index = atoi(program_name + 14);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/gcd_hupper.c:130: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).
	index = atoi(p);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/gcd_hupper.c:147:6:  [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).
	f = fopen("/proc/mounts", "rb");
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/gcd_hupper.c:149:7:  [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).
		f = fopen("/etc/mtab", "rb");
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/pdfrun.c:37: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 dummy[1024];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/pdfrun.c:42:6:  [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).
	f = fopen("/proc/meminfo", "r");
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/pdfrun.c:60: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 file_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/pdfrun.c:61:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[WRITE_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/pdfrun.c:68:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file_name, O_CREAT | O_WRONLY,
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rmdir00.c:38: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 dir_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndrm00.c:38: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 dir_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndrm99.c:84: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 write_buffer[WRITE_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndrm99.c:155:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file_name, flags, mode);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndrm99.c:182:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char name[256];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndrm99.c:186: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(name, "%u", (unsigned) tests_random_no(10000000));
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndrm99.c:188: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(name, O_RDONLY);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndrm99.c:299: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 dir_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndwrite00.c:40:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndwrite00.c:68: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 file_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndwrite00.c:69:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[4096];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndwrite00.c:74:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file_name, O_CREAT | O_RDWR | O_TRUNC,
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndwrite00.c:123: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(data + offset, buf, written);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/stress_1.c:42: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 file_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/stress_1.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[WRITE_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/stress_1.c:47:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file_name, O_CREAT | O_WRONLY,
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/stress_2.c:44: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[WRITE_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/stress_2.c:47:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file_name, O_CREAT | O_WRONLY,
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/stress_3.c:42: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 file_name[256];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/stress_3.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[WRITE_BUFFER_SIZE];
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/stress_3.c:47:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(file_name, O_CREAT | O_WRONLY,
data/mtd-utils-2.1.2/tests/fs-tests/utils/fstest_monitor.c:107: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 *argv[1024];
data/mtd-utils-2.1.2/tests/fs-tests/utils/fstest_monitor.c:173: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(tmp, argv, sz);
data/mtd-utils-2.1.2/tests/fs-tests/utils/fstest_monitor.c:232: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).
			duration = atoi(s);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:169: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 OutFileName[MAX_FILE_NAME_LEN+1];  /* output file name            */
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:170: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 LogFile[MAX_FILE_NAME_LEN+1] = "/dev/console"; /* default */
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:171: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 ReadFile[MAX_FILE_NAME_LEN+1]; /* This file is read. Should
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:238: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 tmpBuf[200];
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:241:5:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
    strcpy(OutFileName,"jitter.dat");
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:294:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if((Fd1 = open(OutFileName, O_RDWR|O_CREAT|O_SYNC, S_IRWXU)) <= 0)
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:306:19:  [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((Fd2 = open(ReadFile, O_RDWR|O_CREAT|O_SYNC|O_TRUNC, S_IRWXU)) <= 0)
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:328:17:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if((Cfd   = open(LogFile, O_WRONLY|O_SYNC)) <= 0)
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:338:9:  [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(tmpBuf,
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:349:9:  [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(tmpBuf,
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:360:5:  [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(tmpBuf, "\nScheduler priority: %d\n",
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:368:5:  [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(tmpBuf, "Interrupt period:   %ld milliseconds\n",
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:387:9:  [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(tmpBuf, "Exiting - ");
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:390:9:  [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(tmpBuf,
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:426:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char tmpBuf[200];
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:434:5:  [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(tmpBuf,
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:461: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 readBuf[4096];
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:465:22:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if((fdSnapshot = open(fileName, O_WRONLY | O_CREAT, S_IRWXU)) < 0)
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:472:21:  [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((fdProfile = open("/proc/profile", O_RDWR)) < 0)
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:509: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 readBuf[10];
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:512:19:  [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((fdProfile = open("/proc/profile", O_RDWR)) < 0)
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:548: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 tmpBuf[MAX_WRITE_BYTES];
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:553: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 profileFileName[150];
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:574:9:  [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(tmpBuf," %f ms  ", (float)timeDiffusec/1000.0);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:580:9:  [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(&tmpBuf[strlen(tmpBuf)]," %f ms", (float)timeDiffusec/1000.0);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:601:5:  [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(profileFileName, "JitterTest.profilesnap-%i", profileFileNo);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:625:9:  [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(&tmpBuf[strlen(tmpBuf)-1]," PadBytes:");
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:679:9:  [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(tmpBuf, "gettimeofday error \n");
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:844:30:  [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).
                WriteBytes = atoi(argv[argNum]);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:875:46:  [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).
                ProfileTriggerMSecs = (long) atoi(argv[argNum]);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:892:29:  [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).
                GCTaskPID = atoi(argv[argNum]);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:951:14:  [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).
    period = atol(pASCIIInterruptPeriodMilliSec);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:974: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).
    priority = atoi(pASCIISchedulerPriority);
data/mtd-utils-2.1.2/tests/jittertest/plotJittervsFill.c:68: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 LogFile[250] = "InputLogFile.log";
data/mtd-utils-2.1.2/tests/jittertest/plotJittervsFill.c:138: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).
                JitterThreshold_ms = atoi(argv[argNum]);
data/mtd-utils-2.1.2/tests/jittertest/plotJittervsFill.c:176: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 lineBuf[1024]; /* how long a single line be? */
data/mtd-utils-2.1.2/tests/jittertest/plotJittervsFill.c:200: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 junkStr1[500], junkStr2[500];
data/mtd-utils-2.1.2/tests/jittertest/plotJittervsFill.c:204:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if((fp = fopen(LogFile, "r")) == NULL)
data/mtd-utils-2.1.2/tests/mtd-tests/flash_readtest.c:182:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char line[128];
data/mtd-utils-2.1.2/tests/mtd-tests/flash_readtest.c:191:8:  [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.
		p += sprintf(p, "%05x: ", i);
data/mtd-utils-2.1.2/tests/mtd-tests/flash_readtest.c:193:9:  [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.
			p += sprintf(p, "%02x", (unsigned int)iobuf[i]);
data/mtd-utils-2.1.2/tests/mtd-tests/flash_readtest.c:204:9:  [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.
			p += sprintf(p, "%05x: ", i);
data/mtd-utils-2.1.2/tests/mtd-tests/flash_readtest.c:206:10:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
				p += sprintf(p, "%02x", (unsigned int)iobuf1[i]);
data/mtd-utils-2.1.2/tests/mtd-tests/flash_readtest.c:249:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(mtddev, O_RDWR)) == -1) {
data/mtd-utils-2.1.2/tests/mtd-tests/flash_speed.c:365:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(mtddev, O_RDWR)) == -1) {
data/mtd-utils-2.1.2/tests/mtd-tests/flash_stress.c:261:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(mtddev, O_RDWR)) == -1) {
data/mtd-utils-2.1.2/tests/mtd-tests/flash_torture.c:198:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((mtdfd = open(mtddev, O_RDWR)) == -1) {
data/mtd-utils-2.1.2/tests/mtd-tests/nandbiterrs.c:469:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(mtddev, O_RDWR)) == -1) {
data/mtd-utils-2.1.2/tests/mtd-tests/nandpagetest.c:251: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(boundary, writebuf + mtd.eb_size - pgsize, pgsize);
data/mtd-utils-2.1.2/tests/mtd-tests/nandpagetest.c:340:2:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
	strcpy((char*)writebuf, "There is no data like this!");
data/mtd-utils-2.1.2/tests/mtd-tests/nandpagetest.c:365:2:  [2] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant string.
	strcpy((char*)writebuf, "There is no data like this!");
data/mtd-utils-2.1.2/tests/mtd-tests/nandpagetest.c:470:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(mtddev, O_RDWR)) == -1) {
data/mtd-utils-2.1.2/tests/mtd-tests/nandsubpagetest.c:354:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if ((fd = open(mtddev, O_RDWR)) == -1) {
data/mtd-utils-2.1.2/tests/ubi-tests/helpers.c:224: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[512];
data/mtd-utils-2.1.2/tests/ubi-tests/helpers.c:226: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(node, O_RDONLY);
data/mtd-utils-2.1.2/tests/ubi-tests/helpers.c:295: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[512];
data/mtd-utils-2.1.2/tests/ubi-tests/helpers.c:297: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(node, O_RDWR);
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:150: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(vol->device_file_name, O_RDWR | O_LARGEFILE);
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:462:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		char dev_name[1024];
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:495: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(s->device_file_name, O_RDONLY);
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:535: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 dev_name[1024];
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:550: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(dev_name, "/dev/ubi%d", i);
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:603: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(vol->device_file_name, O_RDWR | O_LARGEFILE);
data/mtd-utils-2.1.2/tests/ubi-tests/io_basic.c:51: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 vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/io_basic.c:101: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 vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/io_paral.c:48: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 vol_name[THREADS_NUM + 1][100];
data/mtd-utils-2.1.2/tests/ubi-tests/io_paral.c:49: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 vol_nodes[THREADS_NUM + 1][sizeof(UBI_VOLUME_PATTERN) + 99];
data/mtd-utils-2.1.2/tests/ubi-tests/io_paral.c:50: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 *wbufs[THREADS_NUM + 1];
data/mtd-utils-2.1.2/tests/ubi-tests/io_paral.c:51: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 *rbufs[THREADS_NUM + 1];
data/mtd-utils-2.1.2/tests/ubi-tests/io_paral.c:61: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(vol_node, O_RDWR);
data/mtd-utils-2.1.2/tests/ubi-tests/io_paral.c:100: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(vol_node, O_RDONLY);
data/mtd-utils-2.1.2/tests/ubi-tests/io_paral.c:179: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(vol_node, O_RDWR);
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:67: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 vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:70: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[20];
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:86: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(vol_node, O_RDWR);
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:250: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 vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:256: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(vol_node, O_RDWR);
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:272: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 buf[512];
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:293: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(vol_node, O_RDONLY);
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.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 vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/io_update.c:78: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 vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/io_update.c:99: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(vol_node, O_RDWR);
data/mtd-utils-2.1.2/tests/ubi-tests/io_update.c:227: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 vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/mkvol_bad.c:129:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		char name[UBI_VOL_NAME_MAX + 5];
data/mtd-utils-2.1.2/tests/ubi-tests/mkvol_bad.c:188: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 nm[strlen(name) + 50];
data/mtd-utils-2.1.2/tests/ubi-tests/mkvol_basic.c:169: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 nm[strlen(name) + 50];
data/mtd-utils-2.1.2/tests/ubi-tests/mkvol_paral.c:50: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 nm[strlen(name) + 50];
data/mtd-utils-2.1.2/tests/ubi-tests/rsvol.c:110: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 vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/rsvol.c:150: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(vol_node, O_RDWR);
data/mtd-utils-2.1.2/tests/ubi-tests/rsvol.c:185: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(vol_node, O_RDWR);
data/mtd-utils-2.1.2/tests/ubi-tests/rsvol.c:230: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 vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/volrefcnt.c:41: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 fname[sizeof(SYSFS_FILE) + 20];
data/mtd-utils-2.1.2/tests/ubi-tests/volrefcnt.c:46:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char tmp[100];
data/mtd-utils-2.1.2/tests/ubi-tests/volrefcnt.c:79: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(fname, O_RDONLY);
data/mtd-utils-2.1.2/tests/ubi-tests/volrefcnt.c:103: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(fname, O_RDONLY);
data/mtd-utils-2.1.2/tests/unittests/libmtd_test.c:249: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[28];
data/mtd-utils-2.1.2/tests/unittests/libmtd_test.c:272: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[64];
data/mtd-utils-2.1.2/tests/unittests/libmtd_test.c:300:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[64], oob_data[64];
data/mtd-utils-2.1.2/tests/unittests/libmtd_test.c:334: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[64];
data/mtd-utils-2.1.2/tests/unittests/libmtd_test.c:374: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[64];
data/mtd-utils-2.1.2/ubi-utils/mtdinfo.c:258: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(args.node, O_RDONLY | O_CLOEXEC);
data/mtd-utils-2.1.2/ubi-utils/ubiblock.c:137: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(args.node, O_RDWR);
data/mtd-utils-2.1.2/ubi-utils/ubicrc32.c:91: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[BUFSIZE];
data/mtd-utils-2.1.2/ubi-utils/ubicrc32.c:99:8:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		fp = fopen(argv[optind], "r");
data/mtd-utils-2.1.2/ubi-utils/ubiformat.c:325: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(args.image, O_RDONLY);
data/mtd-utils-2.1.2/ubi-utils/ubiformat.c:439:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		char buf[mtd->eb_size];
data/mtd-utils-2.1.2/ubi-utils/ubiformat.c:751:17:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	args.node_fd = open(args.node, O_RDWR);
data/mtd-utils-2.1.2/ubi-utils/ubihealthd.c:236: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).
			interval_secs = atoi(optarg);
data/mtd-utils-2.1.2/ubi-utils/ubihealthd.c:255:11:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	ubi_fd = open(ubi_device, O_RDONLY);
data/mtd-utils-2.1.2/ubi-utils/ubinize.c:125:18:  [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).
			args.out_fd = open(optarg, O_CREAT | O_TRUNC | O_WRONLY,
data/mtd-utils-2.1.2/ubi-utils/ubinize.c:247:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char buf[256];
data/mtd-utils-2.1.2/ubi-utils/ubinize.c:563: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(img, O_RDONLY);
data/mtd-utils-2.1.2/ubi-utils/ubiupdatevol.c:47:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char dev_name[256];
data/mtd-utils-2.1.2/ubi-utils/ubiupdatevol.c:162: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(args.node, O_RDWR);
data/mtd-utils-2.1.2/ubi-utils/ubiupdatevol.c:230: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(args.node, O_RDWR);
data/mtd-utils-2.1.2/ubi-utils/ubiupdatevol.c:243: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).
		ifd = open(args.img, O_RDONLY);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/compr.c:136: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(out_buf, in_buf, in_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/compr.c:186: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(out_buf, zlib_buf, zlib_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/crypto.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(temp, p0, size);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/crypto.c:209: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(p0, p1, size);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/crypto.c:210: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(p1, temp, size);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/crypto.c:232: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(padded, plaintext, size);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/crypto.c:309: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(descriptor, hash2, FS_KEY_DESCRIPTOR_SIZE);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/devtable.c:115: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(*path, buf, path_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/devtable.c:124: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(*name, n, name_len + 1);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/devtable.c:131: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], type, *path = NULL, *name = NULL;
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/devtable.c:337:6:  [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).
	f = fopen(tbl_file, "r");
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/fscrypt.c:55: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_fctx->master_key_descriptor, fctx->master_key_descriptor,
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/fscrypt.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(inbuf, data, data_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/fscrypt.c:139: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(inbuf, &dn->data, length);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/fscrypt.c:159: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(&dn->data, outbuf, pad_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/fscrypt.c:211: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).
	kf = open(key_file, O_RDONLY);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/fscrypt.c:278: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_fctx->nonce, nonce, FS_KEY_DERIVATION_NONCE_SIZE);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/fscrypt.c:279: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_fctx->master_key_descriptor, master_key_descriptor,
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/fscrypt.h:88: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 encrypted_path[1];
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/key.h:88: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(&a, str, len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/key.h:168: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(to, &x, 8);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/key.h:185: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(to, &x, 8);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:591:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
			memcpy(root, optarg, root_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:735: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(context, optarg, context_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1026: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(leb_buf, node, len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1123: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(e->hash, hash, c->hash_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1200: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(leb_buf + offs, node, len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1222: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.name, name, nm.len + 1);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1243: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(xent->name, nm.name, nm.len + 1);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1280: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(&ino->data, data, data_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1361: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 attrbuf[1024] = { };
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1499: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(sd->encrypted_path, outbuf, cryptlen);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1501: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, sd, link_disk_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1502: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 *)dst)[link_disk_len - 1] = '\0';
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1589: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(&ino->data, data, data_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1680: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[UBIFS_MAX_INO_DATA + 2];
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1756: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->name, kname, kname_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1829:7:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	fd = open(path_name, O_RDONLY | O_LARGEFILE);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1923:8:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
		fd = open(path_name, O_RDONLY);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1973: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(&im->st, st, sizeof(struct stat));
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:2158: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(&fake_st, &root_st, sizeof(struct stat));
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:2340: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(leb_buf + offs, node, len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:2417: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(ubifs_branch_hash(br), (*p)->hash, c->hash_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:2499: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(ubifs_branch_hash(br),
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:2508: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(c->root_idx_hash, hashes, c->hash_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:2625: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 s[40];
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:2640: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(sup->hash_mst, c->mst_hash, c->hash_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:2706: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(mst.hash_root_idx, c->root_idx_hash, c->hash_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:2707: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(mst.hash_lpt, c->lpt_hash, c->hash_len);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:2822: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).
		out_fd = open(output, O_RDWR | O_EXCL);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:2835: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).
		out_fd = open(output, O_CREAT | O_RDWR | O_TRUNC,
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/sign.c:61: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 *const hash_algo_name[HASH_ALGO__LAST] = {
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/sign.c:85: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[120];
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/sign.c:202: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[2];
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/sign.c:308: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(sig + 1, obuf, len);
data/mtd-utils-2.1.2/include/common.h:255:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	return read(fd, buf, count);
data/mtd-utils-2.1.2/jffsX-utils/compr.c:392:14:  [1] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source is a constant character.
		act_buf += sprintf(act_buf,"\n");
data/mtd-utils-2.1.2/jffsX-utils/compr.c:435:14:  [1] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source is a constant character.
		act_buf += sprintf(act_buf,"\n");
data/mtd-utils-2.1.2/jffsX-utils/jffs2dump.c:152:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
				strncpy (cnvfile, optarg, sizeof(cnvfile) - 1);
data/mtd-utils-2.1.2/jffsX-utils/jffs2reader.c:297:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(path) == 1 && *path == '/')
data/mtd-utils-2.1.2/jffsX-utils/jffs2reader.c:725:51:  [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).
		dir = resolvename(o, size, ino, path, (uint8_t) strlen(path));
data/mtd-utils-2.1.2/jffsX-utils/jffs2reader.c:895:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(fd, buf, st.st_size) != (ssize_t) st.st_size)
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:187:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			int len = strlen(e->fullname);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:284: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).
		entry->sb.st_size = strlen(entry->link);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:549: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(line);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:558: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(line);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:706:39:  [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).
	rd.totlen = cpu_to_je32(sizeof(rd) + strlen(name));
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:713: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).
	rd.nsize = strlen(name);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:718:47:  [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).
	rd.name_crc = cpu_to_je32(mtd_crc32(0, name, strlen(name)));
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:771:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((len = read(fd, buf, page_size))) {
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:864: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(e->link);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1069: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).
	name_len = strlen(xname);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1119: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).
	name_len = strlen(xname);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1159: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).
		name_len = strlen(xname) + 1;
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1435:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(in_fd, file_buffer, erase_block_size);
data/mtd-utils-2.1.2/jffsX-utils/mkfs.jffs2.c:1727: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).
					  compr_name = xmalloc(strlen(optarg));
data/mtd-utils-2.1.2/jffsX-utils/sumtool.c:270:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(in_fd, file_buffer, erase_block_size);
data/mtd-utils-2.1.2/lib/dictionary.c:72: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).
    t = malloc(strlen(s)+1) ;
data/mtd-utils-2.1.2/lib/dictionary.c:100: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(key);
data/mtd-utils-2.1.2/lib/libiniparser.c:91: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).
	last = l + strlen(l);
data/mtd-utils-2.1.2/lib/libiniparser.c:235: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).
        seclen  = (int)strlen(secname);
data/mtd-utils-2.1.2/lib/libiniparser.c:426: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).
    len = (int)strlen(line);
data/mtd-utils-2.1.2/lib/libiniparser.c:525:20:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        len = (int)strlen(line)-1;
data/mtd-utils-2.1.2/lib/libmtd.c:53: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).
	size_t len1 = strlen(path);
data/mtd-utils-2.1.2/lib/libmtd.c:54: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).
	size_t len2 = strlen(name);
data/mtd-utils-2.1.2/lib/libmtd.c:84:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	rd = read(fd, buf, buf_len);
data/mtd-utils-2.1.2/lib/libmtd.c:99:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	tmp1 = read(fd, &tmp, 1);
data/mtd-utils-2.1.2/lib/libmtd.c:166: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).
	char file[strlen(lib->mtd_dev) + 50];
data/mtd-utils-2.1.2/lib/libmtd.c:184: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).
	char file[strlen(patt) + 100];
data/mtd-utils-2.1.2/lib/libmtd.c:208:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	rd = read(fd, buf, sizeof(buf));
data/mtd-utils-2.1.2/lib/libmtd.c:262:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	rd = read(fd, buf, 50);
data/mtd-utils-2.1.2/lib/libmtd.c:360: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).
	char file[strlen(patt) + 50];
data/mtd-utils-2.1.2/lib/libmtd.c:376: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).
	char file[strlen(patt) + 50];
data/mtd-utils-2.1.2/lib/libmtd.c:392: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).
	char file[strlen(patt) + 50];
data/mtd-utils-2.1.2/lib/libmtd.c:498: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).
	char file[strlen(lib->mtd_name) + 10];
data/mtd-utils-2.1.2/lib/libmtd.c:522: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(dirent->d_name) >= 255) {
data/mtd-utils-2.1.2/lib/libmtd.c:666: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).
		char file[strlen(lib->mtd) + 10];
data/mtd-utils-2.1.2/lib/libmtd.c:704: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(dirent->d_name) >= 255) {
data/mtd-utils-2.1.2/lib/libmtd.c:1102:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = read(fd, buf + rd, len - rd);
data/mtd-utils-2.1.2/lib/libmtd_legacy.c:80:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, pi->buf, PROC_MTD_MAX_LEN);
data/mtd-utils-2.1.2/lib/libubi.c:50: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 len1 = strlen(path);
data/mtd-utils-2.1.2/lib/libubi.c:51: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 len2 = strlen(name);
data/mtd-utils-2.1.2/lib/libubi.c:85:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	rd = read(fd, buf, sizeof(buf));
data/mtd-utils-2.1.2/lib/libubi.c:166:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	rd = read(fd, buf, buf_len);
data/mtd-utils-2.1.2/lib/libubi.c:181:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	tmp1 = read(fd, &tmp, 1);
data/mtd-utils-2.1.2/lib/libubi.c:245: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).
	char file[strlen(patt) + 50];
data/mtd-utils-2.1.2/lib/libubi.c:262: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).
	char file[strlen(patt) + 100];
data/mtd-utils-2.1.2/lib/libubi.c:278: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).
	char file[strlen(patt) + 50];
data/mtd-utils-2.1.2/lib/libubi.c:296: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).
	char file[strlen(patt) + 100];
data/mtd-utils-2.1.2/lib/libubi.c:316: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).
	char file[strlen(patt) + 100];
data/mtd-utils-2.1.2/lib/libubi.c:333: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).
	char file[strlen(lib->dev_dev) + 50];
data/mtd-utils-2.1.2/lib/libubi.c:352: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).
	char file[strlen(lib->vol_dev) + 100];
data/mtd-utils-2.1.2/lib/libubi.c:374: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).
	char file[strlen(lib->ubi_vol) + 100];
data/mtd-utils-2.1.2/lib/libubi.c:860: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).
	char file[strlen(lib->ubi_vol) + 100];
data/mtd-utils-2.1.2/lib/libubi.c:953: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(dirent->d_name) >= 255) {
data/mtd-utils-2.1.2/lib/libubi.c:1007:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	n = strlen(req->name);
data/mtd-utils-2.1.2/lib/libubi.c:1011:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(r.name, req->name, UBI_MAX_VOLUME_NAME);
data/mtd-utils-2.1.2/lib/libubi.c:1126: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).
	char file[strlen(lib->ubi_dev) + 50];
data/mtd-utils-2.1.2/lib/libubi.c:1159: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(dirent->d_name) >= 255) {
data/mtd-utils-2.1.2/lib/libubi.c:1315: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).
	unsigned int nlen = strlen(name);
data/mtd-utils-2.1.2/lib/libubi.c:1337: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).
		if (nlen == strlen(info->name) && !strcmp(name, info->name))
data/mtd-utils-2.1.2/lib/libubigen.c:215:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			rd = read(in, inbuf + len - l, l);
data/mtd-utils-2.1.2/lib/libubigen.c:268: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).
	vi.name_len = strlen(UBI_LAYOUT_VOLUME_NAME);
data/mtd-utils-2.1.2/misc-utils/doc_loadbios.c:87:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (read(ofd, iplbuf, ipltailsize) != ipltailsize) {
data/mtd-utils-2.1.2/misc-utils/doc_loadbios.c:128:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		retlen = read(ifd, databuf, 512);
data/mtd-utils-2.1.2/misc-utils/flash_otp_dump.c:57:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	while ((ret = read(fd, buf, sizeof(buf)))) {
data/mtd-utils-2.1.2/misc-utils/flash_otp_write.c:24:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf + done, count - done);
data/mtd-utils-2.1.2/misc-utils/flashcp.c:134:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	result = read (fd,buf,count);
data/mtd-utils-2.1.2/misc-utils/ftl_check.c:130:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (read(fd, &hdr2, sizeof(hdr2)) == -1) {
data/mtd-utils-2.1.2/misc-utils/ftl_check.c:149:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			if (read(fd, bam, nbam * sizeof(u_int)) == -1) {
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:122: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(cols[i].name);
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:155: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(cols[i].name) == len)
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:225:37:  [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).
			sort_by = column_by_name(optarg, strlen(optarg));
data/mtd-utils-2.1.2/misc-utils/lsmtd.c:647: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).
				selected[i]->width = strlen(selected[i]->name);
data/mtd-utils-2.1.2/misc-utils/mtd_debug.c:138:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		err = read(fd, buf, size);
data/mtd-utils-2.1.2/misc-utils/mtdpart.c:132: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(part_name) >= BLKPG_DEVNAMELTH)
data/mtd-utils-2.1.2/misc-utils/mtdpart.c:177:4:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
			strncpy(part.devname, part_name,
data/mtd-utils-2.1.2/misc-utils/recv_image.c:163:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		len = read(sock, &thispkt, sizeof(thispkt));
data/mtd-utils-2.1.2/nand-utils/nanddump.c:496: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).
				err = ofd_write(ofd, pretty_buf, strlen(pretty_buf));
data/mtd-utils-2.1.2/nand-utils/nanddump.c:530: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).
				err = ofd_write(ofd, pretty_buf, strlen(pretty_buf));
data/mtd-utils-2.1.2/nand-utils/nandwrite.c:477:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
				cnt = read(ifd, writebuf + tinycnt, readlen - tinycnt);
data/mtd-utils-2.1.2/nand-utils/nandwrite.c:531:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
					cnt = read(ifd, oobbuf + tinycnt, readlen - tinycnt);
data/mtd-utils-2.1.2/tests/checkfs/checkfs.c:515:13:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
            strncpy(SerialDevice, argv[++cnt], sizeof(SerialDevice) - 1);
data/mtd-utils-2.1.2/tests/checkfs/comm.c:44: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).
    if(write(fd, buf, strlen(buf)) < strlen(buf))
data/mtd-utils-2.1.2/tests/checkfs/comm.c:44: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).
    if(write(fd, buf, strlen(buf)) < strlen(buf))
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:323: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).
	sz = strlen(a) + strlen(b) + 1;
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:323: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).
	sz = strlen(a) + strlen(b) + 1;
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:340: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).
	na = strlen(a);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:341: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).
	nb = strlen(b);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:355:2:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
	strcat(str, "/");
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1437: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).
	size_t fname_len = strlen(get_file_name(file));
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1441: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).
	if (fname_len + strlen(read_suffix) > fsinfo.max_name_len)
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1442:37:  [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).
		fname_len = fsinfo.max_name_len - strlen(read_suffix);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1443:2:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
	strncat(name, get_file_name(file), fname_len);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1453:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ssize_t r = read(fd, buf, IO_BUFFER_SIZE);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1463: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).
	if (fname_len + strlen(write_suffix) > fsinfo.max_name_len)
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1464:37:  [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).
		fname_len = fsinfo.max_name_len - strlen(write_suffix);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1465:2:  [1] (buffer) strncat:
  Easily used incorrectly (e.g., incorrectly computing the correct maximum
  size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf,
  or automatically resizing strings.
	strncat(name, get_file_name(file), fname_len);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1490:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		CHECK(read(fd, buf, block) == block);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1526:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		CHECK(read(fd, read_buf, block) == block);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1633: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).
	tarlen = strlen(target_pathname);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1637:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(p, path, len);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:1664: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).
	CHECK(strlen(symlink->target_pathname) == len);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2051: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).
	len2 = strlen(p2);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2072:4:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
			strcat(rel, "/");
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2720:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		rd = read(fd, buf, IO_BUFFER_SIZE);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2871: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).
	p = opts = zalloc(strlen(mount_opts) + 1);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2894:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			int len = strlen(opt);
data/mtd-utils-2.1.2/tests/fs-tests/integrity/integck.c:2949: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).
	p += strlen(p);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:203:39:  [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 (i+1 < argc && !isdigit(argv[i][strlen(argv[i])-1]))
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:225:39:  [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 (i+1 < argc && !isdigit(argv[i][strlen(argv[i])-1]))
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:239:39:  [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 (i+1 < argc && !isdigit(argv[i][strlen(argv[i])-1]))
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:514:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		sz = read(fd, buf, WRITE_BUFFER_SIZE);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:752:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		sz = read(fd, buf, 8192);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:780:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		sz = read(fd, buf, 8192);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:1003: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).
	p = opts = calloc(1, strlen(*mnt_opts) + 1);
data/mtd-utils-2.1.2/tests/fs-tests/lib/tests.c:1031:14:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			int len = strlen(opt);
data/mtd-utils-2.1.2/tests/fs-tests/simple/orph.c:120:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
			usleep(s);
data/mtd-utils-2.1.2/tests/fs-tests/simple/perf.c:134:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		readsz = read(fd, buf, block);
data/mtd-utils-2.1.2/tests/fs-tests/simple/test_1.c:55:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	CHECK(read(fd, old, 5) == 5);
data/mtd-utils-2.1.2/tests/fs-tests/simple/test_1.c:79:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	CHECK(read(fd, buf, 5) == 5);
data/mtd-utils-2.1.2/tests/fs-tests/simple/test_1.c:82:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	CHECK(read(fd, buf, 3) == 3);
data/mtd-utils-2.1.2/tests/fs-tests/simple/test_1.c:95:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	CHECK(read(fd, buf, 5) == 5);
data/mtd-utils-2.1.2/tests/fs-tests/simple/test_1.c:98:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	CHECK(read(fd, buf, 3) == 3);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/fwrite00.c:133:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
			usleep(s);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/fwrite00.c:149:3:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
		usleep(s);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/gcd_hupper.c:76: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).
		g->name = (char *) malloc(strlen(program_name) + 1);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/gcd_hupper.c:209:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
			usleep(s);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rmdir00.c:69:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
			usleep(s);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndrm00.c:92:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
			usleep(s);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndrm99.c:363:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
			usleep(s);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndwrite00.c:45:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		i = read(fd, buf, BUFFER_SIZE);
data/mtd-utils-2.1.2/tests/fs-tests/stress/atoms/rndwrite00.c:134:4:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
			usleep(s);
data/mtd-utils-2.1.2/tests/fs-tests/utils/fstest_monitor.c:111: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).
	q = v = (char *) malloc(strlen(cmdline) + 1024);
data/mtd-utils-2.1.2/tests/fs-tests/utils/fstest_monitor.c:227:39:  [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 (p+1 < argc && !isdigit(argv[p][strlen(argv[p])-1]))
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:314: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).
            if(write(Fd2, READ_FILE_MESSAGE, strlen(READ_FILE_MESSAGE)) < 0)
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:340:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        Write(Fd1, tmpBuf, strlen(tmpBuf), __LINE__);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:351:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        Write(Fd1, tmpBuf, strlen(tmpBuf), __LINE__);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:362: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).
    Write(Fd1, tmpBuf, strlen(tmpBuf), __LINE__);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:364: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).
    Write(Cfd, tmpBuf, strlen(tmpBuf), __LINE__);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:371: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).
    Write(Fd1, tmpBuf, strlen(tmpBuf), __LINE__);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:373: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).
    Write(Cfd, tmpBuf, strlen(tmpBuf), __LINE__);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:388:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        Write(Fd1, tmpBuf, strlen(tmpBuf), __LINE__);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:393:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        Write(Fd1, tmpBuf, strlen(tmpBuf), __LINE__);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:437: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).
    Write(Fd1, tmpBuf, strlen(tmpBuf), __LINE__);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:439: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).
    Write(Cfd, tmpBuf, strlen(tmpBuf), __LINE__);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:479:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    while((readBytes = read(fdProfile, readBuf, sizeof(readBuf))) > 0)
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:580: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).
        sprintf(&tmpBuf[strlen(tmpBuf)]," %f ms", (float)timeDiffusec/1000.0);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:597:13:  [1] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source is a constant character.
            sprintf(&tmpBuf[strlen(tmpBuf)],"!");
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:597: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).
            sprintf(&tmpBuf[strlen(tmpBuf)],"!");
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:608: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).
		  sprintf(&tmpBuf[strlen(tmpBuf)],"<Profile saved in file:%s>",
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:618:9:  [1] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source is a constant character.
        sprintf(&tmpBuf[strlen(tmpBuf)],"\n"); /* CR for the data going out of the console */
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:618: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).
        sprintf(&tmpBuf[strlen(tmpBuf)],"\n"); /* CR for the data going out of the console */
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:620:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        Write(Cfd, tmpBuf, strlen(tmpBuf), __LINE__);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:625: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).
        sprintf(&tmpBuf[strlen(tmpBuf)-1]," PadBytes:");
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:635: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).
            for(cntr = strlen(tmpBuf); cntr < WriteBytes - 1 ; cntr++) /* "-1" adj for '\n' at end */
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:655:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        Write(Fd1, tmpBuf, strlen(tmpBuf), __LINE__);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:662:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	    cntr = read(Fd2, tmpBuf, 1);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:680:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        Write(Fd1, tmpBuf, strlen(tmpBuf), __LINE__);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:834:17:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                strncpy(ReadFile, argv[argNum], sizeof(ReadFile));
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:862:8:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	      strncpy(LogFile, argv[argNum], sizeof(LogFile) - 1);
data/mtd-utils-2.1.2/tests/jittertest/JitterTest.c:926: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).
    fileNameLen = strlen(pFileName);
data/mtd-utils-2.1.2/tests/jittertest/plotJittervsFill.c:125:21:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
                    strncpy(LogFile, argv[argNum], sizeof(LogFile));
data/mtd-utils-2.1.2/tests/mtd-tests/nandpagetest.c:241:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			diff = read(fd, twopages + rd, bufsize - rd);
data/mtd-utils-2.1.2/tests/ubi-tests/helpers.c:171:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(req->name) != strlen(vol_info.name) ||
data/mtd-utils-2.1.2/tests/ubi-tests/helpers.c:171: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).
	if (strlen(req->name) != strlen(vol_info.name) ||
data/mtd-utils-2.1.2/tests/ubi-tests/helpers.c:243:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = read(fd, buf, 512);
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:240:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			bytes_read = read(fd, read_buffer, size);
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:255:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		bytes_read = read(fd, read_buffer, w->size);
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:276:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		bytes_read = read(fd, read_buffer, size);
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:646: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).
	size_t n = strlen(name);
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:648:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(argv[i]) > n)
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:663: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).
	size_t n = strlen(name);
data/mtd-utils-2.1.2/tests/ubi-tests/integ.c:665:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(argv[i]) > n)
data/mtd-utils-2.1.2/tests/ubi-tests/io_basic.c:51: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).
	char vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/io_basic.c:101: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).
	char vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/io_paral.c:114:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = read(fd, rbuf + rd, to_read);
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:67: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).
	char vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:105:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, 1);
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:134:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, 20);
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:188:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	if (read(fd, buf, len) != len1) {
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:250: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).
	char vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/io_read.c:326: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).
	char vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/io_update.c:78: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).
	char vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/io_update.c:187:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			ret = read(fd, buf1, test_len + 100);
data/mtd-utils-2.1.2/tests/ubi-tests/io_update.c:189:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			ret = read(fd, buf1, test_len);
data/mtd-utils-2.1.2/tests/ubi-tests/io_update.c:227: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).
	char vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/mkvol_bad.c:188: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).
		char nm[strlen(name) + 50];
data/mtd-utils-2.1.2/tests/ubi-tests/mkvol_basic.c:169: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).
		char nm[strlen(name) + 50];
data/mtd-utils-2.1.2/tests/ubi-tests/mkvol_paral.c:50: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).
	char nm[strlen(name) + 50];
data/mtd-utils-2.1.2/tests/ubi-tests/rsvol.c:110: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).
	char vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/rsvol.c:198:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, buf, bytes);
data/mtd-utils-2.1.2/tests/ubi-tests/rsvol.c:230: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).
	char vol_node[strlen(UBI_VOLUME_PATTERN) + 100];
data/mtd-utils-2.1.2/tests/ubi-tests/volrefcnt.c:94:8:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	ret = read(fd, tmp, 100);
data/mtd-utils-2.1.2/tests/unittests/libubi_test.c:208: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).
	rr.name_len = strlen(vol_name);
data/mtd-utils-2.1.2/tests/unittests/libubi_test.c:209:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(rr.name, vol_name, UBI_MAX_VOLUME_NAME + 1);
data/mtd-utils-2.1.2/ubi-utils/mtdinfo.c:76:31:  [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).
		PROGRAM_NAME, VERSION, (int)strlen(PROGRAM_NAME) + 3, "");
data/mtd-utils-2.1.2/ubi-utils/ubicrc32.c:105:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		size_t read;
data/mtd-utils-2.1.2/ubi-utils/ubicrc32.c:113:29:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		crc = mtd_crc32(crc, buf, read);
data/mtd-utils-2.1.2/ubi-utils/ubiformat.c:336:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ssize_t l = read(fd, buf, len);
data/mtd-utils-2.1.2/ubi-utils/ubimkvol.c:115: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(args.name);
data/mtd-utils-2.1.2/ubi-utils/ubinize.c:252:6:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
	if (strlen(sname) > 128)
data/mtd-utils-2.1.2/ubi-utils/ubinize.c:366: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).
	vi->name_len = strlen(p);
data/mtd-utils-2.1.2/ubi-utils/ubirename.c:128:32:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
		rnvol.ents[count].name_len = strlen(argv[i + 1]);
data/mtd-utils-2.1.2/ubi-utils/ubiupdatevol.c:265:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		ret = read(ifd, buf, to_copy);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/devtable.c:138:6:  [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 (sscanf(line, "%1023s %c %o %u %u %u %u %u %u %u",
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/devtable.c:261:37:  [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 i, num = start + count, len = strlen(name) + 20;
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/devtable.c:358: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(line);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/devtable.c:367: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(line);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/fscrypt.c:217:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
	keysize = read(kf, fscrypt_masterkey, FS_MAX_KEY_SIZE);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:301: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).
		  dir, dir[strlen(dir) - 1] == '/' ? "" : "/", name);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:584: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).
			root_len = strlen(optarg);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:731: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).
			context_len = strlen(optarg);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1220: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).
	nm.len = strlen(name);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1366: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).
		pos += strlen(name) + 1;
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1423: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).
	if (path_name[strlen(root)] == '/')
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1424:30:  [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).
		sepath = strdup(&path_name[strlen(root)]);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1426:47:  [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).
	else if (asprintf(&sepath, "/%s", &path_name[strlen(root)]) < 0)
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1442: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).
	con_size = strlen(secontext) + 1;
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1446: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).
	nm.len = strlen(name);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1725: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).
	dname.len = strlen(name);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1836:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			ret = read(fd, buf + bytes_read,
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:1963:28:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			im->path_name = xmalloc(strlen(path_name) + 1);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:2128: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).
		size += ALIGN(UBIFS_DENT_NODE_SZ + strlen(entry->d_name) + 1,
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/mkfs.ubifs.c:2200: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).
		size += ALIGN(UBIFS_DENT_NODE_SZ + strlen(nh_elt->name) + 1, 8);
data/mtd-utils-2.1.2/ubifs-utils/mkfs.ubifs/sign.c:124: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).
	pwlen = strlen(key_pass);

ANALYSIS SUMMARY:

Hits = 975
Lines analyzed = 54843 in approximately 1.57 seconds (34826 lines/second)
Physical Source Lines of Code (SLOC) = 37615
Hits@level = [0] 1097 [1] 231 [2] 558 [3]  70 [4] 111 [5]   5
Hits@level+ = [0+] 2072 [1+] 975 [2+] 744 [3+] 186 [4+] 116 [5+]   5
Hits/KSLOC@level+ = [0+] 55.0844 [1+] 25.9205 [2+] 19.7793 [3+] 4.94484 [4+] 3.08388 [5+] 0.132926
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.