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/wdq2wav-1.0.0/wdq2wav.h
Examining data/wdq2wav-1.0.0/wdq2wav.cpp
Examining data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.h
Examining data/wdq2wav-1.0.0/msvc/wdq2wav/getopt1.c
Examining data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c

FINAL RESULTS:

data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:224:9:  [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.
#ifndef getenv
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:225:14:  [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.
extern char *getenv ();
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:417:21:  [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.
  posixly_correct = getenv ("POSIXLY_CORRECT");
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:987:1:  [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 (argc, argv, optstring)
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:1018: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/wdq2wav-1.0.0/msvc/wdq2wav/getopt.h:138: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/wdq2wav-1.0.0/msvc/wdq2wav/getopt.h:144: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 *const *argv, const char *shortopts,
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.h:157: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 ();
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.h:159: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 *const *argv, const char *shortopts,
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt1.c:67: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 (argc, argv, options, long_options, opt_index)
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt1.c:123: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/wdq2wav-1.0.0/wdq2wav.cpp:136:15:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
  while ((c = getopt (argc, argv, "rqvzmndph")) != -1) {
data/wdq2wav-1.0.0/wdq2wav.cpp:39:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
#define open _open
data/wdq2wav-1.0.0/wdq2wav.cpp:177: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 wdq_fname[MAX_INPUT_STR];
data/wdq2wav-1.0.0/wdq2wav.cpp:185: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 channel_buf [MAX_INPUT_STR];
data/wdq2wav-1.0.0/wdq2wav.cpp:203: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 wav_fname[MAX_INPUT_STR];
data/wdq2wav-1.0.0/wdq2wav.cpp:381: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 p[8];
data/wdq2wav-1.0.0/wdq2wav.cpp:403: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 ((m_fd = open (m_strFile.c_str(), O_RDONLY | O_BINARY)) < 0) {
data/wdq2wav-1.0.0/wdq2wav.cpp:581: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 units[7];
data/wdq2wav-1.0.0/wdq2wav.cpp:786: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 (m_strFile.c_str(), O_WRONLY | O_BINARY | O_TRUNC | O_CREAT, g_fileMode)) == 0) {
data/wdq2wav-1.0.0/wdq2wav.cpp:822: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 ("/dev/dsp",O_WRONLY)) == -1) {
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:247: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).
# if (!defined __STDC__ || !__STDC__) && !defined strlen
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:250: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).
extern int strlen (const char *);
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:448: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).
              int len = nonoption_flags_max_len = strlen (orig_str);
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:673:35:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
                == (unsigned int) strlen (p->name))
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:697: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).
          nextchar += strlen (nextchar);
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:729: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).
                  nextchar += strlen (nextchar);
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:745: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).
                  nextchar += strlen (nextchar);
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:750: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).
          nextchar += strlen (nextchar);
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:861: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).
              if ((unsigned int) (nameend - nextchar) == strlen (p->name))
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:884: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).
            nextchar += strlen (nextchar);
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:904: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).
                    nextchar += strlen (nextchar);
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:918: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).
                    nextchar += strlen (nextchar);
data/wdq2wav-1.0.0/msvc/wdq2wav/getopt.c:922: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).
            nextchar += strlen (nextchar);
data/wdq2wav-1.0.0/wdq2wav.cpp:40:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
#define read _read
data/wdq2wav-1.0.0/wdq2wav.cpp:96: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(str) - 1; i >= 0; i--)
data/wdq2wav-1.0.0/wdq2wav.cpp:179:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy (wdq_fname, argv [0], MAX_INPUT_STR);
data/wdq2wav-1.0.0/wdq2wav.cpp:187:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy (channel_buf, argv[1], MAX_INPUT_STR);
data/wdq2wav-1.0.0/wdq2wav.cpp:206:7:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
      strncpy (wav_fname, argv[2], MAX_INPUT_STR);
data/wdq2wav-1.0.0/wdq2wav.cpp:344:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (read (fd, &tmp1, 1) != 1)
data/wdq2wav-1.0.0/wdq2wav.cpp:355:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (read (fd, &tmp1, 1) != 1)
data/wdq2wav-1.0.0/wdq2wav.cpp:358:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (read (fd, &tmp1, 1) != 1)
data/wdq2wav-1.0.0/wdq2wav.cpp:382:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (read (fd, p, 8) != 8)
data/wdq2wav-1.0.0/wdq2wav.cpp:583:7:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if (read (fd, units, 6) != 6) {
data/wdq2wav-1.0.0/wdq2wav.cpp:600:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read (fd, sample_row, row_bytes) != row_bytes) {
data/wdq2wav-1.0.0/wdq2wav.cpp:744: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 (pData, "RIFF", 4);
data/wdq2wav-1.0.0/wdq2wav.cpp:749: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 (pData + 8, "WAVEfmt ", 8);
data/wdq2wav-1.0.0/wdq2wav.cpp:772: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 (pData + 36, "data", 4);

ANALYSIS SUMMARY:

Hits = 48
Lines analyzed = 2459 in approximately 0.08 seconds (31467 lines/second)
Physical Source Lines of Code (SLOC) = 1641
Hits@level = [0]  35 [1]  27 [2]   9 [3]  12 [4]   0 [5]   0
Hits@level+ = [0+]  83 [1+]  48 [2+]  21 [3+]  12 [4+]   0 [5+]   0
Hits/KSLOC@level+ = [0+] 50.5789 [1+] 29.2505 [2+] 12.7971 [3+] 7.31261 [4+]   0 [5+]   0
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.