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/smartmontools-7.1/aacraid.h
Examining data/smartmontools-7.1/atacmdnames.cpp
Examining data/smartmontools-7.1/atacmdnames.h
Examining data/smartmontools-7.1/atacmds.cpp
Examining data/smartmontools-7.1/ataidentify.cpp
Examining data/smartmontools-7.1/ataidentify.h
Examining data/smartmontools-7.1/ataprint.cpp
Examining data/smartmontools-7.1/ataprint.h
Examining data/smartmontools-7.1/cciss.cpp
Examining data/smartmontools-7.1/cciss.h
Examining data/smartmontools-7.1/cissio_freebsd.h
Examining data/smartmontools-7.1/csmisas.h
Examining data/smartmontools-7.1/dev_areca.cpp
Examining data/smartmontools-7.1/dev_areca.h
Examining data/smartmontools-7.1/dev_ata_cmd_set.cpp
Examining data/smartmontools-7.1/dev_ata_cmd_set.h
Examining data/smartmontools-7.1/dev_intelliprop.cpp
Examining data/smartmontools-7.1/dev_intelliprop.h
Examining data/smartmontools-7.1/dev_interface.cpp
Examining data/smartmontools-7.1/dev_interface.h
Examining data/smartmontools-7.1/dev_jmb39x_raid.cpp
Examining data/smartmontools-7.1/dev_legacy.cpp
Examining data/smartmontools-7.1/dev_tunnelled.h
Examining data/smartmontools-7.1/drivedb.h
Examining data/smartmontools-7.1/freebsd_nvme_ioctl.h
Examining data/smartmontools-7.1/getopt/bits/getopt_core.h
Examining data/smartmontools-7.1/getopt/bits/getopt_ext.h
Examining data/smartmontools-7.1/getopt/getopt.c
Examining data/smartmontools-7.1/getopt/getopt.h
Examining data/smartmontools-7.1/getopt/getopt1.c
Examining data/smartmontools-7.1/getopt/getopt_int.h
Examining data/smartmontools-7.1/json.cpp
Examining data/smartmontools-7.1/json.h
Examining data/smartmontools-7.1/knowndrives.cpp
Examining data/smartmontools-7.1/knowndrives.h
Examining data/smartmontools-7.1/linux_nvme_ioctl.h
Examining data/smartmontools-7.1/megaraid.h
Examining data/smartmontools-7.1/netbsd_nvme_ioctl.h
Examining data/smartmontools-7.1/nvmecmds.cpp
Examining data/smartmontools-7.1/nvmecmds.h
Examining data/smartmontools-7.1/nvmeprint.cpp
Examining data/smartmontools-7.1/nvmeprint.h
Examining data/smartmontools-7.1/os_darwin.cpp
Examining data/smartmontools-7.1/os_darwin.h
Examining data/smartmontools-7.1/os_freebsd.cpp
Examining data/smartmontools-7.1/os_freebsd.h
Examining data/smartmontools-7.1/os_generic.cpp
Examining data/smartmontools-7.1/os_generic.h
Examining data/smartmontools-7.1/os_linux.cpp
Examining data/smartmontools-7.1/os_linux.h
Examining data/smartmontools-7.1/os_netbsd.cpp
Examining data/smartmontools-7.1/os_netbsd.h
Examining data/smartmontools-7.1/os_openbsd.cpp
Examining data/smartmontools-7.1/os_openbsd.h
Examining data/smartmontools-7.1/os_os2.cpp
Examining data/smartmontools-7.1/os_os2.h
Examining data/smartmontools-7.1/os_qnxnto.cpp
Examining data/smartmontools-7.1/os_qnxnto.h
Examining data/smartmontools-7.1/os_solaris.cpp
Examining data/smartmontools-7.1/os_solaris.h
Examining data/smartmontools-7.1/os_win32/daemon_win32.cpp
Examining data/smartmontools-7.1/os_win32/daemon_win32.h
Examining data/smartmontools-7.1/os_win32/popen.h
Examining data/smartmontools-7.1/os_win32/popen_win32.cpp
Examining data/smartmontools-7.1/os_win32/runcmd.c
Examining data/smartmontools-7.1/os_win32/syslog.h
Examining data/smartmontools-7.1/os_win32/syslog_win32.cpp
Examining data/smartmontools-7.1/os_win32/wmiquery.cpp
Examining data/smartmontools-7.1/os_win32/wmiquery.h
Examining data/smartmontools-7.1/os_win32/wtssendmsg.c
Examining data/smartmontools-7.1/os_win32.cpp
Examining data/smartmontools-7.1/regex/regcomp.c
Examining data/smartmontools-7.1/regex/regex.c
Examining data/smartmontools-7.1/regex/regex.h
Examining data/smartmontools-7.1/regex/regexec.c
Examining data/smartmontools-7.1/regex/regex_internal.c
Examining data/smartmontools-7.1/regex/regex_internal.h
Examining data/smartmontools-7.1/scsiata.cpp
Examining data/smartmontools-7.1/scsicmds.cpp
Examining data/smartmontools-7.1/scsicmds.h
Examining data/smartmontools-7.1/scsinvme.cpp
Examining data/smartmontools-7.1/scsiprint.cpp
Examining data/smartmontools-7.1/scsiprint.h
Examining data/smartmontools-7.1/sg_unaligned.h
Examining data/smartmontools-7.1/smartctl.cpp
Examining data/smartmontools-7.1/smartctl.h
Examining data/smartmontools-7.1/static_assert.h
Examining data/smartmontools-7.1/utility.cpp
Examining data/smartmontools-7.1/utility.h
Examining data/smartmontools-7.1/atacmds.h
Examining data/smartmontools-7.1/smartd.cpp

FINAL RESULTS:

data/smartmontools-7.1/os_linux.cpp:2871: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.
    int sz = readlink(name, dest, sizeof(dest)-1);
data/smartmontools-7.1/ataprint.cpp:1800:7:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
      snprintf(valstr, sizeof(valstr), "%" PRId64, val);
