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/ambdec-0.7.1/source/radbut.h
Examining data/ambdec-0.7.1/source/filewin.cc
Examining data/ambdec-0.7.1/source/filewin.h
Examining data/ambdec-0.7.1/source/radbut.cc
Examining data/ambdec-0.7.1/source/jclient.h
Examining data/ambdec-0.7.1/source/jclient.cc
Examining data/ambdec-0.7.1/source/decoder.h
Examining data/ambdec-0.7.1/source/sstring.cc
Examining data/ambdec-0.7.1/source/global.h
Examining data/ambdec-0.7.1/source/decoder.cc
Examining data/ambdec-0.7.1/source/ambdec_cli.cc
Examining data/ambdec-0.7.1/source/mainwin.cc
Examining data/ambdec-0.7.1/source/xover2.cc
Examining data/ambdec-0.7.1/source/styles.h
Examining data/ambdec-0.7.1/source/meter.cc
Examining data/ambdec-0.7.1/source/adconf.h
Examining data/ambdec-0.7.1/source/png2img.h
Examining data/ambdec-0.7.1/source/meter.h
Examining data/ambdec-0.7.1/source/mainwin.h
Examining data/ambdec-0.7.1/source/sstring.h
Examining data/ambdec-0.7.1/source/confwin.cc
Examining data/ambdec-0.7.1/source/confwin.h
Examining data/ambdec-0.7.1/source/nffilt.cc
Examining data/ambdec-0.7.1/source/styles.cc
Examining data/ambdec-0.7.1/source/xover2.h
Examining data/ambdec-0.7.1/source/png2img.cc
Examining data/ambdec-0.7.1/source/adconf.cc
Examining data/ambdec-0.7.1/source/ambdec.cc
Examining data/ambdec-0.7.1/source/nffilt.h

FINAL RESULTS:

