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/sonic-0.2.0/main.c Examining data/sonic-0.2.0/sonic.c Examining data/sonic-0.2.0/sonic.h Examining data/sonic-0.2.0/wave.c Examining data/sonic-0.2.0/wave.h FINAL RESULTS: data/sonic-0.2.0/sonic.c:376: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(stream->inputBuffer + stream->numInputSamples*stream->numChannels, samples, data/sonic-0.2.0/sonic.c:428: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(stream->outputBuffer + stream->numOutputSamples*stream->numChannels, data/sonic-0.2.0/sonic.c:502: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(samples, stream->outputBuffer, numSamples*sizeof(short)*stream->numChannels); data/sonic-0.2.0/sonic.c:813: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(stream->pitchBuffer + stream->numPitchSamples*numChannels, data/sonic-0.2.0/sonic.c:1001: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(out, samples, period*sizeof(short)*numChannels); data/sonic-0.2.0/wave.c:60: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 bytes[4]; data/sonic-0.2.0/wave.c: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 bytes[2]; data/sonic-0.2.0/wave.c:119: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 bytes[4]; data/sonic-0.2.0/wave.c:134: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 bytes[2]; data/sonic-0.2.0/wave.c:150: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[11]; /* Be sure that we never call with a longer string */ data/sonic-0.2.0/wave.c:246:23: [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 *soundFile = fopen(fileName, "rb"); data/sonic-0.2.0/wave.c:271:23: [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 *soundFile = fopen(fileName, "wb"); data/sonic-0.2.0/wave.c:332: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 bytes[WAVE_BUF_LEN]; data/sonic-0.2.0/wave.c:356: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 bytes[WAVE_BUF_LEN]; data/sonic-0.2.0/wave.c:52: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). writeBytes(file, string, strlen(string)); data/sonic-0.2.0/wave.c:151: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). int length = strlen(expectedString); ANALYSIS SUMMARY: Hits = 16 Lines analyzed = 1850 in approximately 0.06 seconds (31504 lines/second) Physical Source Lines of Code (SLOC) = 1456 Hits@level = [0] 23 [1] 2 [2] 14 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 39 [1+] 16 [2+] 14 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 26.7857 [1+] 10.989 [2+] 9.61538 [3+] 0 [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.