data/smartmontools-7.1/ataprint.cpp:2573:5:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    snprintf(msglba, sizeof(msglba), "%" PRIu64, failing_lba);
data/smartmontools-7.1/ataprint.cpp:2813:15:  [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.
  if ((field1=snprintf(tmp,64, "%" PRIu64, maxl))<7)
data/smartmontools-7.1/ataprint.cpp:2815:15:  [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.
  if ((field2=snprintf(tmp,64, "%" PRIu64, maxr))<7)
data/smartmontools-7.1/getopt/getopt.c:42:10:  [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 fprintf __fxprintf_nocancel
data/smartmontools-7.1/json.cpp:165:3:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  snprintf(s, sizeof(s), "%" PRIu64, value);
data/smartmontools-7.1/json.cpp:430:7:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
      fprintf(f, "%" PRId64, (int64_t)p->intval);
data/smartmontools-7.1/json.cpp:434:7:  [4] (format) fprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
      fprintf(f, "%" PRIu64, p->intval);
data/smartmontools-7.1/knowndrives.cpp:895:8:  [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(db1, 0)) {
data/smartmontools-7.1/knowndrives.cpp:903:8:  [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(db2, 0)) {
data/smartmontools-7.1/nvmeprint.cpp:436:7:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
      snprintf(lb, sizeof(lb), "%" PRIu64, e.lba);
data/smartmontools-7.1/os_freebsd.cpp:474:6:  [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.
  if(sscanf(dev, NVME_CTRLR_PREFIX"%d%c", &ctrlid, &tmp) == 1)
data/smartmontools-7.1/os_freebsd.cpp:482:12:  [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.
  else if (sscanf(dev, NVME_CTRLR_PREFIX"%d" NVME_NS_PREFIX "%d%c", 
data/smartmontools-7.1/os_freebsd.cpp:497:3:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  snprintf(full_path, sizeof(full_path), NVME_CTRLR_PREFIX"%d", ctrlid);
data/smartmontools-7.1/os_freebsd.cpp:1786:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(ctrlpath, "%s%d", NVME_CTRLR_PREFIX, ctrlr);
data/smartmontools-7.1/os_linux.cpp:2778:12:  [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.
  } while (access((dir + "/idVendor").c_str(), 0));
data/smartmontools-7.1/os_netbsd.cpp:255:6:  [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.
  if(sscanf(dev, NVME_PREFIX"%d%c", &ctrlid, &tmp) == 1)
data/smartmontools-7.1/os_netbsd.cpp:263:12:  [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.
  else if (sscanf(dev, NVME_PREFIX "%d" NVME_NS_PREFIX "%d%c",
data/smartmontools-7.1/os_netbsd.cpp:278:3:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  snprintf(full_path, sizeof(full_path), NVME_PREFIX"%d", ctrlid);
data/smartmontools-7.1/os_netbsd.cpp:602:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(mp[n], "%s%s%c", net_dev_raw_prefix, p, 'a' + getrawpartition());
data/smartmontools-7.1/os_netbsd.cpp:639:5:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    snprintf(ctrlpath, sizeof(ctrlpath), NVME_PREFIX"%d", ctrl);
data/smartmontools-7.1/os_netbsd.cpp:659:7:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
      snprintf(nspath, sizeof(nspath), NVME_PREFIX "%d" NVME_NS_PREFIX "%d",
data/smartmontools-7.1/os_openbsd.cpp:123:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(mp[n], "%s%s%c", net_dev_prefix, p, 'a' + getrawpartition());
data/smartmontools-7.1/os_solaris.cpp:192:17:  [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(&pathbuf[len], de->d_name);
data/smartmontools-7.1/os_win32.cpp:2647:16:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    FILE * f = popen(cmd, "rb");
data/smartmontools-7.1/os_win32/daemon_win32.cpp:847:24:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
    strcat(path, " "); strcat(path, svc_opts->cmd_opt);
data/smartmontools-7.1/os_win32/daemon_win32.cpp:854:30:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
        strcat(path, " \""); strcat(path, s); strcat(path, "\"");
data/smartmontools-7.1/os_win32/daemon_win32.cpp:857:28:  [4] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused).
        strcat(path, " "); strcat(path, s);
data/smartmontools-7.1/os_win32/popen.h:19:8:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
#undef popen
data/smartmontools-7.1/os_win32/popen.h:37:8:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
FILE * popen(const char * command, const char * mode);
data/smartmontools-7.1/os_win32/popen_win32.cpp:30:8:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
FILE * popen(const char * command, const char * mode)
data/smartmontools-7.1/os_win32/syslog_win32.cpp:34:9:  [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.
#define snprintf _snprintf
data/smartmontools-7.1/os_win32/syslog_win32.cpp:34:18:  [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.
#define snprintf _snprintf
data/smartmontools-7.1/os_win32/syslog_win32.cpp:35:9:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#define vsnprintf _vsnprintf
data/smartmontools-7.1/os_win32/syslog_win32.cpp:327:6:  [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.
	if (snprintf(sl_pidstr, sizeof(sl_pidstr)-1, (pid >= 0 ? "%d" : "0x%X"), pid) < 0)
data/smartmontools-7.1/os_win32/syslog_win32.cpp:331:10:  [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).
		strcat(strcpy(sl_logpath, sl_ident), ".log");
data/smartmontools-7.1/os_win32/syslog_win32.cpp:344:10:  [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).
		strcat(strcpy(sl_logpath, sl_ident), ".log");
data/smartmontools-7.1/os_win32/syslog_win32.cpp:371:6:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
	if (vsnprintf(buffer, sizeof(buffer)-1, message, args) < 0)
data/smartmontools-7.1/os_win32/syslog_win32.cpp:397:6:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
void syslog(int priority, const char *message, ...)
data/smartmontools-7.1/os_win32/syslog_win32.cpp:417:3:  [4] (format) syslog:
  If syslog's format strings can be influenced by an attacker, they can be
  exploited (CWE-134). Use a constant format string for syslog.
		syslog((i % 17) ? LOG_INFO : LOG_ERR, buf);
data/smartmontools-7.1/os_win32/wmiquery.cpp:147:3:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  vsnprintf(qline, sizeof(qline), qstr, args);
data/smartmontools-7.1/os_win32/wmiquery.h:26:65:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define __attribute_format_printf(x, y)  __attribute__((format (printf, x, y)))
data/smartmontools-7.1/scsiprint.cpp:1103:13:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            snprintf(buff, sizeof(buff), "%" PRIu64, ull);
data/smartmontools-7.1/smartctl.cpp:1280:5:  [4] (format) vprintf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
    vprintf(fmt, ap);
data/smartmontools-7.1/smartctl.cpp:1287:5:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
    vsnprintf(bufnext, sizeof(buf) - (bufnext - buf), fmt, ap);
data/smartmontools-7.1/smartd.cpp:1160:3:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  vsnprintf(message, sizeof(message), fmt, ap);
data/smartmontools-7.1/smartd.cpp:1216:13:  [4] (shell) popen:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  if (!(pfp=popen(command, "r")))
data/smartmontools-7.1/smartd.cpp:1300:3:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  vsnprintf(msg, sizeof(msg), fmt, ap);
data/smartmontools-7.1/smartd.cpp:1318:3:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  vsnprintf(buf, sizeof(buf), fmt, ap);
data/smartmontools-7.1/smartd.cpp:1354:5:  [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(f, fmt, ap);
data/smartmontools-7.1/smartd.cpp:1381:5:  [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(f, fmt, ap);
data/smartmontools-7.1/utility.cpp:680:3:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  snprintf(num, sizeof(num), "%" PRIu64, val);
data/smartmontools-7.1/utility.cpp:744:3:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  vsnprintf(buf, sizeof(buf), fmt, ap);
data/smartmontools-7.1/utility.cpp:768: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.
    return snprintf(str, (size_t)strsize, "%" PRIu64, (uint64_t)value);
data/smartmontools-7.1/utility.cpp:778:16:  [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.
    int len2 = snprintf(str + (len1 < strsize ? len1 : strsize - 1),
data/smartmontools-7.1/utility.cpp:840:8:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#undef vsnprintf
data/smartmontools-7.1/utility.cpp:842:9:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#define vsnprintf _vsnprintf
data/smartmontools-7.1/utility.cpp:850:7:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
  i = vsnprintf(buf, size, fmt, ap);
data/smartmontools-7.1/utility.h:40:65:  [4] (format) printf:
  If format strings can be influenced by an attacker, they can be exploited
  (CWE-134). Use a constant for the format specification.
#define __attribute_format_printf(x, y)  __attribute__((format (printf, x, y)))
data/smartmontools-7.1/utility.h:63:9:  [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.
#define snprintf  safe_snprintf
data/smartmontools-7.1/utility.h:64:9:  [4] (format) vsnprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
#define vsnprintf safe_vsnprintf
data/smartmontools-7.1/getopt/bits/getopt_core.h:91:12:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
data/smartmontools-7.1/getopt/bits/getopt_ext.h:66:12:  [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.
extern int getopt_long (int ___argc, char *__getopt_argv_const *___argv,
data/smartmontools-7.1/getopt/getopt.c:418:33:  [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.
  else if (posixly_correct || !!getenv ("POSIXLY_CORRECT"))
data/smartmontools-7.1/getopt/getopt.c:749:14:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
GETOPT_ENTRY(getopt, 0)
data/smartmontools-7.1/getopt/getopt.c:752:14:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
GETOPT_ENTRY(getopt, 1)
data/smartmontools-7.1/getopt/getopt.c:771:11:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
      c = getopt (argc, argv, "abc:d:0123456789");
data/smartmontools-7.1/getopt/getopt1.c:28:1:  [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.
getopt_long (int argc, char *__getopt_argv_const *argv, const char *options,
data/smartmontools-7.1/getopt/getopt1.c:94: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.
      c = getopt_long (argc, argv, "abc:d:0123456789",
data/smartmontools-7.1/os_freebsd.cpp:1953:16:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
    char * p = realpath(name, (char *)0);
data/smartmontools-7.1/os_linux.cpp:2782:16:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
    char * p = realpath(dir.c_str(), (char *)0);
data/smartmontools-7.1/os_linux.cpp:3219:24:  [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.
  char * syshostpath = realpath(path, (char *)0);
data/smartmontools-7.1/os_linux.cpp:3269:16:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
    char * p = realpath(name, (char *)0);
data/smartmontools-7.1/os_netbsd.cpp:768:16:  [3] (buffer) realpath:
  This function does not protect against buffer overflows, and some
  implementations can overflow internally (CWE-120/CWE-785!). Ensure that the
  destination buffer is at least of size MAXPATHLEN, andto protect against
  implementation problems, the input argument should also be checked to
  ensure it is no larger than MAXPATHLEN.
    char * p = realpath(name, (char *)0);
data/smartmontools-7.1/os_solaris.cpp:95: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(dev_name, devpath) == NULL)
data/smartmontools-7.1/os_win32/popen_win32.cpp:119:5:  [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.
    getenv("COMSPEC"), // "C:\WINDOWS\system32\cmd.exe" or nullptr
data/smartmontools-7.1/smartctl.cpp:368:21:  [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 ((optchar = getopt_long(argc, argv, shortopts, longopts, 0)) != -1) {
data/smartmontools-7.1/smartd.cpp:224:8:  [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.
  if (!getenv("NOTIFY_SOCKET"))
data/smartmontools-7.1/smartd.cpp:298:7:  [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.
  if (getenv("NOTIFY_SOCKET")) {
data/smartmontools-7.1/smartd.cpp:4907:21:  [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 ((optchar = getopt_long(argc, argv, shortopts, longopts, NULL)) != -1) {
data/smartmontools-7.1/utility.cpp:183:8:  [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.
  if (!getenv("TZ")) {
data/smartmontools-7.1/utility.cpp:190:8:  [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.
  if (!getenv("TZ")) {
data/smartmontools-7.1/utility.cpp:212:8:  [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.
    if(getenv("TZ")) {
data/smartmontools-7.1/utility.cpp:347:8:  [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.
  if (!getenv("TZ"))
data/smartmontools-7.1/atacmds.cpp:164: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 fmtname[32+1], attrname[32+1], hddssd[3+1];
data/smartmontools-7.1/atacmds.cpp:193: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 byteorder[8+1] = "";
data/smartmontools-7.1/atacmds.cpp:393: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 bufs[7][8];
data/smartmontools-7.1/atacmds.cpp:402: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 bufs[7][8];
data/smartmontools-7.1/atacmds.cpp:478:27:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    prettyprint((unsigned char *)data, commandstrings[command]);
data/smartmontools-7.1/atacmds.cpp:652:24:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	prettyprint((unsigned char *)data, commandstrings[command]);
data/smartmontools-7.1/atacmds.cpp:722:29:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    sum += ((const unsigned char *)data)[i];
data/smartmontools-7.1/atacmds.cpp:766: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[65];
data/smartmontools-7.1/atacmds.cpp:850: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(raw_buf, buf, sizeof(*buf));
data/smartmontools-7.1/atacmds.cpp:1619: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 cmdmsg[128]; const char *type, *captive;
data/smartmontools-7.1/atacmds.cpp:1931: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 raw[6];
data/smartmontools-7.1/atacmds.cpp:2166:27:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    static const unsigned char ids[4] = {194, 190, 9, 220};
data/smartmontools-7.1/atacmds.cpp:2531: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).
  virtual bool open();
data/smartmontools-7.1/atacmds.cpp:2586: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(dest, src + srcmatch.rm_so, n);
data/smartmontools-7.1/atacmds.cpp:2595: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).
  return atoi(src + srcmatch.rm_so);
data/smartmontools-7.1/atacmds.cpp:2619:25:  [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).
bool parsed_ata_device::open()
data/smartmontools-7.1/atacmds.cpp:2626: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 buffer[64*1024];
data/smartmontools-7.1/atacmds.cpp:2671: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 cmdname[40];
data/smartmontools-7.1/atacmds.cpp:2811:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(data, m_command_table[i].data, 512);
data/smartmontools-7.1/atacmds.h:116: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  serial_no[20];
data/smartmontools-7.1/atacmds.h:118: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  fw_rev[8];
data/smartmontools-7.1/atacmds.h:119: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  model[40];
data/smartmontools-7.1/atacmds.h:142: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 raw[6];
data/smartmontools-7.1/atacmds.h:210: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 reserved_377_385[9];
data/smartmontools-7.1/atacmds.h:211: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 vendor_specific_386_510[125]; // Maxtor bytes 508-509 Attribute/Threshold Revision #
data/smartmontools-7.1/atacmds.h:230: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 reserved[10];
data/smartmontools-7.1/atacmds.h:240: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 reserved[149];
data/smartmontools-7.1/atacmds.h:257: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 extended_error[19];
data/smartmontools-7.1/atacmds.h:294: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 reserved[57];
data/smartmontools-7.1/atacmds.h:347: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 extended_error[19];
data/smartmontools-7.1/atacmds.h:373: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 reserved2[9];
data/smartmontools-7.1/atacmds.h:387: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 vendorspecific[15];
data/smartmontools-7.1/atacmds.h:396: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 vendorspecific[2];
data/smartmontools-7.1/atacmds.h:398: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 reserved[2];
data/smartmontools-7.1/atacmds.h:417: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 failing_lba[6];
data/smartmontools-7.1/atacmds.h:418: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 vendorspecific[15];
data/smartmontools-7.1/atacmds.h:431: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 vendor_specifc[2];
data/smartmontools-7.1/atacmds.h:432: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 reserved2[11];
data/smartmontools-7.1/atacmds.h:465: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      reserved1[337-82+1];
data/smartmontools-7.1/atacmds.h:466: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      vendor_specific1[491-338+1];
data/smartmontools-7.1/atacmds.h:470: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      vendor_specific2[507-504+1];
data/smartmontools-7.1/atacmds.h:497: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 bytes011_013[3];    // 11-13: reserved
data/smartmontools-7.1/atacmds.h:501: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 bytes020_039[20];   // 20-39: reserved
data/smartmontools-7.1/atacmds.h:503: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 bytes048_199[152];  // 48-199: reserved
data/smartmontools-7.1/atacmds.h:514: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 bytes216_479[479-218+1]; // 218-479: reserved
data/smartmontools-7.1/atacmds.h:515: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 vendor_specific[32];// 480-511: vendor specific
data/smartmontools-7.1/atacmds.h:570: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 bytes010_029[20];   // 10-29: reserved
data/smartmontools-7.1/atacmds.h:573: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.
  signed char cb[478];              // 34-(34+cb_size-1): Circular buffer of temperature values
data/smartmontools-7.1/atacmds.h:665: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 byteorder[8+1]; // String [012345rvwz] to define byte order
data/smartmontools-7.1/ataidentify.cpp:645: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.
          char valstr[20];
data/smartmontools-7.1/ataidentify.cpp:695:37:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                  char c2 = ((const char *)id)[2*(j+k)    ];
data/smartmontools-7.1/ataidentify.cpp:696:37:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                  char c1 = ((const char *)id)[2*(j+k) + 1];
data/smartmontools-7.1/ataprint.cpp:72: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.
  const char *error_flag[8];
data/smartmontools-7.1/ataprint.cpp:626: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 model[40+1], serial[20+1], firmware[8+1];
data/smartmontools-7.1/ataprint.cpp:657: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 add[8+1];
data/smartmontools-7.1/ataprint.cpp:670: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 num[64], cap[32];
data/smartmontools-7.1/ataprint.cpp:759:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buf[32] = "";
data/smartmontools-7.1/ataprint.cpp:778: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 timedatetz[DATEANDEPOCHLEN]; dateandtimezoneepoch(timedatetz, now);
data/smartmontools-7.1/ataprint.cpp:1790: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 valstr[32];
data/smartmontools-7.1/ataprint.cpp:1849: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 page_0[512] = {0, };
data/smartmontools-7.1/ataprint.cpp:1965: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 page_buf[512] = {0, };
data/smartmontools-7.1/ataprint.cpp:2000: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 hourstr[32];
data/smartmontools-7.1/ataprint.cpp:2571: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 msglba[32];
data/smartmontools-7.1/ataprint.cpp:2812: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[64];
data/smartmontools-7.1/ataprint.cpp:2978: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 buf1[20], buf2[20];
data/smartmontools-7.1/ataprint.cpp:3038: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 buf1[20], buf2[20], buf3[64];
data/smartmontools-7.1/ataprint.cpp:3085:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char date[32] = "";
data/smartmontools-7.1/ataprint.cpp:3416: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 raw_drive[sizeof(drive)]; memset(&raw_drive, 0, sizeof(raw_drive));
data/smartmontools-7.1/ataprint.cpp:3606: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.
  const char * sct_write_cache_state_desc[4] = {
data/smartmontools-7.1/ataprint.cpp:4397:16:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      unsigned char log_11[512] = {0, };
data/smartmontools-7.1/ataprint.cpp:4503: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.
      char comptime[DATEANDEPOCHLEN];
data/smartmontools-7.1/cciss.cpp:79:15:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
     unsigned char phylun[8] = {0};
data/smartmontools-7.1/cciss.cpp:90:15:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
     unsigned char sensebuf[SEND_IOCTL_RESP_SENSE_LEN];
data/smartmontools-7.1/cciss.cpp:122: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(iop->sensep, pBuf, len);
data/smartmontools-7.1/cciss.cpp:170:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&iocommand.LUN_info.LunAddrBytes,scsi3addr,8);
data/smartmontools-7.1/cciss.cpp:179: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(&iocommand.Request.CDB[0], CDB, CDBlen);
data/smartmontools-7.1/cciss.cpp:199:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char CDB[16]= {0};
data/smartmontools-7.1/cciss.cpp:238: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(physlun, luns->LUN[target], 8);
data/smartmontools-7.1/cissio_freebsd.h:55:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
typedef char		NodeName_type[16];
data/smartmontools-7.1/cissio_freebsd.h:64:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
typedef char		FirmwareVer_type[4];
data/smartmontools-7.1/dev_areca.cpp:132: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 return_buff[2048]={0};
data/smartmontools-7.1/dev_areca.cpp:139: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(sBuf.srbioctl.Signature, ARECA_SIG_STR, strlen(ARECA_SIG_STR));
data/smartmontools-7.1/dev_areca.cpp:150:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy((unsigned char *)sBuf.ioctldatabuffer, (unsigned char *)data, data_len);
data/smartmontools-7.1/dev_areca.cpp:202:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(ptr, &sBuf.ioctldatabuffer[0], sBuf.srbioctl.Length);
data/smartmontools-7.1/dev_areca.cpp:251: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(data, return_buff, total);
data/smartmontools-7.1/dev_areca.cpp:261:5:  [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).
    open();
data/smartmontools-7.1/dev_areca.cpp:274: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 return_buff[2048];
data/smartmontools-7.1/dev_areca.cpp:322: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(result, return_buff, expected);
data/smartmontools-7.1/dev_areca.cpp:330: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 return_buff[2048];
data/smartmontools-7.1/dev_areca.cpp:346: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 return_buff[2048];
data/smartmontools-7.1/dev_areca.cpp:390:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char reserved[8];
data/smartmontools-7.1/dev_areca.cpp:391:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char data[512]; // [in/out] buffer for outgoing/incoming data
data/smartmontools-7.1/dev_areca.cpp:431: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    areca_packet[640];
data/smartmontools-7.1/dev_areca.cpp:433: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 return_buff[2048];
data/smartmontools-7.1/dev_areca.cpp:455: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(&areca_packet[7], "SmrT", 4);  // areca defined password
data/smartmontools-7.1/dev_areca.cpp:483: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(ata_cmd->data, in.buffer, in.size);
data/smartmontools-7.1/dev_areca.cpp:514: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(in.buffer, &return_buff[7], in.size);
data/smartmontools-7.1/dev_areca.cpp:557: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    areca_packet[640];
data/smartmontools-7.1/dev_areca.cpp:559: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 return_buff[2048];
data/smartmontools-7.1/dev_areca.cpp:579: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(&areca_packet[7], "SmrT", 4);  // areca defined password
data/smartmontools-7.1/dev_areca.cpp:581: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( &areca_packet[35], iop->cmnd, iop->cmnd_len); // cdb
data/smartmontools-7.1/dev_areca.cpp:589: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(&areca_packet[67], iop->dxferp, iop->dxfer_len);
data/smartmontools-7.1/dev_areca.cpp:619: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(iop->dxferp, &return_buff[15], in_data_len);
data/smartmontools-7.1/dev_areca.h:77: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 Signature[8];
data/smartmontools-7.1/dev_areca.h:87: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   ioctldatabuffer[1032]; // the buffer to put the command data to/from firmware
data/smartmontools-7.1/dev_ata_cmd_set.cpp:35: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 buffer[512];
data/smartmontools-7.1/dev_intelliprop.cpp:253: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).
  virtual bool open();
data/smartmontools-7.1/dev_intelliprop.cpp:274:26:  [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).
bool intelliprop_device::open()
data/smartmontools-7.1/dev_intelliprop.cpp:276:50:  [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 (!tunnelled_device<ata_device, ata_device>::open())
data/smartmontools-7.1/dev_interface.cpp:86:3:  [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).
  open();
data/smartmontools-7.1/dev_interface.cpp:207: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 sense[32] = {0, };
data/smartmontools-7.1/dev_interface.cpp:266:29:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
bool tunnelled_device_base::open()
data/smartmontools-7.1/dev_interface.cpp:270:27:  [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 (!m_tunnel_base_dev->open())
data/smartmontools-7.1/dev_interface.h:189: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).
  virtual bool open() = 0;
data/smartmontools-7.1/dev_jmb39x_raid.cpp:32:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char msg[128];
data/smartmontools-7.1/dev_jmb39x_raid.cpp:179:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(data + 8, cmd, cmdsize);
data/smartmontools-7.1/dev_jmb39x_raid.cpp:307: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).
  virtual bool open();
data/smartmontools-7.1/dev_jmb39x_raid.cpp:459: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).
bool jmb39x_device::open()
data/smartmontools-7.1/dev_jmb39x_raid.cpp:465:52:  [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 (!tunnelled_device<ata_device, smart_device>::open())
data/smartmontools-7.1/dev_jmb39x_raid.cpp:652: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(in.buffer, response + 32, in.size - 32 - 16);
data/smartmontools-7.1/dev_legacy.cpp:62: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).
  virtual bool open();
data/smartmontools-7.1/dev_legacy.cpp:88:27:  [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).
bool legacy_smart_device::open()
data/smartmontools-7.1/dev_legacy.cpp:173: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).
  if (!open())
data/smartmontools-7.1/dev_legacy.cpp:183: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 req_buff[64] = {0, };
data/smartmontools-7.1/dev_tunnelled.h:34: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).
  virtual bool open();
data/smartmontools-7.1/json.cpp:27:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char msg[128];
data/smartmontools-7.1/json.cpp:164: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[32];
data/smartmontools-7.1/json.cpp:177: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 s[64];
data/smartmontools-7.1/json.cpp:439:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buf[64];
data/smartmontools-7.1/json.cpp:464:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char buf[10]; snprintf(buf, sizeof(buf), "[%u]", it.array_index());
data/smartmontools-7.1/json.cpp:498:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buf[64];
data/smartmontools-7.1/knowndrives.cpp:122: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(dest, src, len+1);
data/smartmontools-7.1/knowndrives.cpp:222: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 opt, arg[80+1+13]; int len = -1;
data/smartmontools-7.1/knowndrives.cpp:289: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 usb_id_str[16], bcd_dev_str[16];
data/smartmontools-7.1/knowndrives.cpp:523: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 model[MODEL_STRING_LENGTH+1], firmware[FIRMWARE_STRING_LENGTH+1];
data/smartmontools-7.1/knowndrives.cpp:560: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 model[MODEL_STRING_LENGTH+1], firmware[FIRMWARE_STRING_LENGTH+1];
data/smartmontools-7.1/megaraid.h:88:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
typedef char assert_sizeof_ptr_t[sizeof(ptr_t) == 8 ? 1 : -1];
data/smartmontools-7.1/nvmecmds.h:41: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   resv[35];
data/smartmontools-7.1/nvmecmds.h:60: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   rsvd23[9];
data/smartmontools-7.1/nvmecmds.h:67: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            sn[20];
data/smartmontools-7.1/nvmecmds.h:68: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            mn[40];
data/smartmontools-7.1/nvmecmds.h:69: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            fr[8];
data/smartmontools-7.1/nvmecmds.h:71: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   ieee[3];
data/smartmontools-7.1/nvmecmds.h:80: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   rsvd100[156];
data/smartmontools-7.1/nvmecmds.h:95: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   tnvmcap[16];
data/smartmontools-7.1/nvmecmds.h:96: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   unvmcap[16];
data/smartmontools-7.1/nvmecmds.h:106: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   rsvd332[180];
data/smartmontools-7.1/nvmecmds.h:120: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   rsvd534[2];
data/smartmontools-7.1/nvmecmds.h:122: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   rsvd540[228];
data/smartmontools-7.1/nvmecmds.h:123: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			      subnqn[256];
data/smartmontools-7.1/nvmecmds.h:124: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   rsvd1024[768];
data/smartmontools-7.1/nvmecmds.h:130: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   rsvd1804[244];
data/smartmontools-7.1/nvmecmds.h:132: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   vs[1024];
data/smartmontools-7.1/nvmecmds.h:163: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   rsvd46[2];
data/smartmontools-7.1/nvmecmds.h:164: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   nvmcap[16];
data/smartmontools-7.1/nvmecmds.h:165: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   rsvd64[40];
data/smartmontools-7.1/nvmecmds.h:166: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   nguid[16];
data/smartmontools-7.1/nvmecmds.h:167: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   eui64[8];
data/smartmontools-7.1/nvmecmds.h:169: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   rsvd192[192];
data/smartmontools-7.1/nvmecmds.h:170: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   vs[3712];
data/smartmontools-7.1/nvmecmds.h:176: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  temperature[2];
data/smartmontools-7.1/nvmecmds.h:180: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  rsvd6[26];
data/smartmontools-7.1/nvmecmds.h:181: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  data_units_read[16];
data/smartmontools-7.1/nvmecmds.h:182: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  data_units_written[16];
data/smartmontools-7.1/nvmecmds.h:183: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  host_reads[16];
data/smartmontools-7.1/nvmecmds.h:184: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  host_writes[16];
data/smartmontools-7.1/nvmecmds.h:185: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  ctrl_busy_time[16];
data/smartmontools-7.1/nvmecmds.h:186: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  power_cycles[16];
data/smartmontools-7.1/nvmecmds.h:187: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  power_on_hours[16];
data/smartmontools-7.1/nvmecmds.h:188: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  unsafe_shutdowns[16];
data/smartmontools-7.1/nvmecmds.h:189: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  media_errors[16];
data/smartmontools-7.1/nvmecmds.h:190: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  num_err_log_entries[16];
data/smartmontools-7.1/nvmecmds.h:198: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  rsvd232[280];
data/smartmontools-7.1/nvmeprint.cpp:110: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[64];
data/smartmontools-7.1/nvmeprint.cpp:193: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 td[DATEANDEPOCHLEN]; dateandtimezoneepoch(td, now);
data/smartmontools-7.1/nvmeprint.cpp:255: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[64];
data/smartmontools-7.1/nvmeprint.cpp:276: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 p1[16], p2[16], p3[16];
data/smartmontools-7.1/nvmeprint.cpp:337: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[64];
data/smartmontools-7.1/nvmeprint.cpp:425: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 sq[16] = "-", cm[16] = "-", st[16] = "-", pe[16] = "-";
data/smartmontools-7.1/nvmeprint.cpp: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 lb[32] = "-", ns[16] = "-", vs[8] = "-";
data/smartmontools-7.1/os_darwin.cpp:90: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).
  virtual bool open();
data/smartmontools-7.1/os_darwin.cpp:165:27:  [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).
bool darwin_smart_device::open()
data/smartmontools-7.1/os_freebsd.cpp:146: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).
  virtual bool open();
data/smartmontools-7.1/os_freebsd.cpp:211:28:  [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).
bool freebsd_smart_device::open()
data/smartmontools-7.1/os_freebsd.cpp:214: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 ((m_fd = ::open(dev,O_RDONLY))<0) {
data/smartmontools-7.1/os_freebsd.cpp:331: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).
  virtual bool open();
data/smartmontools-7.1/os_freebsd.cpp:341:29:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
bool freebsd_atacam_device::open(){
data/smartmontools-7.1/os_freebsd.cpp:449: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).
  virtual bool open();
data/smartmontools-7.1/os_freebsd.cpp:462:27:  [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).
bool freebsd_nvme_device::open()
data/smartmontools-7.1/os_freebsd.cpp:496: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	full_path[64];
data/smartmontools-7.1/os_freebsd.cpp:500: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 ((fd = ::open(full_path, O_RDWR))<0) {
data/smartmontools-7.1/os_freebsd.cpp:567: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).
  virtual bool open();
data/smartmontools-7.1/os_freebsd.cpp:583:31:  [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).
bool freebsd_escalade_device::open()
data/smartmontools-7.1/os_freebsd.cpp:588: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 ((fd = ::open(dev,O_RDWR))<0) {
data/smartmontools-7.1/os_freebsd.cpp:613: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 ioctl_buffer[TW_IOCTL_BUFFER_SIZE];
data/smartmontools-7.1/os_freebsd.cpp:696:8:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
       memcpy(cmd_twa->pdata, in.buffer, in.size);
data/smartmontools-7.1/os_freebsd.cpp:741:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(in.buffer, cmd_twa->pdata, in.size);
data/smartmontools-7.1/os_freebsd.cpp:743:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(in.buffer, cmd_twe->tu_data, in.size); // untested
data/smartmontools-7.1/os_freebsd.cpp:779: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).
  virtual bool open();
data/smartmontools-7.1/os_freebsd.cpp:782: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 m_hpt_data[3]; ///< controller/channel/port
data/smartmontools-7.1/os_freebsd.cpp:795:32:  [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).
bool freebsd_highpoint_device::open()
data/smartmontools-7.1/os_freebsd.cpp:800: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 ((fd = ::open(dev,O_RDWR))<0) {
data/smartmontools-7.1/os_freebsd.cpp:892: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(buff+sizeof(HPT_PASS_THROUGH_HEADER), data, 512);
data/smartmontools-7.1/os_freebsd.cpp:942: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[512];
data/smartmontools-7.1/os_freebsd.cpp:957: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(data, (unsigned char *)buff + 2 * sizeof(HPT_PASS_THROUGH_HEADER), 
data/smartmontools-7.1/os_freebsd.cpp:977: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).
  virtual bool open();
data/smartmontools-7.1/os_freebsd.cpp:985:27:  [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).
bool freebsd_scsi_device::open(){
data/smartmontools-7.1/os_freebsd.cpp:1080: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(ccb->csio.cdb_io.cdb_bytes,iop->cmnd,iop->cmnd_len);
data/smartmontools-7.1/os_freebsd.cpp:1128:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(iop->sensep, &(ccb->csio.sense_data), iop->resp_sense_len);
data/smartmontools-7.1/os_freebsd.cpp:1229: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).
  newdev->open();	// TODO: Can possibly pass open fd
data/smartmontools-7.1/os_freebsd.cpp:1239: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).
      if(!open()){
data/smartmontools-7.1/os_freebsd.cpp:1285: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).
      if(!open()){
data/smartmontools-7.1/os_freebsd.cpp:1321: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).
  virtual bool open();
data/smartmontools-7.1/os_freebsd.cpp:1327:28:  [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).
bool freebsd_cciss_device::open()
data/smartmontools-7.1/os_freebsd.cpp:1331: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 ((fd = ::open(dev,O_RDWR))<0) {
data/smartmontools-7.1/os_freebsd.cpp:1365: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).
  if (!open())
data/smartmontools-7.1/os_freebsd.cpp:1375: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 req_buff[64] = {0, };
data/smartmontools-7.1/os_freebsd.cpp:1516: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 ((fd = open(XPT_DEVICE, O_RDWR)) == -1) {
data/smartmontools-7.1/os_freebsd.cpp:1644: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 ((fd = open(ATA_DEVICE, O_RDWR)) < 0) {
data/smartmontools-7.1/os_freebsd.cpp:1783: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 ctrlpath[64];
data/smartmontools-7.1/os_freebsd.cpp:1787: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).
    int fd = ::open(ctrlpath, O_RDWR);
data/smartmontools-7.1/os_freebsd.cpp:1801: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 done[USB_MAX_DEVICES];
data/smartmontools-7.1/os_freebsd.cpp:1809: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 devname[256];
data/smartmontools-7.1/os_freebsd.cpp:1860: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[128]; // do not change!
data/smartmontools-7.1/os_freebsd.cpp:1861: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 devname[128];
data/smartmontools-7.1/os_freebsd.cpp:1907: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[50];
data/smartmontools-7.1/os_freebsd.cpp:1912: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).
    int f = open(buf, O_RDONLY);
data/smartmontools-7.1/os_freebsd.h:600: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 reserve[3];
data/smartmontools-7.1/os_linux.cpp:120: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).
  virtual bool open();
data/smartmontools-7.1/os_linux.cpp:149:26:  [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).
bool linux_smart_device::open()
data/smartmontools-7.1/os_linux.cpp:151: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).
  m_fd = ::open(get_dev_name(), m_flags);
data/smartmontools-7.1/os_linux.cpp:155: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).
    m_fd = ::open(get_dev_name(), m_retry_flags);
data/smartmontools-7.1/os_linux.cpp:255: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 buff[BUFFER_LENGTH];
data/smartmontools-7.1/os_linux.cpp:351:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char task[sizeof(ide_task_request_t)+512];
data/smartmontools-7.1/os_linux.cpp:372: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(task+sizeof(ide_task_request_t), data, 512);
data/smartmontools-7.1/os_linux.cpp:470: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(data, buff+HDIO_DRIVE_CMD_OFFSET, copydata);
data/smartmontools-7.1/os_linux.cpp:552:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buff[256];
data/smartmontools-7.1/os_linux.cpp:760: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(wrk.buff, iop->cmnd, iop->cmnd_len);
data/smartmontools-7.1/os_linux.cpp:766:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buff[256];
data/smartmontools-7.1/os_linux.cpp:799: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(wrk.buff + buff_offset, iop->dxferp, iop->dxfer_len);
data/smartmontools-7.1/os_linux.cpp:821: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(iop->dxferp, wrk.buff, iop->dxfer_len);
data/smartmontools-7.1/os_linux.cpp:839:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(iop->sensep, wrk.buff, len);
data/smartmontools-7.1/os_linux.cpp:965: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).
  virtual bool open();
data/smartmontools-7.1/os_linux.cpp:995:28:  [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).
bool linux_aacraid_device::open()
data/smartmontools-7.1/os_linux.cpp:999: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[128];
data/smartmontools-7.1/os_linux.cpp:1003: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).
  int afd = ::open(dev_name,O_RDWR);
data/smartmontools-7.1/os_linux.cpp:1007: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).
    FILE *fp = fopen("/proc/devices","r");
data/smartmontools-7.1/os_linux.cpp:1012: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[256];
data/smartmontools-7.1/os_linux.cpp:1033: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).
    afd = ::open(dev_name,O_RDWR);
data/smartmontools-7.1/os_linux.cpp:1051:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buff[256];
data/smartmontools-7.1/os_linux.cpp:1144: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(pSrb->cdb,iop->cmnd,iop->cmnd_len);
data/smartmontools-7.1/os_linux.cpp:1165: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(iop->sensep, pReply->sense_data, pReply->sense_data_size);
data/smartmontools-7.1/os_linux.cpp:1203: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).
  virtual bool open();
data/smartmontools-7.1/os_linux.cpp:1243: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).
  if (!open())
data/smartmontools-7.1/os_linux.cpp:1251: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 req_buff[64] = {0, };
data/smartmontools-7.1/os_linux.cpp:1279:29:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
bool linux_megaraid_device::open()
data/smartmontools-7.1/os_linux.cpp:1285:30:  [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 (!linux_smart_device::open())
data/smartmontools-7.1/os_linux.cpp:1300: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).
  FILE * fp = fopen("/proc/devices", "r");
data/smartmontools-7.1/os_linux.cpp:1302: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[128];
data/smartmontools-7.1/os_linux.cpp:1324: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 ((m_fd = ::open("/dev/megaraid_sas_ioctl_node", O_RDWR)) >= 0) {
data/smartmontools-7.1/os_linux.cpp:1327: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).
  else if ((m_fd = ::open("/dev/megadev0", O_RDWR)) >= 0) {
data/smartmontools-7.1/os_linux.cpp:1356:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buff[256];
data/smartmontools-7.1/os_linux.cpp:1440: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(pthru->cdb, cdb, cdbLen);
data/smartmontools-7.1/os_linux.cpp:1496: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(uio.pthru.cdb, cdb, cdbLen);
data/smartmontools-7.1/os_linux.cpp:1562: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).
  virtual bool open();
data/smartmontools-7.1/os_linux.cpp:1588: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             majorstring[MAJOR_STRING_LENGTH+1];
data/smartmontools-7.1/os_linux.cpp:1589: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             device_name[DEVICE_STRING_LENGTH+1];
data/smartmontools-7.1/os_linux.cpp:1590: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             nodestring[NODE_STRING_LENGTH];
data/smartmontools-7.1/os_linux.cpp:1602: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).
  if (!(file = fopen("/proc/devices", "r"))) {
data/smartmontools-7.1/os_linux.cpp:1613: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).
      tw_major = atoi(majorstring);
data/smartmontools-7.1/os_linux.cpp:1728:29:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
bool linux_escalade_device::open()
data/smartmontools-7.1/os_linux.cpp:1745:30:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  return linux_smart_device::open();
data/smartmontools-7.1/os_linux.cpp:1791: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 ioctl_buffer[TW_IOCTL_BUFFER_SIZE];
data/smartmontools-7.1/os_linux.cpp:1882:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(tw_ioctl_apache->data_buffer, in.buffer, in.size);
data/smartmontools-7.1/os_linux.cpp:1884:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(tw_ioctl_char->data_buffer,   in.buffer, in.size);
data/smartmontools-7.1/os_linux.cpp:1955:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(in.buffer, tw_ioctl_apache->data_buffer, in.size);
data/smartmontools-7.1/os_linux.cpp:1957:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(in.buffer, tw_ioctl_char->data_buffer, in.size);
data/smartmontools-7.1/os_linux.cpp:1959:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(in.buffer, tw_output->output_data, in.size);
data/smartmontools-7.1/os_linux.cpp:2020:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    FILE *fp=fopen("/proc/scsi/sg/device_hdr", "r");
data/smartmontools-7.1/os_linux.cpp:2027:6:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-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[256];
data/smartmontools-7.1/os_linux.cpp:2044: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("/proc/scsi/sg/devices", "r");
data/smartmontools-7.1/os_linux.cpp:2090: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).
  newdev->open();	// TODO: Can possibly pass open fd
data/smartmontools-7.1/os_linux.cpp:2100: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).
      if(!open()){
data/smartmontools-7.1/os_linux.cpp:2145: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).
      if(!open()){
data/smartmontools-7.1/os_linux.cpp:2196: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 cmd[540];
data/smartmontools-7.1/os_linux.cpp:2313: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(data, buff, 512);
data/smartmontools-7.1/os_linux.cpp:2332: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 m_hpt_data[3]; ///< controller/channel/port
data/smartmontools-7.1/os_linux.cpp:2367: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 hpt_buff[4*sizeof(int) + STRANGE_BUFFER_LENGTH];
data/smartmontools-7.1/os_linux.cpp:2446:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char task[4*sizeof(int)+sizeof(ide_task_request_t)+512];
data/smartmontools-7.1/os_linux.cpp:2472: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(task+sizeof(ide_task_request_t)+4*sizeof(int), data, 512);
data/smartmontools-7.1/os_linux.cpp:2512:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char deviceid[4*sizeof(int)+512*sizeof(char)];
data/smartmontools-7.1/os_linux.cpp:2533: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(data, buff+HDIO_DRIVE_CMD_OFFSET, copydata);
data/smartmontools-7.1/os_linux.cpp:2575: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).
  if (!open())
data/smartmontools-7.1/os_linux.cpp:2590: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 req_buff[64] = {0, };
data/smartmontools-7.1/os_linux.cpp:2641: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).
      newdev->open(); // TODO: Can possibly pass open fd
data/smartmontools-7.1/os_linux.cpp:2675: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).
  virtual bool open();
data/smartmontools-7.1/os_linux.cpp:2688:25:  [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).
bool linux_nvme_device::open()
data/smartmontools-7.1/os_linux.cpp:2690:28:  [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 (!linux_smart_device::open())
data/smartmontools-7.1/os_linux.cpp:2740:14:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE * f = fopen(path.c_str(), "r");
data/smartmontools-7.1/os_linux.cpp:2831:56:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  void get_dev_list(smart_device_list & devlist, const char * pattern,
data/smartmontools-7.1/os_linux.cpp:2864: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 dest[256];
data/smartmontools-7.1/os_linux.cpp:2897: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.
  const char * pattern, bool scan_scsi, bool (* p_dev_sdxy_seen)[devxy_to_n_max+1],
data/smartmontools-7.1/os_linux.cpp:2969: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 line[128];
data/smartmontools-7.1/os_linux.cpp:2971: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).
  FILE * fp = fopen("/proc/devices", "r");
data/smartmontools-7.1/os_linux.cpp:3001: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.
      char sysfsdir[256];
data/smartmontools-7.1/os_linux.cpp:3004: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).
      if((fp = fopen(sysfsdir, "r")) == NULL)
data/smartmontools-7.1/os_linux.cpp:3124:5:  [2] (buffer) bcopy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    bcopy(mbox, dcmd->mbox.w, mboxlen);
data/smartmontools-7.1/os_linux.cpp:3143: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 ((fd = ::open("/dev/megaraid_sas_ioctl_node", O_RDWR)) < 0) {
data/smartmontools-7.1/os_linux.cpp:3192: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[128];
data/smartmontools-7.1/os_linux.cpp:3217: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 path[128];
data/smartmontools-7.1/os_linux.cpp:3235:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  int fd = open(path, O_RDONLY);
data/smartmontools-7.1/os_linux.cpp:3239: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 proc_name[32];
data/smartmontools-7.1/os_linux.h:77: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 padding[12];
data/smartmontools-7.1/os_linux.h:94: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 cdb[16];
data/smartmontools-7.1/os_linux.h:106: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 input_data[499];
data/smartmontools-7.1/os_linux.h:109: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 output_data[512]; // starts 530 bytes in!
data/smartmontools-7.1/os_linux.h:116: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 output_data[512];
data/smartmontools-7.1/os_linux.h:169: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.
      char version[504];
data/smartmontools-7.1/os_linux.h:185: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   cdb[16];
data/smartmontools-7.1/os_linux.h:191: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 sense_data[18];
data/smartmontools-7.1/os_linux.h:193: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 reserved[4];
data/smartmontools-7.1/os_linux.h:201: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 err_specific_desc[102];
data/smartmontools-7.1/os_linux.h:211: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 padding[384]; /* Pad to 1024 bytes */
data/smartmontools-7.1/os_linux.h:216: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                         padding[488];
data/smartmontools-7.1/os_linux.h:218: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                         data_buffer[1];
data/smartmontools-7.1/os_linux.h:266: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.
      char version[504];
data/smartmontools-7.1/os_linux.h:273: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 padding [508];
data/smartmontools-7.1/os_linux.h:275: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          data_buffer[1];
data/smartmontools-7.1/os_netbsd.cpp:59: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).
  virtual bool open();
data/smartmontools-7.1/os_netbsd.cpp:87:27:  [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).
bool netbsd_smart_device::open()
data/smartmontools-7.1/os_netbsd.cpp:93: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).
    fd = ::open(dev,O_RDWR|O_NONBLOCK);
data/smartmontools-7.1/os_netbsd.cpp:95: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).
      fd = ::open(dev,O_RDONLY|O_NONBLOCK);
data/smartmontools-7.1/os_netbsd.cpp:101: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 ((fd = ::open(dev,O_RDWR|O_NONBLOCK))<0) {
data/smartmontools-7.1/os_netbsd.cpp:230: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).
  virtual bool open();
data/smartmontools-7.1/os_netbsd.cpp:243:26:  [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).
bool netbsd_nvme_device::open()
data/smartmontools-7.1/os_netbsd.cpp:277: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 full_path[64];
data/smartmontools-7.1/os_netbsd.cpp:281: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 ((fd = ::open(full_path, O_RDWR))<0) {
data/smartmontools-7.1/os_netbsd.cpp:377: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(sc.cmd, iop->cmnd, iop->cmnd_len);
data/smartmontools-7.1/os_netbsd.cpp:396: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(iop->sensep, sc.sense, sc.senselen_used);
data/smartmontools-7.1/os_netbsd.cpp:429: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).
  if (!open())
data/smartmontools-7.1/os_netbsd.cpp:444: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 req_buff[64] = {0, };
data/smartmontools-7.1/os_netbsd.cpp:627: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 ctrlpath[64], nspath[64];
data/smartmontools-7.1/os_netbsd.cpp:632: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).
  int drvfd = ::open(DRVCTLDEV, O_RDONLY, 0);
data/smartmontools-7.1/os_netbsd.cpp:663: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).
      int nsfd = ::open(nspath, O_RDONLY, 0);
data/smartmontools-7.1/os_openbsd.cpp:154: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).
    int fd = open(pathname, O_RDWR | O_NONBLOCK);
data/smartmontools-7.1/os_openbsd.cpp:156: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).
      fd = open(pathname, O_RDONLY | O_NONBLOCK);
data/smartmontools-7.1/os_openbsd.cpp:159: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).
    return open(pathname, O_RDWR | O_NONBLOCK);
data/smartmontools-7.1/os_openbsd.cpp:174: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 inbuf[DEV_BSIZE];
data/smartmontools-7.1/os_openbsd.cpp:214: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(inbuf, data, 512);
data/smartmontools-7.1/os_openbsd.cpp:309: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[512];
data/smartmontools-7.1/os_openbsd.cpp:344: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(data, inbuf, 512);
data/smartmontools-7.1/os_openbsd.cpp:375: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(sc.cmd, iop->cmnd, iop->cmnd_len);
data/smartmontools-7.1/os_openbsd.cpp:392: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(iop->sensep, sc.sense, sc.senselen_used);
data/smartmontools-7.1/os_os2.cpp:217: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 errmsg[256];
data/smartmontools-7.1/os_os2.cpp:400: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 buff[STRANGE_BUFFER_LENGTH];
data/smartmontools-7.1/os_os2.cpp:522: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(data, buff+HDIO_DRIVE_CMD_OFFSET, copydata);
data/smartmontools-7.1/os_qnxnto.cpp:104: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).
    return(open(pathname,O_RDWR|O_NONBLOCK));
data/smartmontools-7.1/os_solaris.cpp:37: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 *unimplemented[2]={
data/smartmontools-7.1/os_solaris.cpp:91: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 devpath[MAXPATHLEN];
data/smartmontools-7.1/os_solaris.cpp:156:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char pathbuf[MAXPATHLEN];
data/smartmontools-7.1/os_solaris.cpp:238: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).
    return open(pathname, O_RDWR | O_NONBLOCK);
data/smartmontools-7.1/os_solaris.cpp:240: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).
    return open(pathname, O_RDONLY | O_NONBLOCK);
data/smartmontools-7.1/os_win32.cpp:562: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 outbuf[sizeof(SENDCMDOUTPARAMS)-1 + 512];
data/smartmontools-7.1/os_win32.cpp:639: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(data, outpar->bBuffer, 512);
data/smartmontools-7.1/os_win32.cpp:642:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(regs, outpar->bBuffer, sizeof(IDEREGS));
data/smartmontools-7.1/os_win32.cpp:717: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(data, buf->DataBuffer, datasize);
data/smartmontools-7.1/os_win32.cpp:784: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(ab.ucDataBuf, data, -datasize);
data/smartmontools-7.1/os_win32.cpp:834: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(data, ab.ucDataBuf, datasize);
data/smartmontools-7.1/os_win32.cpp:900: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 space[512-1];
data/smartmontools-7.1/os_win32.cpp:919:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(sb.params.in.bBuffer, data, size);
data/smartmontools-7.1/os_win32.cpp:926:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(sb.srbc.Signature, "SCSIDISK", 8); // atapi.sys
data/smartmontools-7.1/os_win32.cpp:976: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(data, sb.params.out.bBuffer, datasize);
data/smartmontools-7.1/os_win32.cpp:978: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(regs, sb.params.out.bBuffer, sizeof(IDEREGS));
data/smartmontools-7.1/os_win32.cpp:1033: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(data, sb.buffer, datasize);
data/smartmontools-7.1/os_win32.cpp:1087: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 raw[256];
data/smartmontools-7.1/os_win32.cpp:1155:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(data, pred.VendorSpecific, sizeof(pred.VendorSpecific));
data/smartmontools-7.1/os_win32.cpp:1171: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 model[sizeof(id->model) + 1] = "";
data/smartmontools-7.1/os_win32.cpp:1420: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).
  virtual bool open();
data/smartmontools-7.1/os_win32.cpp:1429: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).
  bool open(bool query_device);
data/smartmontools-7.1/os_win32.cpp:1431: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).
  bool open(int phydrive, int logdrive, const char * options, int port, bool query_device);
data/smartmontools-7.1/os_win32.cpp:1470: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).
bool win_ata_device::open()
data/smartmontools-7.1/os_win32.cpp:1473: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).
  return open(false);
data/smartmontools-7.1/os_win32.cpp:1476: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).
bool win_ata_device::open(bool query_device)
data/smartmontools-7.1/os_win32.cpp:1480: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 drive[2+1] = "", options[8+1] = ""; int n1 = -1, n2 = -1;
data/smartmontools-7.1/os_win32.cpp:1483: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).
    return open(sdxy_to_phydrive(drive), -1, options, -1, query_device);
data/smartmontools-7.1/os_win32.cpp:1490: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).
    return open(sdxy_to_phydrive(drive), -1, options, port, query_device);
data/smartmontools-7.1/os_win32.cpp:1496: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).
    return open(phydrive, -1, "", (int)port, query_device);
data/smartmontools-7.1/os_win32.cpp:1501: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).
    return open(-1, logdrive, "", -1, query_device);
data/smartmontools-7.1/os_win32.cpp:1508: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).
bool win_ata_device::open(int phydrive, int logdrive, const char * options, int port, bool query_device)
data/smartmontools-7.1/os_win32.cpp:1511: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 devpath[30];
data/smartmontools-7.1/os_win32.cpp:1635: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).
    if (!open(true))
