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/rubberband-1.9.0/ladspa/RubberBandPitchShifter.cpp
Examining data/rubberband-1.9.0/ladspa/RubberBandPitchShifter.h
Examining data/rubberband-1.9.0/ladspa/libmain.cpp
Examining data/rubberband-1.9.0/main/main.cpp
Examining data/rubberband-1.9.0/rubberband-dll/dllmain.cpp
Examining data/rubberband-1.9.0/rubberband-dll/rubberband-dll.cpp
Examining data/rubberband-1.9.0/rubberband-dll/stdafx.cpp
Examining data/rubberband-1.9.0/rubberband-dll/stdafx.h
Examining data/rubberband-1.9.0/rubberband-dll/targetver.h
Examining data/rubberband-1.9.0/rubberband/RubberBandStretcher.h
Examining data/rubberband-1.9.0/rubberband/rubberband-c.h
Examining data/rubberband-1.9.0/src/RubberBandStretcher.cpp
Examining data/rubberband-1.9.0/src/StretchCalculator.cpp
Examining data/rubberband-1.9.0/src/StretchCalculator.h
Examining data/rubberband-1.9.0/src/StretcherChannelData.cpp
Examining data/rubberband-1.9.0/src/StretcherChannelData.h
Examining data/rubberband-1.9.0/src/StretcherImpl.cpp
Examining data/rubberband-1.9.0/src/StretcherImpl.h
Examining data/rubberband-1.9.0/src/StretcherProcess.cpp
Examining data/rubberband-1.9.0/src/audiocurves/CompoundAudioCurve.cpp
Examining data/rubberband-1.9.0/src/audiocurves/CompoundAudioCurve.h
Examining data/rubberband-1.9.0/src/audiocurves/ConstantAudioCurve.cpp
Examining data/rubberband-1.9.0/src/audiocurves/ConstantAudioCurve.h
Examining data/rubberband-1.9.0/src/audiocurves/HighFrequencyAudioCurve.cpp
Examining data/rubberband-1.9.0/src/audiocurves/HighFrequencyAudioCurve.h
Examining data/rubberband-1.9.0/src/audiocurves/PercussiveAudioCurve.cpp
Examining data/rubberband-1.9.0/src/audiocurves/PercussiveAudioCurve.h
Examining data/rubberband-1.9.0/src/audiocurves/SilentAudioCurve.cpp
Examining data/rubberband-1.9.0/src/audiocurves/SilentAudioCurve.h
Examining data/rubberband-1.9.0/src/audiocurves/SpectralDifferenceAudioCurve.cpp
Examining data/rubberband-1.9.0/src/audiocurves/SpectralDifferenceAudioCurve.h
Examining data/rubberband-1.9.0/src/base/Profiler.cpp
Examining data/rubberband-1.9.0/src/base/Profiler.h
Examining data/rubberband-1.9.0/src/base/RingBuffer.h
Examining data/rubberband-1.9.0/src/base/Scavenger.h
Examining data/rubberband-1.9.0/src/dsp/AudioCurveCalculator.cpp
Examining data/rubberband-1.9.0/src/dsp/AudioCurveCalculator.h
Examining data/rubberband-1.9.0/src/dsp/FFT.cpp
Examining data/rubberband-1.9.0/src/dsp/FFT.h
Examining data/rubberband-1.9.0/src/dsp/MovingMedian.h
Examining data/rubberband-1.9.0/src/dsp/Resampler.cpp
Examining data/rubberband-1.9.0/src/dsp/Resampler.h
Examining data/rubberband-1.9.0/src/dsp/SampleFilter.h
Examining data/rubberband-1.9.0/src/dsp/SincWindow.h
Examining data/rubberband-1.9.0/src/dsp/Window.h
Examining data/rubberband-1.9.0/src/float_cast/float_cast.h
Examining data/rubberband-1.9.0/src/getopt/getopt.c
Examining data/rubberband-1.9.0/src/getopt/getopt.h
Examining data/rubberband-1.9.0/src/getopt/getopt_long.c
Examining data/rubberband-1.9.0/src/getopt/unistd.h
Examining data/rubberband-1.9.0/src/jni/RubberBandStretcherJNI.cpp
Examining data/rubberband-1.9.0/src/kissfft/_kiss_fft_guts.h
Examining data/rubberband-1.9.0/src/kissfft/kiss_fft.c
Examining data/rubberband-1.9.0/src/kissfft/kiss_fft.h
Examining data/rubberband-1.9.0/src/kissfft/kiss_fftr.c
Examining data/rubberband-1.9.0/src/kissfft/kiss_fftr.h
Examining data/rubberband-1.9.0/src/pommier/neon_mathfun.h
Examining data/rubberband-1.9.0/src/pommier/sse_mathfun.h
Examining data/rubberband-1.9.0/src/rubberband-c.cpp
Examining data/rubberband-1.9.0/src/speex/resample.c
Examining data/rubberband-1.9.0/src/speex/speex_resampler.h
Examining data/rubberband-1.9.0/src/system/Allocators.cpp
Examining data/rubberband-1.9.0/src/system/Allocators.h
Examining data/rubberband-1.9.0/src/system/Thread.cpp
Examining data/rubberband-1.9.0/src/system/Thread.h
Examining data/rubberband-1.9.0/src/system/VectorOps.h
Examining data/rubberband-1.9.0/src/system/VectorOpsComplex.cpp
Examining data/rubberband-1.9.0/src/system/VectorOpsComplex.h
Examining data/rubberband-1.9.0/src/system/sysutils.h
Examining data/rubberband-1.9.0/src/system/sysutils.cpp
Examining data/rubberband-1.9.0/vamp/RubberBandVampPlugin.cpp
Examining data/rubberband-1.9.0/vamp/RubberBandVampPlugin.h
Examining data/rubberband-1.9.0/vamp/libmain.cpp