data/ambdec-0.7.1/source/adconf.cc:256:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy (_fname, file);
data/ambdec-0.7.1/source/adconf.cc:376:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy (_fname, file);
data/ambdec-0.7.1/source/adconf.cc:426:6:  [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 (_descr, q);
data/ambdec-0.7.1/source/adconf.cc:506:10:  [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 (sscanf (q, "%s%n", s1, &n) != 1) stat = ARGS;
data/ambdec-0.7.1/source/adconf.cc:522:10:  [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 (sscanf (q, "%s%n", s1, &n) != 1) stat = ARGS;
data/ambdec-0.7.1/source/adconf.cc:538:10:  [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 (sscanf (q, "%s%n", s1, &n) != 1) stat = ARGS;
data/ambdec-0.7.1/source/adconf.cc:552:10:  [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 (sscanf (q, "%s%n", s1, &n) != 1) stat = ARGS;
data/ambdec-0.7.1/source/adconf.cc:565:10:  [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 (sscanf (q, "%s%n", s1, &n) != 1) stat = ARGS;
data/ambdec-0.7.1/source/adconf.cc:625:7:  [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.
		r = sscanf (q, "%s%f%f%f%n", s1, &f1, &f2, &f3, &n);
data/ambdec-0.7.1/source/adconf.cc:650:7:  [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 (S->_label, s1);
data/ambdec-0.7.1/source/adconf.cc:896:42:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    for (int i = 0; i < _dec.nspkr; i++) sprintf (_speakers [i]._jackp, "%s_%d", jackp, i + 1);
data/ambdec-0.7.1/source/confwin.cc:319:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy (C->_descr, _t_comm->text ());
data/ambdec-0.7.1/source/filewin.cc:88:5:  [4] (buffer) strcpy:
  Does not check for buffer overflows when copying to destination [MS-banned]
  (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy
  easily misused).
    strcpy (_pres, xres->get (".presets", "."));
data/ambdec-0.7.1/source/filewin.cc:144:32:  [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).
	    if (S->state & ShiftMask) strcpy (_pres, _wdir);
data/ambdec-0.7.1/source/filewin.cc:332:5:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    sscanf (_tfname->text (), "%s", s);
data/ambdec-0.7.1/source/filewin.cc:352:5:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    sscanf (_tfname->text (), "%s", s);
data/ambdec-0.7.1/source/filewin.cc:365:5:  [4] (buffer) sscanf:
  The scanf() family's %s operation, without a limit specification, permits
  buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a
  different input function.
    sscanf (_tfname->text (), "%s", s);
data/ambdec-0.7.1/source/mainwin.cc:46:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf (s, "%s - %s  [%s]", PROGNAME, VERSION, jclient->jname ());
data/ambdec-0.7.1/source/filewin.cc:89:13:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
    _home = getenv ("HOME");
data/ambdec-0.7.1/source/adconf.cc:258:13:  [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.
    if (!p) strcat (_fname, ".ambdec");
data/ambdec-0.7.1/source/adconf.cc:259: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 (! (F = fopen (_fname, "w"))) 
data/ambdec-0.7.1/source/adconf.cc:370: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 [1024];
data/ambdec-0.7.1/source/adconf.cc:374: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          s1 [64];
data/ambdec-0.7.1/source/adconf.cc:378:13:  [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.
    if (!p) strcat (_fname, ".ambdec");
data/ambdec-0.7.1/source/adconf.cc:379: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 (! (F = fopen (_fname, "r"))) 
data/ambdec-0.7.1/source/adconf.cc:890:42:  [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.
    for (int i = 0; i < _dec.nspkr; i++) sprintf (_speakers [i]._label, "%d", i + 1);
data/ambdec-0.7.1/source/adconf.h:66: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    _label [4];
data/ambdec-0.7.1/source/adconf.h:67: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    _jackp [64];
data/ambdec-0.7.1/source/adconf.h:101: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           _fname [1024];
data/ambdec-0.7.1/source/adconf.h:102: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           _descr [128];
data/ambdec-0.7.1/source/ambdec.cc:33: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.
#define CP (char *)
data/ambdec-0.7.1/source/confwin.cc:31: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 *_r_scale_text [3] = { "N3D", "SN3D", "Furse-Malham" };
data/ambdec-0.7.1/source/confwin.cc:32: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 *_r_delcm_text [1] = { "Delay comp." };
data/ambdec-0.7.1/source/confwin.cc:33: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 *_r_levcm_text [1] = { "Gain comp."  };
data/ambdec-0.7.1/source/confwin.cc:34: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 *_r_nfecm_text [3] = { "None", "On inputs", "On outputs" };
data/ambdec-0.7.1/source/confwin.cc:35: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 *_chan_label [16] = { "W", "Y", "Z", "X", "V", "T", "R", "S", "U",
data/ambdec-0.7.1/source/confwin.cc:153: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).
void Confwin::open (AD_conf *C)
data/ambdec-0.7.1/source/confwin.cc:287: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 [16];
data/ambdec-0.7.1/source/confwin.cc:294:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf (s, "%4.0lf", C->_opt.xfreq);
data/ambdec-0.7.1/source/confwin.cc:297:5:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
    sprintf (s, "%4.1lf", C->_opt.ratio);
data/ambdec-0.7.1/source/confwin.h:39: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).
    void open (AD_conf *C);
data/ambdec-0.7.1/source/decoder.cc:457: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 (p3, p2, n1 * sizeof (float));
data/ambdec-0.7.1/source/decoder.cc:460: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 (p3, p2, n2 * sizeof (float));
data/ambdec-0.7.1/source/filewin.cc:328: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/ambdec-0.7.1/source/filewin.cc:349: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/ambdec-0.7.1/source/filewin.cc:361: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/ambdec-0.7.1/source/filewin.h:75: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         _fext [64];
data/ambdec-0.7.1/source/filewin.h:76: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         _cdir [1024];
data/ambdec-0.7.1/source/filewin.h:77: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         _wdir [1024];
data/ambdec-0.7.1/source/filewin.h:78: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         _pres [1024];
data/ambdec-0.7.1/source/jclient.cc:55: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 [16];
data/ambdec-0.7.1/source/jclient.cc:202: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/ambdec-0.7.1/source/jclient.cc: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 s [64];
data/ambdec-0.7.1/source/jclient.cc:244: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 [256];
data/ambdec-0.7.1/source/mainwin.cc:38: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 [1024];
data/ambdec-0.7.1/source/mainwin.cc:65: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).
	_nout = atoi (p);
data/ambdec-0.7.1/source/mainwin.cc:240: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).
    _confwin->open (C);
data/ambdec-0.7.1/source/mainwin.cc:285: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/ambdec-0.7.1/source/mainwin.cc:306:2:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
	sprintf (s, "%d", i + 1);
data/ambdec-0.7.1/source/meter.cc:73: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 [1024];
data/ambdec-0.7.1/source/png2img.cc:39:9:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    F = fopen (file, "r");
data/ambdec-0.7.1/source/adconf.cc:425: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).
	    q [strlen (q) - 1] = 0;
data/ambdec-0.7.1/source/adconf.cc:628: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).
		else if (strlen (s1) > 3)
data/ambdec-0.7.1/source/filewin.cc:246:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy (_fext, fext, 64);
data/ambdec-0.7.1/source/filewin.cc:269: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 (fext) ke = strlen (fext); 
data/ambdec-0.7.1/source/filewin.cc:292: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).
        kn = strlen (E->d_name);

ANALYSIS SUMMARY:

Hits = 66
Lines analyzed = 5283 in approximately 0.16 seconds (33995 lines/second)
Physical Source Lines of Code (SLOC) = 3888
Hits@level = [0] 111 [1]   5 [2]  42 [3]   1 [4]  18 [5]   0
Hits@level+ = [0+] 177 [1+]  66 [2+]  61 [3+]  19 [4+]  18 [5+]   0
Hits/KSLOC@level+ = [0+] 45.5247 [1+] 16.9753 [2+] 15.6893 [3+] 4.88683 [4+] 4.62963 [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.