data/smartmontools-7.1/os_win32.cpp:1991:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  typedef signed char port_2_index_map[max_number_of_ports];
data/smartmontools-7.1/os_win32.cpp:2322:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(pthru_buf->bDataBuffer, in.buffer, in.size);
data/smartmontools-7.1/os_win32.cpp:2379: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(in.buffer, pthru_buf->bDataBuffer, in.size);
data/smartmontools-7.1/os_win32.cpp:2397: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).
  virtual bool open();
data/smartmontools-7.1/os_win32.cpp:2455: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 devpath[30];
data/smartmontools-7.1/os_win32.cpp:2482:23:  [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).
bool win_csmi_device::open()
data/smartmontools-7.1/os_win32.cpp:2568: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).
  virtual bool open();
data/smartmontools-7.1/os_win32.cpp:2614:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(data, p, n);
data/smartmontools-7.1/os_win32.cpp:2628:25:  [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).
bool win_tw_cli_device::open()
data/smartmontools-7.1/os_win32.cpp:2633: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 buffer[4096];
data/smartmontools-7.1/os_win32.cpp:2643: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 cmd[100];
data/smartmontools-7.1/os_win32.cpp:2749:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(data, &m_ident_buf, 512);
data/smartmontools-7.1/os_win32.cpp:2754:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(data, &m_smart_buf, 512);
data/smartmontools-7.1/os_win32.cpp:2780: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).
  virtual bool open();