FINAL RESULTS:

data/rubberband-1.9.0/src/base/Profiler.cpp:35: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 sprintf_s
data/rubberband-1.9.0/src/getopt/getopt_long.c:70:3:  [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(stderr, opterrmsg);
data/rubberband-1.9.0/vamp/RubberBandVampPlugin.cpp:587:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf(label, "expected %ld, actual %ld, difference %ld (%s ms)",
data/rubberband-1.9.0/main/main.cpp:156:13:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
        c = getopt_long(argc, argv,
data/rubberband-1.9.0/src/dsp/FFT.cpp:1729:28:  [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.
        const char *home = getenv("HOME");
data/rubberband-1.9.0/src/dsp/FFT.cpp:3542:29:  [3] (random) drand48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
                    da[i] = drand48() * size;
data/rubberband-1.9.0/src/dsp/FFT.cpp:3544:29:  [3] (random) drand48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
                    db[i] = drand48() * size;
data/rubberband-1.9.0/src/dsp/FFT.cpp:3549:29:  [3] (random) drand48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
                    da[i] = drand48();
data/rubberband-1.9.0/src/dsp/FFT.cpp:3551:29:  [3] (random) drand48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
                    db[i] = drand48();
data/rubberband-1.9.0/src/dsp/FFT.cpp:3557:25:  [3] (random) drand48:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
                di[i] = drand48();
data/rubberband-1.9.0/src/getopt/getopt.c:53: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(nargc, nargv, ostr)
data/rubberband-1.9.0/src/getopt/getopt.h:89:16:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
GETOPT_API int getopt_long __P((int, char * const *, const char *,
data/rubberband-1.9.0/src/getopt/getopt.h:105:16:  [3] (buffer) getopt:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
GETOPT_API int getopt __P((int, char * const *, const char *));
data/rubberband-1.9.0/src/getopt/getopt_long.c:88: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.
__weak_alias(getopt,_getopt)
data/rubberband-1.9.0/src/getopt/getopt_long.c:100:14:  [3] (buffer) getopt_long:
  Some older implementations do not protect against internal buffer overflows
  (CWE-120, CWE-20). Check implementation on installation, or limit the size
  of all string inputs.
__weak_alias(getopt_long,_getopt_long)
data/rubberband-1.9.0/src/getopt/getopt_long.c:107:29:  [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.
#define IS_POSIXLY_CORRECT (getenv("POSIXLY_CORRECT") != NULL)
data/rubberband-1.9.0/src/getopt/getopt_long.c:364: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(nargc, nargv, options)
data/rubberband-1.9.0/src/getopt/getopt_long.c:397: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(nargc, nargv, options, long_options, idx)
data/rubberband-1.9.0/src/system/sysutils.h:125:22:  [3] (misc) LoadLibrary:
  Ensure that the full path to the library is specified, or current directory
  may be used (CWE-829, CWE-20). Use registry entry or GetWindowsDirectory to
  find library path, if you aren't already.
#define DLOPEN(a,b)  LoadLibrary((a).toStdWString().c_str())
data/rubberband-1.9.0/ladspa/RubberBandPitchShifter.h:60: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.
    static const char *const portNamesMono[PortCountMono];
data/rubberband-1.9.0/ladspa/RubberBandPitchShifter.h:64: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.
    static const char *const portNamesStereo[PortCountStereo];
data/rubberband-1.9.0/main/main.cpp:169:27:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        case 'd': debug = atoi(optarg); break;
data/rubberband-1.9.0/main/main.cpp:186:31:  [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).
        case 'c': crispness = atoi(optarg); break;
data/rubberband-1.9.0/main/main.cpp:329:29:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            size_t source = atoi(line.substr(0, i).c_str());
data/rubberband-1.9.0/main/main.cpp:331:29:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            size_t target = atoi(line.substr(i).c_str());
data/rubberband-1.9.0/src/base/Profiler.cpp: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 buffer[buflen];
data/rubberband-1.9.0/src/dsp/FFT.cpp:1732: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 fn[256];
data/rubberband-1.9.0/src/dsp/FFT.cpp:1735:19:  [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(fn, save ? "wb" : "rb");
data/rubberband-1.9.0/src/getopt/getopt_long.c:57:19:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
GETOPT_API extern char opterrmsg[128];
data/rubberband-1.9.0/src/getopt/getopt_long.c:58: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 opterrmsg[128]; /* last error message is stored here */
data/rubberband-1.9.0/src/getopt/getopt_long.c:194: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 **) nargv)[pos] = nargv[cstart];
data/rubberband-1.9.0/src/getopt/getopt_long.c:196: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 **)nargv)[cstart] = swap;
data/rubberband-1.9.0/src/kissfft/kiss_fft.c:362: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(fout,tmpbuf,sizeof(kiss_fft_cpx)*st->nfft);
data/rubberband-1.9.0/src/speex/resample.c:146: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(newptr, ptr, copy * size);
data/rubberband-1.9.0/src/system/sysutils.cpp:131:21:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    FILE *cpuinfo = fopen("/proc/cpuinfo", "r");
data/rubberband-1.9.0/src/system/sysutils.cpp:134: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/rubberband-1.9.0/vamp/RubberBandVampPlugin.cpp:542: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[200];
data/rubberband-1.9.0/vamp/RubberBandVampPlugin.cpp:599: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[30];
data/rubberband-1.9.0/vamp/RubberBandVampPlugin.cpp:604:13:  [2] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf. Risk is low because the source has a constant maximum length.
            sprintf(buf, "%d", int(baseCount + i));
data/rubberband-1.9.0/ladspa/RubberBandPitchShifter.cpp:553:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        m_outputBuffer[c]->read(&(m_output[c][offset]), chunk);
data/rubberband-1.9.0/main/main.cpp:56:19:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
using RubberBand::usleep;
data/rubberband-1.9.0/main/main.cpp:626:13:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
            usleep(10000);
data/rubberband-1.9.0/src/StretcherProcess.cpp:1266:52:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        size_t gotHere = m_channelData[c]->outbuf->read(output[c], got);
data/rubberband-1.9.0/src/base/RingBuffer.h:111:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int read(S *const R__ destination, int n);
data/rubberband-1.9.0/src/base/RingBuffer.h:296:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
RingBuffer<T>::read(S *const R__ destination, int n)
data/rubberband-1.9.0/src/getopt/getopt_long.c:440: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).
			current_argv_len = strlen(current_argv);
data/rubberband-1.9.0/src/getopt/getopt_long.c:448:8:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
			if (strlen(long_options[i].name) ==
data/rubberband-1.9.0/src/kissfft/kiss_fft.h:32:33:  [1] (free) memalign:
  On some systems (though not Linux-based systems) an attempt to free()
  results from memalign() may fail. This may, on a few systems, be
  exploitable. Also note that memalign() may not check that the boundary
  parameter is correct (CWE-676). Use posix_memalign instead (defined in
  POSIX's 1003.1d). Don't switch to valloc(); it is marked as obsolete in BSD
  4.3, as legacy in SUSv2, and is no longer defined in SUSv3. In some cases,
  malloc()'s alignment may be sufficient.
#define KISS_FFT_MALLOC(nbytes) memalign(16,nbytes)
data/rubberband-1.9.0/src/system/sysutils.cpp:168:6:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
void usleep(unsigned long usec)
data/rubberband-1.9.0/src/system/sysutils.h:97:6:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
void usleep(unsigned long);

ANALYSIS SUMMARY:

Hits = 50
Lines analyzed = 23886 in approximately 0.55 seconds (43588 lines/second)
Physical Source Lines of Code (SLOC) = 16344
Hits@level = [0]  24 [1]  11 [2]  20 [3]  16 [4]   3 [5]   0
Hits@level+ = [0+]  74 [1+]  50 [2+]  39 [3+]  19 [4+]   3 [5+]   0
Hits/KSLOC@level+ = [0+] 4.52766 [1+] 3.05923 [2+] 2.3862 [3+] 1.16251 [4+] 0.183554 [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.