data/smartmontools-7.1/os_win32.cpp:2785: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).
  bool open(int pd_num, int ld_num, int tape_num, int sub_addr);
data/smartmontools-7.1/os_win32.cpp:2797:23:  [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).
bool win_scsi_device::open()
data/smartmontools-7.1/os_win32.cpp:2801: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 drive[2+1] = ""; int sub_addr = -1; int n1 = -1; int n2 = -1;
data/smartmontools-7.1/os_win32.cpp:2804: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).
    return open(sdxy_to_phydrive(drive), -1, -1, sub_addr);
data/smartmontools-7.1/os_win32.cpp:2810: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).
    return open(pd_num, -1, -1, sub_addr);
data/smartmontools-7.1/os_win32.cpp:2815: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).
    return open(-1, logdrive, -1, -1);
data/smartmontools-7.1/os_win32.cpp:2820: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).
    return open(-1, -1, tape_num, -1);
data/smartmontools-7.1/os_win32.cpp:2824: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).
    return open(-1, -1, tape_num, -1);
data/smartmontools-7.1/os_win32.cpp:2829: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).
    return open(-1, -1, tape_num, -1);
data/smartmontools-7.1/os_win32.cpp:2835:23:  [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).
bool win_scsi_device::open(int pd_num, int ld_num, int tape_num, int /*sub_addr*/)
data/smartmontools-7.1/os_win32.cpp:2837: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 b[128];
data/smartmontools-7.1/os_win32.cpp:2911: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(sbd->spt.DataBuffer, sb.ucDataBuf, sb.spt.DataTransferLength);
data/smartmontools-7.1/os_win32.cpp:2925:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buff[256];
data/smartmontools-7.1/os_win32.cpp:2955:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(sb.spt.Cdb, iop->cmnd, iop->cmnd_len);
data/smartmontools-7.1/os_win32.cpp:3008: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(iop->sensep, sb.ucSenseBuf, slen);
data/smartmontools-7.1/os_win32.cpp:3054:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buff[256];
data/smartmontools-7.1/os_win32.cpp:3086:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(sb.spt.Cdb, iop->cmnd, iop->cmnd_len);
data/smartmontools-7.1/os_win32.cpp:3138: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(iop->sensep, sb.ucSenseBuf, slen);
data/smartmontools-7.1/os_win32.cpp:3183: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).
  virtual bool open();
data/smartmontools-7.1/os_win32.cpp:3205:29:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
bool win_areca_scsi_device::open()
data/smartmontools-7.1/os_win32.cpp:3256: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 mutexstr[64];
data/smartmontools-7.1/os_win32.cpp:3297: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).
  virtual bool open();
data/smartmontools-7.1/os_win32.cpp:3319:28:  [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).
bool win_areca_ata_device::open()
data/smartmontools-7.1/os_win32.cpp:3363: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).
  newdev->open(); // TODO: Can possibly pass open fd
data/smartmontools-7.1/os_win32.cpp:3390: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 mutexstr[64];
data/smartmontools-7.1/os_win32.cpp:3434: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).
  virtual bool open();
data/smartmontools-7.1/os_win32.cpp:3465:26:  [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).
bool win_aacraid_device::open()
data/smartmontools-7.1/os_win32.cpp:3492:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buff[256];
data/smartmontools-7.1/os_win32.cpp:3512: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 ioBuffer[1000];
data/smartmontools-7.1/os_win32.cpp:3543: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(pCdb, iop->cmnd, 16);
data/smartmontools-7.1/os_win32.cpp:3548: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(pDataIO, iop->dxferp, iop->dxfer_len);
data/smartmontools-7.1/os_win32.cpp:3557: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(pSrbIO->Signature, "AACAPI", 7);
data/smartmontools-7.1/os_win32.cpp:3582: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(iop->sensep, pRequestSenseIO, slen);
data/smartmontools-7.1/os_win32.cpp:3604: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(iop->dxferp,pDataIO, iop->dxfer_len);
data/smartmontools-7.1/os_win32.cpp:3627: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).
  virtual bool open();
data/smartmontools-7.1/os_win32.cpp:3653: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 devpath[32];
data/smartmontools-7.1/os_win32.cpp:3701:23:  [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).
bool win_nvme_device::open()
data/smartmontools-7.1/os_win32.cpp:3706: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 s[2+1] = ""; int n1 = -1, n2 = -1, len = strlen(name);
data/smartmontools-7.1/os_win32.cpp:3766: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(pthru->SrbIoCtrl.Signature, NVME_SIG_STR, sizeof(NVME_SIG_STR)-1);
data/smartmontools-7.1/os_win32.cpp:3786: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(pthru->DataBuffer, in.buffer, in.size);
data/smartmontools-7.1/os_win32.cpp:3806: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(in.buffer, pthru->DataBuffer, in.size);
data/smartmontools-7.1/os_win32.cpp:3824: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).
  virtual bool open();
data/smartmontools-7.1/os_win32.cpp:3829: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).
  bool open(int phydrive, int logdrive);
data/smartmontools-7.1/os_win32.cpp:3842:25:  [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).
bool win10_nvme_device::open()
data/smartmontools-7.1/os_win32.cpp:3847: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 drive[2 + 1] = ""; int n = -1;
data/smartmontools-7.1/os_win32.cpp:3849: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).
    return open(sdxy_to_phydrive(drive), -1);
data/smartmontools-7.1/os_win32.cpp:3854: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).
    return open(phydrive, -1);
data/smartmontools-7.1/os_win32.cpp:3859: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).
    return open(-1, logdrive);
data/smartmontools-7.1/os_win32.cpp:3864:25:  [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).
bool win10_nvme_device::open(int phydrive, int logdrive)
data/smartmontools-7.1/os_win32.cpp:3867: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 devpath[64];
data/smartmontools-7.1/os_win32.cpp:3953: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(spsq->DataBuffer, in.buffer, in.size);
data/smartmontools-7.1/os_win32.cpp:3983: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(in.buffer, spsq->DataBuffer, in.size);
data/smartmontools-7.1/os_win32.cpp:4050: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 vstr[sizeof(SMARTMONTOOLS_BUILD_HOST)-1+sizeof("-2003r2(64)-sp2.1")+13]
data/smartmontools-7.1/os_win32.cpp:4197: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 devpath[32];
data/smartmontools-7.1/os_win32.cpp:4255: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.
      char subKey[63];
data/smartmontools-7.1/os_win32.cpp:4260:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char driverName[20];
data/smartmontools-7.1/os_win32.cpp:4399: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 path[30];
data/smartmontools-7.1/os_win32.cpp:4412: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 path[30];
data/smartmontools-7.1/os_win32.cpp:4435: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 drive[2+1] = "";
data/smartmontools-7.1/os_win32.cpp:4515: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 type2[16+1] = "";
data/smartmontools-7.1/os_win32.cpp:4561: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[32];
data/smartmontools-7.1/os_win32.cpp:4781: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 path[MAX_PATH];
data/smartmontools-7.1/os_win32/daemon_win32.cpp:52: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(name, "DaemonEvent");
data/smartmontools-7.1/os_win32/daemon_win32.cpp:60: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+strlen(name), "-%d", sig);
data/smartmontools-7.1/os_win32/daemon_win32.cpp:66: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[EVT_NAME_LEN];
data/smartmontools-7.1/os_win32/daemon_win32.cpp:95: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[EVT_NAME_LEN];
data/smartmontools-7.1/os_win32/daemon_win32.cpp:103: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[EVT_NAME_LEN];
data/smartmontools-7.1/os_win32/daemon_win32.cpp:115: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[EVT_NAME_LEN];
data/smartmontools-7.1/os_win32/daemon_win32.cpp:695: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 path[MAX_PATH], *p;
data/smartmontools-7.1/os_win32/daemon_win32.cpp:734:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(buf, prefix, pfxlen);
data/smartmontools-7.1/os_win32/daemon_win32.cpp:735:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(buf+pfxlen, ident, idlen+1);
data/smartmontools-7.1/os_win32/daemon_win32.cpp:744: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 mypath[MAX_PATH];
data/smartmontools-7.1/os_win32/daemon_win32.cpp:750: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 subkey[MAX_PATH];
data/smartmontools-7.1/os_win32/daemon_win32.cpp:783: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 subkey[MAX_PATH];
data/smartmontools-7.1/os_win32/daemon_win32.cpp:830: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 path[MAX_PATH+100];
data/smartmontools-7.1/os_win32/daemon_win32.cpp:854:9:  [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(path, " \""); strcat(path, s); strcat(path, "\"");
data/smartmontools-7.1/os_win32/daemon_win32.cpp:1074:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char inpbuf[200], outbuf[1000]; int rc;
data/smartmontools-7.1/os_win32/daemon_win32.cpp:1075:9:  [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(inpbuf, "Hello\nWorld!\n");
data/smartmontools-7.1/os_win32/popen_win32.cpp:100:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(shellcmd, "cmd /c ", 7);
data/smartmontools-7.1/os_win32/popen_win32.cpp:101: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(shellcmd + 7, command, cmdlen + 1);
data/smartmontools-7.1/os_win32/syslog_win32.cpp:79: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 sl_ident[100];
data/smartmontools-7.1/os_win32/syslog_win32.cpp: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.
static char sl_logpath[sizeof(sl_ident) + sizeof("0.log")-1];
data/smartmontools-7.1/os_win32/syslog_win32.cpp:82: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 sl_pidstr[16];
data/smartmontools-7.1/os_win32/syslog_win32.cpp:91: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 evt_lines[MAXLINES][LINELEN+1];
data/smartmontools-7.1/os_win32/syslog_win32.cpp:138: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 * msgs[3+MAXLINES];
data/smartmontools-7.1/os_win32/syslog_win32.cpp:265:4:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
			memcpy(evt_lines[evt_index_in], lines+i, (len < LINELEN ? len : LINELEN));
data/smartmontools-7.1/os_win32/syslog_win32.cpp:292:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char stamp[32];
data/smartmontools-7.1/os_win32/syslog_win32.cpp:331: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(strcpy(sl_logpath, sl_ident), ".log");
data/smartmontools-7.1/os_win32/syslog_win32.cpp:344: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(strcpy(sl_logpath, sl_ident), ".log");
data/smartmontools-7.1/os_win32/syslog_win32.cpp:364: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[1000];
data/smartmontools-7.1/os_win32/syslog_win32.cpp:372: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(buffer, "Internal Error: buffer overflow");
data/smartmontools-7.1/os_win32/syslog_win32.cpp:386: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 (!(f = fopen(sl_logpath, "a")))
data/smartmontools-7.1/os_win32/syslog_win32.cpp:413: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[LINELEN];
data/smartmontools-7.1/os_win32/syslog_win32.cpp:416: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(buf, "Log Line %d\n", i);
data/smartmontools-7.1/os_win32/wmiquery.cpp:29:12:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
  int sz = MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, str, -1, (LPWSTR)0, 0);
data/smartmontools-7.1/os_win32/wmiquery.cpp:35:3:  [2] (buffer) MultiByteToWideChar:
  Requires maximum length in CHARACTERS, not bytes (CWE-120).
  MultiByteToWideChar(CP_ACP, MB_PRECOMPOSED, str, -1, m_bstr, sz);
data/smartmontools-7.1/os_win32/wmiquery.cpp:146: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 qline[1024];
data/smartmontools-7.1/os_win32/wtssendmsg.c:83: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 msgbuf[1024];
data/smartmontools-7.1/regex/regcomp.c:318: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.
	      unsigned char buf[MB_LEN_MAX];
data/smartmontools-7.1/regex/regcomp.c:401: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[256];
data/smartmontools-7.1/regex/regcomp.c:554:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy (errbuf, msg, cpy_size);
data/smartmontools-7.1/regex/regcomp.c:3180:16:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      unsigned char start_name_buf[BRACKET_NAME_BUF_SIZE];
data/smartmontools-7.1/regex/regcomp.c:3181:16:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      unsigned char end_name_buf[BRACKET_NAME_BUF_SIZE];
data/smartmontools-7.1/regex/regcomp.c:3503:16:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      unsigned char char_buf[2];
data/smartmontools-7.1/regex/regex.h:644:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
		    const char *_Restrict_ __String, size_t __nmatch,
data/smartmontools-7.1/regex/regex_internal.c:213: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[MB_LEN_MAX];
data/smartmontools-7.1/regex/regex_internal.c:216: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[64];
data/smartmontools-7.1/regex/regex_internal.c:285: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[MB_LEN_MAX];
data/smartmontools-7.1/regex/regex_internal.c:288: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[64];
data/smartmontools-7.1/regex/regex_internal.c:329:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		    memcpy (pstr->mbs + byte_idx, buf, mbclen);
data/smartmontools-7.1/regex/regex_internal.c:337: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 (pstr->mbs + byte_idx,
data/smartmontools-7.1/regex/regex_internal.c:398: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 (pstr->mbs + byte_idx, buf, mbclen);
data/smartmontools-7.1/regex/regex_internal.c:423:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
		    memcpy (pstr->mbs + byte_idx, buf, mbcdlen);
data/smartmontools-7.1/regex/regex_internal.c:442: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 (pstr->mbs + byte_idx, p, mbclen);
data/smartmontools-7.1/regex/regex_internal.c:445:8:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	      memcpy (pstr->mbs + byte_idx, p, mbclen);
data/smartmontools-7.1/regex/regex_internal.c:738:15:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
			  unsigned char buf[6];
data/smartmontools-7.1/regex/regex_internal.c:1039:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy (dest->elems, src->elems, src->nelem * sizeof (Idx));
data/smartmontools-7.1/regex/regex_internal.c:1133: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 (dest->elems, dest->elems + sbase, delta * sizeof (Idx));
data/smartmontools-7.1/regex/regex_internal.c:1177:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy (dest->elems + id, src1->elems + i1,
data/smartmontools-7.1/regex/regex_internal.c:1183:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy (dest->elems + id, src2->elems + i2,
data/smartmontools-7.1/regex/regex_internal.c:1214:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy (dest->elems, src->elems, src->nelem * sizeof (Idx));
data/smartmontools-7.1/regex/regex_internal.c:1235:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy (dest->elems + sbase, src->elems, (is + 1) * sizeof (Idx));
data/smartmontools-7.1/regex/regex_internal.c:1263:8:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	      memcpy (dest->elems, dest->elems + sbase,
data/smartmontools-7.1/regex/regex_internal.h:807: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 (dest, src, sizeof (bitset_t));
data/smartmontools-7.1/regex/regexec.c:345: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 (__mempcpy (s, string1, length1), string2, length2);
data/smartmontools-7.1/regex/regexec.c:347:2:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	memcpy (s, string1, length1);
data/smartmontools-7.1/regex/regexec.c:348: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 (s + length1, string2, length2);
data/smartmontools-7.1/regex/regexec.c:1349:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy (fs->stack[num].regs, regs, sizeof (regmatch_t) * nregs);
data/smartmontools-7.1/regex/regexec.c:1361: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 (regs, fs->stack[num].regs, sizeof (regmatch_t) * nregs);
data/smartmontools-7.1/regex/regexec.c:1415: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 (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch);
data/smartmontools-7.1/regex/regexec.c:1523:8:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
	      memcpy (prev_idx_match, pmatch, sizeof (regmatch_t) * nmatch);
data/smartmontools-7.1/regex/regexec.c:1534: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 (pmatch, prev_idx_match, sizeof (regmatch_t) * nmatch);
data/smartmontools-7.1/scsiata.cpp:262:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char cdb[SAT_ATA_PASSTHROUGH_16LEN];
data/smartmontools-7.1/scsiata.cpp:263:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sense[32];
data/smartmontools-7.1/scsiata.cpp:512: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).
  if (!open() || m_mode != sat_auto)
data/smartmontools-7.1/scsiata.cpp:517: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 inqdata[36] = {0, };
data/smartmontools-7.1/scsiata.cpp:643:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char cdb[USBCYPRESS_PASSTHROUGH_LEN];
data/smartmontools-7.1/scsiata.cpp:644:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char sense[32];
data/smartmontools-7.1/scsiata.cpp:805:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        unsigned char ardp[8];
data/smartmontools-7.1/scsiata.cpp:890: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 model[40], serial[20], firm[8];
data/smartmontools-7.1/scsiata.cpp:935: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).
  virtual bool open();
data/smartmontools-7.1/scsiata.cpp:964:25:  [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).
bool usbjmicron_device::open()
data/smartmontools-7.1/scsiata.cpp:967:51:  [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 (!tunnelled_device<ata_device, scsi_device>::open())
data/smartmontools-7.1/scsiata.cpp:972:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char regbuf[1] = {0};
data/smartmontools-7.1/scsiata.cpp:1044: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 cdb[14];
data/smartmontools-7.1/scsiata.cpp:1094:16:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      unsigned char regbuf[16] = {0, };
data/smartmontools-7.1/scsiata.cpp:1115: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 cdb[14];
data/smartmontools-7.1/scsiata.cpp:1226: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 cdb[16];
data/smartmontools-7.1/scsiata.cpp:1252:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char regbuf[16] = {0, };
data/smartmontools-7.1/scsiata.cpp:1329: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 cdb[12];
data/smartmontools-7.1/scsiata.cpp:1407:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char regbuf[8] = {0, };
data/smartmontools-7.1/scsicmds.cpp:52:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char b[0xfc];     /* pre SPC-3 INQUIRY max response size */
data/smartmontools-7.1/scsicmds.cpp:60:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(pages, b + 4, num_valid);
data/smartmontools-7.1/scsicmds.cpp:81:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buff[82];
data/smartmontools-7.1/scsicmds.cpp:1469: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(rout, iecp->raw_curr, SCSI_IECMP_RAW_LEN);
data/smartmontools-7.1/scsicmds.cpp:2133: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 spare_buff[128];
data/smartmontools-7.1/scsicmds.cpp:2377:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char resp[LOG_RESP_SELF_TEST_LEN];
data/smartmontools-7.1/scsicmds.cpp:2428:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char resp[LOG_RESP_SELF_TEST_LEN];
data/smartmontools-7.1/scsicmds.cpp:2771: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[65];
data/smartmontools-7.1/scsicmds.h:367:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char pages[256];
data/smartmontools-7.1/scsinvme.cpp:41: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).
  virtual bool open();
data/smartmontools-7.1/scsinvme.cpp:64:25:  [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).
bool sntjmicron_device::open()
data/smartmontools-7.1/scsinvme.cpp:67:52:  [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 (!tunnelled_device<nvme_device, scsi_device>::open())
data/smartmontools-7.1/scsinvme.cpp:99:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char cdb[SNT_JMICRON_CDB_LEN] = { 0 };
data/smartmontools-7.1/scsinvme.cpp:141:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char cdb[SNT_JMICRON_CDB_LEN] = { 0 };
data/smartmontools-7.1/scsinvme.cpp:182:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char cdb[SNT_JMICRON_CDB_LEN] = { 0 };
data/smartmontools-7.1/scsiprint.cpp:82: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 scsi_vendor[8+1];
data/smartmontools-7.1/scsiprint.cpp:141:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(sup_lpgs, gBuf, LOG_RESP_LEN);
data/smartmontools-7.1/scsiprint.cpp:145:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(sup_lpgs, gBuf, LOG_RESP_LEN);
data/smartmontools-7.1/scsiprint.cpp:167:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(sup_lpgs, gBuf, LOG_RESP_LEN);
data/smartmontools-7.1/scsiprint.cpp:862:26:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            static const char * const pageNames[3] =
data/smartmontools-7.1/scsiprint.cpp:864:26:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            static const char * jpageNames[3] =
data/smartmontools-7.1/scsiprint.cpp:1100:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char buff[32];
data/smartmontools-7.1/scsiprint.cpp:1573: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 s[64];
data/smartmontools-7.1/scsiprint.cpp:1764:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
static const char * peripheral_dt_arr[32] = {
data/smartmontools-7.1/scsiprint.cpp:1868:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char product[16+1], revision[4+1];
data/smartmontools-7.1/scsiprint.cpp:1886:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char sv_arr[8];
data/smartmontools-7.1/scsiprint.cpp:1909:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        unsigned char lb_prov_resp[8];
data/smartmontools-7.1/scsiprint.cpp:1914:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char cap_str[64], si_str[64];
data/smartmontools-7.1/scsiprint.cpp:2064:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char s[256];
data/smartmontools-7.1/scsiprint.cpp:2080:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char serial[256];
data/smartmontools-7.1/scsiprint.cpp:2115: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 timedatetz[DATEANDEPOCHLEN]; dateandtimezoneepoch(timedatetz, now);
data/smartmontools-7.1/scsiprint.cpp:2539:13:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
            char comptime[DATEANDEPOCHLEN];
data/smartmontools-7.1/sg_unaligned.h:72:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 2);
data/smartmontools-7.1/sg_unaligned.h:80:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 4);
data/smartmontools-7.1/sg_unaligned.h:88:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 8);
data/smartmontools-7.1/sg_unaligned.h:96:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &u, 2);
data/smartmontools-7.1/sg_unaligned.h:103:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &u, 4);
data/smartmontools-7.1/sg_unaligned.h:110:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &u, 8);
data/smartmontools-7.1/sg_unaligned.h:117:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 2);
data/smartmontools-7.1/sg_unaligned.h:125:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 4);
data/smartmontools-7.1/sg_unaligned.h:133:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 8);
data/smartmontools-7.1/sg_unaligned.h:139:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &val, 2);
data/smartmontools-7.1/sg_unaligned.h:144:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &val, 4);
data/smartmontools-7.1/sg_unaligned.h:149:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &val, 8);
data/smartmontools-7.1/sg_unaligned.h:164:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 2);
data/smartmontools-7.1/sg_unaligned.h:172:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 4);
data/smartmontools-7.1/sg_unaligned.h:180:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 8);
data/smartmontools-7.1/sg_unaligned.h:188:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &u, 2);
data/smartmontools-7.1/sg_unaligned.h:195:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &u, 4);
data/smartmontools-7.1/sg_unaligned.h:202:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &u, 8);
data/smartmontools-7.1/sg_unaligned.h:209:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 2);
data/smartmontools-7.1/sg_unaligned.h:217:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 4);
data/smartmontools-7.1/sg_unaligned.h:225:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(&u, p, 8);
data/smartmontools-7.1/sg_unaligned.h:231:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &val, 2);
data/smartmontools-7.1/sg_unaligned.h:236:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &val, 4);
data/smartmontools-7.1/sg_unaligned.h:241:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(p, &val, 8);
data/smartmontools-7.1/smartctl.cpp:354: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 extraerror[256];
data/smartmontools-7.1/smartctl.cpp:436:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char s[9+1]; unsigned i = 1;
data/smartmontools-7.1/smartctl.cpp:866:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char s[7+1]; unsigned i = FAILPOWER;
data/smartmontools-7.1/smartctl.cpp:923:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char name[16+1]; unsigned val;
data/smartmontools-7.1/smartctl.cpp:1285: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 buf[1024];
data/smartmontools-7.1/smartd.cpp:255:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char msg[32];
data/smartmontools-7.1/smartd.cpp:265: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 ts[16] = ""; struct tm tmbuf;
data/smartmontools-7.1/smartd.cpp:267:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char msg[64];
data/smartmontools-7.1/smartd.cpp:342: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 m_flags[256];
data/smartmontools-7.1/smartd.cpp:728:13:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    int i = atoi(line+match[m].rm_so);
data/smartmontools-7.1/smartd.cpp:743:13:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    int i = atoi(line+match[m].rm_so);
data/smartmontools-7.1/smartd.cpp:781: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 line[256];
data/smartmontools-7.1/smartd.cpp:896: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.
  const char * pageNames[3] = {"read", "write", "verify"};
data/smartmontools-7.1/smartd.cpp:1157: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 message[512];
data/smartmontools-7.1/smartd.cpp:1171: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 dates[DATEANDEPOCHLEN];
data/smartmontools-7.1/smartd.cpp:1201: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 command[256];
data/smartmontools-7.1/smartd.cpp:1223:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buffer[EBUFLEN];
data/smartmontools-7.1/smartd.cpp:1297:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char msg[256];
data/smartmontools-7.1/smartd.cpp:1317: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[512+EBUFLEN]; // enough space for exec cmd output in MailWarning()
data/smartmontools-7.1/smartd.cpp:1471:12:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  int fd = open("/dev/null", O_RDWR);
data/smartmontools-7.1/smartd.cpp:1934: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 model[40+1], serial[20+1], firmware[8+1];
data/smartmontools-7.1/smartd.cpp:1944: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 wwn[30]; wwn[0] = 0;
data/smartmontools-7.1/smartd.cpp:1951: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 cap[32];
data/smartmontools-7.1/smartd.cpp:2363: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 lu_id[64], serial[256], vendor[40], model[40];
data/smartmontools-7.1/smartd.cpp:2419: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 si_str[64];
data/smartmontools-7.1/smartd.cpp:2647: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 model[40+1], serial[20+1], firmware[8+1];
data/smartmontools-7.1/smartd.cpp:2653: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 nsstr[32] = "", capstr[32] = "";
data/smartmontools-7.1/smartd.cpp:2761: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).
  if (!device->open()) {
data/smartmontools-7.1/smartd.cpp:2905: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.
      char pattern[16];
data/smartmontools-7.1/smartd.cpp:2935: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.
      char datebuf[DATEANDEPOCHLEN]; dateandtimezoneepoch(datebuf, testtime);
data/smartmontools-7.1/smartd.cpp:2956: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 datenow[DATEANDEPOCHLEN], date[DATEANDEPOCHLEN];
data/smartmontools-7.1/smartd.cpp:3234: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[20];
data/smartmontools-7.1/smartd.cpp:4478: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.
      char arg2[16+1]; unsigned val;
data/smartmontools-7.1/smartd.cpp:4698: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 (!f.open(configfile,"r") && (errno!=ENOENT || !configfile_alt.empty())) {
data/smartmontools-7.1/smartd.cpp:4707: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).
    f.open(stdin);
data/smartmontools-7.1/smartd.cpp:4731: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 line[MAXLINELEN+2];
data/smartmontools-7.1/smartd.cpp:4732: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 fullline[MAXCONTLINE+1];
data/smartmontools-7.1/smartd.cpp:4991:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char s[9+1]; unsigned i = 1;
data/smartmontools-7.1/static_assert.h:21:34:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
#define STATIC_ASSERT(x) typedef char static_assertion[(x) ? 1 : -1] \
data/smartmontools-7.1/static_assert.h:24:34:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
#define STATIC_ASSERT(x) typedef char static_assertion[(x) ? 1 : -1]
data/smartmontools-7.1/utility.cpp:152: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[512], *tz;
data/smartmontools-7.1/utility.cpp:156: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(TIMEZONE_FILE, "r");
data/smartmontools-7.1/utility.cpp:310: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 datebuffer[32];
data/smartmontools-7.1/utility.cpp:346: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 tzfixbuf[6+1] = "";
data/smartmontools-7.1/utility.cpp:520: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 errmsg[512];
data/smartmontools-7.1/utility.cpp:635:26:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    if (((const unsigned char *)data)[i])
data/smartmontools-7.1/utility.cpp:679: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 num[64];
data/smartmontools-7.1/utility.cpp:743: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[512];
data/smartmontools-7.1/utility.cpp:819:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char c[sizeof(int) == 4 ? 8 : -1];
data/smartmontools-7.1/utility.h:178: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).
    : m_file(fopen(name, mode)), m_owner(true) { }
data/smartmontools-7.1/utility.h:186: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).
  bool open(const char * name, const char * mode)
data/smartmontools-7.1/utility.h:190: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).
      m_file = fopen(name, mode);
data/smartmontools-7.1/utility.h:195: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).
  void open(FILE * f, bool owner = false)
data/smartmontools-7.1/atacmds.cpp:162: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(opt);
data/smartmontools-7.1/atacmds.cpp:187: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 (fmtname[strlen(fmtname)-1] == '+') {
data/smartmontools-7.1/atacmds.cpp:188: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).
    fmtname[strlen(fmtname)-1] = 0;
data/smartmontools-7.1/atacmds.cpp:200: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).
          && n2 == (int)strlen(fmtname)))
data/smartmontools-7.1/atacmds.cpp:755: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).
  for (i = strlen(in)-1; i >= first && isspace((int)in[i]); i--)
data/smartmontools-7.1/atacmds.cpp:759:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(out, in+first, last-first+1);
data/smartmontools-7.1/dev_areca.cpp:139:50:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  memcpy(sBuf.srbioctl.Signature, ARECA_SIG_STR, strlen(ARECA_SIG_STR));
data/smartmontools-7.1/dev_interface.cpp:420:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    int n1 = -1, n2 = -1, len = strlen(type);
data/smartmontools-7.1/dev_interface.cpp:485: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).
    if (!((n == (int)strlen(type) || c == '+') && phydrive <= 3)) {
data/smartmontools-7.1/dev_jmb39x_raid.cpp:683: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).
  int n1 = -1, n2 = -1, len = strlen(type);
data/smartmontools-7.1/getopt/getopt.c:219: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).
	&& namelen == strlen (p->name))
data/smartmontools-7.1/getopt/getopt.c:306: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).
	  d->__nextchar += strlen (d->__nextchar);
data/smartmontools-7.1/knowndrives.cpp:120: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 len = strlen(src);
data/smartmontools-7.1/knowndrives.cpp:612:12:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  int ch = getc(m_f);
data/smartmontools-7.1/nvmeprint.cpp:50:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      int i = strlen(str);
data/smartmontools-7.1/nvmeprint.cpp:53: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).
      i = strlen(str);
data/smartmontools-7.1/os_freebsd.cpp:465:40:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (!strnstr(dev, NVME_CTRLR_PREFIX, strlen(NVME_CTRLR_PREFIX))) {
data/smartmontools-7.1/os_freebsd.cpp:1883: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).
      if(strncmp(buf,devname,strlen(devname))==0){
data/smartmontools-7.1/os_freebsd.cpp:1990:54:  [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(strncmp(scsinames[i].c_str(), "/dev/pmp", strlen("/dev/pmp")) == 0) {
data/smartmontools-7.1/os_freebsd.cpp:2036: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(!strncmp("/dev/mfid", test_name, strlen("/dev/mfid")))
data/smartmontools-7.1/os_freebsd.cpp:2040: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(!strncmp("/dev/nvme", test_name, strlen("/dev/nvme")))
data/smartmontools-7.1/os_freebsd.cpp:2042: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(!strncmp("/dev/nvd", test_name, strlen("/dev/nvd")))
data/smartmontools-7.1/os_freebsd.cpp:2061: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).
    if (n2 != (int)strlen(type)) {
data/smartmontools-7.1/os_freebsd.cpp:2075:43:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (!strncmp(fbsd_dev_twe_ctrl, name, strlen(fbsd_dev_twe_ctrl))){
data/smartmontools-7.1/os_freebsd.cpp:2091:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    int len = strlen(type);
data/smartmontools-7.1/os_freebsd.cpp:2114: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).
    if (n2 != (int)strlen(type)) {
data/smartmontools-7.1/os_linux.cpp:1609:17:  [1] (buffer) fscanf:
  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.
  while (EOF != fscanf(file, "%3s %32s", majorstring, device_name)) {
data/smartmontools-7.1/os_linux.cpp:3240:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ssize_t n = read(fd, proc_name, sizeof(proc_name) - 1);
data/smartmontools-7.1/os_linux.cpp:3280: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).
    test_name += strlen(dev_prefix);
data/smartmontools-7.1/os_linux.cpp:3363: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).
    if (n2 != (int)strlen(type)) {
data/smartmontools-7.1/os_linux.cpp:3401:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    int len = strlen(type);
data/smartmontools-7.1/os_linux.cpp:3425: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).
    if (n2 != (int)strlen(type)) {
data/smartmontools-7.1/os_netbsd.cpp:246:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (strncmp(dev, NVME_PREFIX, strlen(NVME_PREFIX))) {
data/smartmontools-7.1/os_netbsd.cpp:589: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).
  if (!(mp = (char **) calloc(strlen(disknames) / 2, sizeof(char *)))) {
data/smartmontools-7.1/os_netbsd.cpp:594: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).
    if (strncmp(p, prefix, strlen(prefix))) {
data/smartmontools-7.1/os_netbsd.cpp:597: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).
    mp[n] = (char *)malloc(strlen(net_dev_raw_prefix) + strlen(p) + 2);
data/smartmontools-7.1/os_netbsd.cpp:597:57:  [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).
    mp[n] = (char *)malloc(strlen(net_dev_raw_prefix) + strlen(p) + 2);
data/smartmontools-7.1/os_netbsd.cpp:777: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).
    test_name += strlen(net_dev_raw_prefix);
data/smartmontools-7.1/os_netbsd.cpp:779: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).
    test_name += strlen(net_dev_prefix);
data/smartmontools-7.1/os_netbsd.cpp:783:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (!strncmp(net_dev_ata_disk, test_name, strlen(net_dev_ata_disk)))
data/smartmontools-7.1/os_netbsd.cpp:786: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 (!strncmp(net_dev_scsi_disk, test_name, strlen(net_dev_scsi_disk))) {
data/smartmontools-7.1/os_netbsd.cpp:794: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 (!strncmp(net_dev_scsi_tape, test_name, strlen(net_dev_scsi_tape)))
data/smartmontools-7.1/os_netbsd.cpp:797: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 (!strncmp(net_dev_nvme_ctrl, test_name, strlen(net_dev_nvme_ctrl)))
data/smartmontools-7.1/os_openbsd.cpp:60: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).
  int dev_prefix_len = strlen(net_dev_prefix);
data/smartmontools-7.1/os_openbsd.cpp:62: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).
  if (!dev_name || !(len = strlen(dev_name)))
data/smartmontools-7.1/os_openbsd.cpp:71:44:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (!strncmp(net_dev_ata_disk, dev_name, strlen(net_dev_ata_disk)))
data/smartmontools-7.1/os_openbsd.cpp:74:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (!strncmp(net_dev_scsi_disk, dev_name, strlen(net_dev_scsi_disk)))
data/smartmontools-7.1/os_openbsd.cpp:77:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  if (!strncmp(net_dev_scsi_tape, dev_name, strlen(net_dev_scsi_tape)))
data/smartmontools-7.1/os_openbsd.cpp:107: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).
  if (!(mp = (char **) calloc(strlen(disknames) / 2, sizeof(char *)))) {
data/smartmontools-7.1/os_openbsd.cpp:112: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).
    if (strncmp(p, prefix, strlen(prefix))) {
data/smartmontools-7.1/os_openbsd.cpp:118: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).
    mp[n] = (char *)malloc(strlen(net_dev_prefix) + strlen(p) + 2);
data/smartmontools-7.1/os_openbsd.cpp:118:53:  [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).
    mp[n] = (char *)malloc(strlen(net_dev_prefix) + strlen(p) + 2);
data/smartmontools-7.1/os_os2.cpp:196: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(pathname) > strlen(danispref)
data/smartmontools-7.1/os_os2.cpp:196: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).
  if(strlen(pathname) > strlen(danispref)
data/smartmontools-7.1/os_os2.cpp:197: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).
    && strncmp(pathname, danispref, strlen(danispref)) == 0) {
data/smartmontools-7.1/os_os2.cpp:198: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).
    fd = strtol(pathname + strlen(danispref), NULL, 10) + 0x80;
data/smartmontools-7.1/os_os2.cpp:202: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(pathname) > strlen(ahcipref)
data/smartmontools-7.1/os_os2.cpp:202: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).
  if(strlen(pathname) > strlen(ahcipref)
data/smartmontools-7.1/os_os2.cpp:203:36:  [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).
    && strncmp(pathname, ahcipref, strlen(ahcipref)) == 0) {
data/smartmontools-7.1/os_os2.cpp:204: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).
    fd = strtol(pathname + strlen(ahcipref), NULL, 10);
data/smartmontools-7.1/os_qnxnto.cpp:68: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).
  dev_prefix_len=strlen(net_dev_prefix);
data/smartmontools-7.1/os_qnxnto.cpp:69: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(!dev_name||!(len=strlen(dev_name)))
data/smartmontools-7.1/os_qnxnto.cpp:78:41:  [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(!strncmp(net_dev_ata_disk,dev_name,strlen(net_dev_ata_disk)))
data/smartmontools-7.1/os_solaris.cpp:104: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 l = strlen(table[i]);
data/smartmontools-7.1/os_solaris.cpp:175: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).
                if (strlen(de->d_name) + len >= sizeof (pathbuf))
data/smartmontools-7.1/os_win32.cpp:1001:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
  strncpy((char *)sb.srbc.Signature, "<3ware>", sizeof(sb.srbc.Signature));
data/smartmontools-7.1/os_win32.cpp:1054:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant string.
  strncpy((char *)srbc.Signature, "<3ware>", sizeof(srbc.Signature));
data/smartmontools-7.1/os_win32.cpp:1478:58:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  const char * name = skipdev(get_dev_name()); int len = strlen(name);
data/smartmontools-7.1/os_win32.cpp:2451: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).
        && nc == (int)strlen(name) && contr_no <= 9 && port < 32)  )
data/smartmontools-7.1/os_win32.cpp:2516:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy((char *)csmi_buffer->Signature, sig, sizeof(csmi_buffer->Signature));
data/smartmontools-7.1/os_win32.cpp:2624: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).
  return (s ? s+strlen(sub) : "");
data/smartmontools-7.1/os_win32.cpp:2641:78:  [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 (sscanf(name, "tw_cli/%nc%*u/p%*u%n", &n1, &n2) >= 0 && n2 == (int)strlen(name)) {
data/smartmontools-7.1/os_win32.cpp:2799:58:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  const char * name = skipdev(get_dev_name()); int len = strlen(name);
data/smartmontools-7.1/os_win32.cpp:3706: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).
    char s[2+1] = ""; int n1 = -1, n2 = -1, len = strlen(name);
data/smartmontools-7.1/os_win32.cpp:3845:58:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  const char * name = skipdev(get_dev_name()); int len = strlen(name);
data/smartmontools-7.1/os_win32.cpp:4056: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).
  assert(vptr == vstr+strlen(vstr) && vptr+vlen+1 == vstr+sizeof(vstr));
data/smartmontools-7.1/os_win32.cpp:4213:72:  [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 (sscanf(name, "arcmsr%d%n", &ctlrindex, &n1) >= 1 && n1 == (int)strlen(name)) {
data/smartmontools-7.1/os_win32.cpp:4241: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).
      && n1 == (int)strlen(type)) {
data/smartmontools-7.1/os_win32.cpp:4312:67:  [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 (!(!strnicmp(vendor, "Intel", 5) && strspn(vendor+5, " ") == strlen(vendor+5)))
data/smartmontools-7.1/os_win32.cpp:4523: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).
             nc == (int)strlen(type)) {
data/smartmontools-7.1/os_win32.cpp:4594: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).
            int len = strlen(name);
data/smartmontools-7.1/os_win32/daemon_win32.cpp:60: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).
  sprintf(name+strlen(name), "-%d", sig);
data/smartmontools-7.1/os_win32/daemon_win32.cpp:729: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).
  unsigned idlen = strlen(ident);
data/smartmontools-7.1/os_win32/daemon_win32.cpp:763: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).
                       (const BYTE *)mypath, strlen(mypath)+1);
data/smartmontools-7.1/os_win32/daemon_win32.cpp:840: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).
      i = strlen(path);
data/smartmontools-7.1/os_win32/daemon_win32.cpp:847:5:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
    strcat(path, " "); strcat(path, svc_opts->cmd_opt);
data/smartmontools-7.1/os_win32/daemon_win32.cpp:850: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).
      if (strlen(path)+1+1+strlen(s)+1 >= sizeof(path))
data/smartmontools-7.1/os_win32/daemon_win32.cpp:850: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).
      if (strlen(path)+1+1+strlen(s)+1 >= sizeof(path))
data/smartmontools-7.1/os_win32/daemon_win32.cpp:854:47:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
        strcat(path, " \""); strcat(path, s); strcat(path, "\"");
data/smartmontools-7.1/os_win32/daemon_win32.cpp:857:9:  [1] (buffer) strcat:
  Does not check for buffer overflows when concatenating to destination
  [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or
  snprintf (warning: strncat is easily misused). Risk is low because the
  source is a constant character.
        strcat(path, " "); strcat(path, s);
data/smartmontools-7.1/os_win32/daemon_win32.cpp:1076:40:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        rc = daemon_spawn(cmd, inpbuf, strlen(inpbuf), outbuf, sizeof(outbuf));
data/smartmontools-7.1/os_win32/popen_win32.cpp:92:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  int cmdlen = strlen(command);
data/smartmontools-7.1/os_win32/runcmd.c:71:19:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  while (!((key = getc(stdin)) == EOF || key == '\n' || key == '\r'))
data/smartmontools-7.1/os_win32/syslog_win32.cpp:323:2:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
	strncpy(sl_ident, ident, sizeof(sl_ident)-1);
data/smartmontools-7.1/os_win32/syslog_win32.cpp:328:3:  [1] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused). Risk is low because the source is a constant character.
		strcpy(sl_pidstr,"?");
data/smartmontools-7.1/os_win32/wtssendmsg.c:143:43:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                         (char *)caption, strlen(caption),
data/smartmontools-7.1/os_win32/wtssendmsg.c:144:43:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                         (char *)message, strlen(message),
data/smartmontools-7.1/regex/regcomp.c:497:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  ret = re_compile_internal (preg, pattern, strlen (pattern), syntax);
data/smartmontools-7.1/regex/regcomp.c:544: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).
  msg_size = strlen (msg) + 1; /* Includes the null.  */
data/smartmontools-7.1/regex/regcomp.c:716: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).
  ret = re_compile_internal (&re_comp_buf, s, strlen (s), re_syntax_options);
data/smartmontools-7.1/regex/regcomp.c:784:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy (dfa->re_str, pattern, length + 1);
data/smartmontools-7.1/regex/regcomp.c:2731: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).
	   && strlen ((char *) start_elem->opr.name) > 1)
data/smartmontools-7.1/regex/regcomp.c:2733: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).
	      && strlen ((char *) end_elem->opr.name) > 1), 0))
data/smartmontools-7.1/regex/regcomp.c:2839: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 name_len = strlen ((const char *) name);
data/smartmontools-7.1/regex/regcomp.c:2920: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).
	  size_t sym_name_len = strlen ((char *) br_elem->opr.name);
data/smartmontools-7.1/regex/regcomp.c:3051: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).
      size_t name_len = strlen ((const char *) name);
data/smartmontools-7.1/regex/regcomp.c:3561: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 (BE (strlen ((const char *) name) != 1, 0))
data/smartmontools-7.1/regex/regexec.c:210: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).
      length = strlen (string);
data/smartmontools-7.1/scsiata.cpp:904: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).
            strlen(model) > 8 && strncmp(product, model+8, strlen(model)-8))
data/smartmontools-7.1/scsiata.cpp:904:60:  [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).
            strlen(model) > 8 && strncmp(product, model+8, strlen(model)-8))
data/smartmontools-7.1/scsiata.cpp:1463:66:  [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 (*t && !(sscanf(t, ",%d%n", &ptlen, &n) == 1 && n == (int)strlen(t)
data/smartmontools-7.1/scsiata.cpp:1477:90:  [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 (!(((sscanf(type, "usbcypress%n,0x%x%n", &n1, &signature, &n2) == 1 && n2 == (int)strlen(type)) || n1 == (int)strlen(type))
data/smartmontools-7.1/scsiata.cpp:1477:118:  [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 (!(((sscanf(type, "usbcypress%n,0x%x%n", &n1, &signature, &n2) == 1 && n2 == (int)strlen(type)) || n1 == (int)strlen(type))
data/smartmontools-7.1/scsiata.cpp:1500: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).
                && n == (int)strlen(t) && 0 <= port && port <= 1))) {
data/smartmontools-7.1/scsicmds.cpp:2146:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(rp) > 0)
data/smartmontools-7.1/scsicmds.cpp:2155:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(rp) > 0)
data/smartmontools-7.1/scsicmds.cpp:2773:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(tmp, (const char *)in, n);
data/smartmontools-7.1/scsicmds.cpp:2792: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).
  for (i = strlen(tmp)-1; i >= first && isspace((int)tmp[i]); i--);
data/smartmontools-7.1/scsicmds.cpp:2795:3:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
  strncpy(out, tmp+first, last-first+1);
data/smartmontools-7.1/scsinvme.cpp:242:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    int n1 = -1, n2 = -1, len = strlen(type);
data/smartmontools-7.1/scsiprint.cpp:96: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).
                         strlen(T10_VENDOR_SEAGATE))) ||
data/smartmontools-7.1/scsiprint.cpp:98: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).
                         strlen(T10_VENDOR_HITACHI_1))) ||
data/smartmontools-7.1/scsiprint.cpp:100: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).
                         strlen(T10_VENDOR_HITACHI_2))) ||
data/smartmontools-7.1/scsiprint.cpp:102: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).
                         strlen(T10_VENDOR_HITACHI_3))));
data/smartmontools-7.1/scsiprint.cpp:2068:17:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            if (strlen(s) > 0)
data/smartmontools-7.1/smartctl.cpp:435: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 n1 = -1, n2 = -1, len = strlen(optarg);
data/smartmontools-7.1/smartctl.cpp:509: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 n1 = -1, n2 = -1, len = strlen(optarg);
data/smartmontools-7.1/smartctl.cpp:552:60:  [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 interval = 0; int n1 = -1, n2 = -1, len = strlen(optarg);
data/smartmontools-7.1/smartctl.cpp:562: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 n1 = -1, n2 = -1, len = strlen(optarg);
data/smartmontools-7.1/smartctl.cpp:577: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 n1 = -1, n2 = -1, len = strlen(optarg);
data/smartmontools-7.1/smartctl.cpp:588: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 n1 = -1, n2 = -1, len = strlen(optarg);
data/smartmontools-7.1/smartctl.cpp:603: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 n1 = -1, n2 = -1, len = strlen(optarg);
data/smartmontools-7.1/smartctl.cpp:620: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 (n == (int)strlen(optarg) && rt <= 999 && wt <= 999) {
data/smartmontools-7.1/smartctl.cpp:632: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).
        int n1 = -1, n2 = -1, n3 = -1, len = strlen(optarg);
data/smartmontools-7.1/smartctl.cpp:661: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).
        int n = -1, len = strlen(optarg);
data/smartmontools-7.1/smartctl.cpp:795:45:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      } else if (!strncmp(optarg,"pending,",strlen("pending,"))) {
data/smartmontools-7.1/smartctl.cpp:800: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).
	i=(int)strtol(optarg+strlen("pending,"), &tailptr, 10);
data/smartmontools-7.1/smartctl.cpp:810:43:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      } else if (!strncmp(optarg,"select",strlen("select"))) {
data/smartmontools-7.1/smartctl.cpp:841: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).
              && subcmd <= 0xff && n == (int)strlen(optarg))) {
data/smartmontools-7.1/smartctl.cpp:865: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 n1 = -1, n2 = -1, len = strlen(optarg);
data/smartmontools-7.1/smartctl.cpp:924: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).
        int n1 = -1, n2 = -1, n3 = -1, len = strlen(optarg);
data/smartmontools-7.1/smartctl.cpp:933: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).
            int len2 = strlen(optarg + n2);
data/smartmontools-7.1/smartctl.cpp:936: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).
            if (tmp && (strlen(tmp) == 2)) {
data/smartmontools-7.1/smartctl.cpp:938: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).
              len2 = strlen(optarg+n2) - 2;
data/smartmontools-7.1/smartd.cpp:1065: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 size = strlen(name) + 1 + strlen(value) + 1;
data/smartmontools-7.1/smartd.cpp:1065:33:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  int size = strlen(name) + 1 + strlen(value) + 1;
data/smartmontools-7.1/smartd.cpp:1476:3:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
  umask(0022);
data/smartmontools-7.1/smartd.cpp:1505:17:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    old_umask = umask(0077); // rwx------
data/smartmontools-7.1/smartd.cpp:1508:17:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    old_umask = umask(0033); // rwxr--r--
data/smartmontools-7.1/smartd.cpp:1512:5:  [1] (access) umask:
  Ensure that umask is given most restrictive possible setting (e.g., 066 or
  077) (CWE-732).
    umask(old_umask);
data/smartmontools-7.1/smartd.cpp:2332:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    std::replace_if(model, model+strlen(model), not_allowed_in_filename, '_');
data/smartmontools-7.1/smartd.cpp:2333:36:  [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).
    std::replace_if(serial, serial+strlen(serial), not_allowed_in_filename, '_');
data/smartmontools-7.1/smartd.cpp:2586:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    std::replace_if(model, model+strlen(model), not_allowed_in_filename, '_');
data/smartmontools-7.1/smartd.cpp:2587:36:  [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).
    std::replace_if(serial, serial+strlen(serial), not_allowed_in_filename, '_');
data/smartmontools-7.1/smartd.cpp:2711:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    std::replace_if(model, model+strlen(model), not_allowed_in_filename, '_');
data/smartmontools-7.1/smartd.cpp:2712:36:  [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).
    std::replace_if(serial, serial+strlen(serial), not_allowed_in_filename, '_');
data/smartmontools-7.1/smartd.cpp:4040: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).
      endptr += strlen(suffix);
data/smartmontools-7.1/smartd.cpp:4068: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(arg);
data/smartmontools-7.1/smartd.cpp:4096:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    int len = strlen(t);
data/smartmontools-7.1/smartd.cpp:4127: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).
  if (*token!='-' || strlen(token)!=2) {
data/smartmontools-7.1/smartd.cpp:4247:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        if (nc == (int)strlen(arg) && rt <= 999 && wt <= 999) {
data/smartmontools-7.1/smartd.cpp:4479:44:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      int n1 = -1, n2 = -1, n3 = -1, len = strlen(arg);
data/smartmontools-7.1/smartd.cpp:4766: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/smartmontools-7.1/smartd.cpp:4781:11:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
      len=strlen(line);
data/smartmontools-7.1/smartd.cpp:4990: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 n1 = -1, n2 = -1, len = strlen(optarg);
data/smartmontools-7.1/utility.cpp:161: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).
    n = strlen(buf) - 1;
data/smartmontools-7.1/utility.cpp:323:15:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  int lenm1 = strlen(datebuffer) - 1;
data/smartmontools-7.1/utility.cpp:550:54:  [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).
          && range.rm_so == 0 && range.rm_eo == (int)strlen(str));
data/smartmontools-7.1/utility.cpp:681:16:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  int numlen = strlen(num);
data/smartmontools-7.1/utility.cpp:854:10:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  return strlen(buf); // Note: cannot detect for overflow, not necessary here.
data/smartmontools-7.1/utility.h:53:34:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  { return !strncmp(str, prefix, strlen(prefix)); }
data/smartmontools-7.1/utility.h:56:42:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
  { return !strncmp(str.c_str(), prefix, strlen(prefix)); }

ANALYSIS SUMMARY:

Hits = 922
Lines analyzed = 74627 in approximately 1.82 seconds (41011 lines/second)
Physical Source Lines of Code (SLOC) = 56452
Hits@level = [0] 445 [1] 172 [2] 665 [3]  23 [4]  61 [5]   1
Hits@level+ = [0+] 1367 [1+] 922 [2+] 750 [3+]  85 [4+]  62 [5+]   1
Hits/KSLOC@level+ = [0+] 24.2153 [1+] 16.3325 [2+] 13.2856 [3+] 1.5057 [4+] 1.09828 [5+] 0.0177142
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.