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/unmo3-0.6/16to8.c Examining data/unmo3-0.6/endian_macros.h Examining data/unmo3-0.6/mo3_mp3.c Examining data/unmo3-0.6/mo3_mp3.h Examining data/unmo3-0.6/mo3_parse.c Examining data/unmo3-0.6/mo3_parse.h Examining data/unmo3-0.6/mo3_unpack.c Examining data/unmo3-0.6/mo3_unpack.h Examining data/unmo3-0.6/unmo3.c FINAL RESULTS: data/unmo3-0.6/mo3_parse.c:220:13: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(note,"%s%d", notes[notev], oct+1); data/unmo3-0.6/mo3_parse.c:17: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 *notes[NB_NOTES]={ "C-", "C#", "D-", "D#", "E-", "F-", "F#", "G-", "G#", "A-", "A#", "B-" }; data/unmo3-0.6/mo3_parse.c:183: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 note[3+1]; data/unmo3-0.6/mo3_parse.c: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 instr[2+1]; data/unmo3-0.6/mo3_parse.c:186: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 eff1[3+1]; data/unmo3-0.6/mo3_parse.c:187: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 eff2[3+1]; data/unmo3-0.6/mo3_parse.c:210: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(note,"..."); data/unmo3-0.6/mo3_parse.c:211: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(instr,".."); data/unmo3-0.6/mo3_parse.c:212: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(eff1," "); data/unmo3-0.6/mo3_parse.c:213: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(eff2,"..."); data/unmo3-0.6/mo3_parse.c:223: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(instr,"%2d", (*(p+1))+1); data/unmo3-0.6/mo3_parse.c:226: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(eff2,"%X%02X", (*p)-3, *(p+1)); data/unmo3-0.6/mo3_unpack.c:418: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(dst, src, size); data/unmo3-0.6/unmo3.c:41: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). out=(FILE*)fopen(filename,"wb"); data/unmo3-0.6/unmo3.c:71: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 sampleName[50]; data/unmo3-0.6/unmo3.c:83:17: [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). debug = atoi(argv[i]); data/unmo3-0.6/unmo3.c:87:22: [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). parseLevel = atoi(argv[i]); data/unmo3-0.6/unmo3.c:91:19: [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). pattern = atoi(argv[i++]); data/unmo3-0.6/unmo3.c:92:19: [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). channel = atoi(argv[i]); data/unmo3-0.6/unmo3.c:106:17: [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). sampleNr = atoi(argv[i]); data/unmo3-0.6/unmo3.c:121: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=(FILE*)fopen(mo3Name,"rb"); data/unmo3-0.6/unmo3.c:216: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(sampleName,"sample%03d.dat",i+1); data/unmo3-0.6/unmo3.c:228:15: [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(sampleName,"sample%03d.mp3",i+1); data/unmo3-0.6/unmo3.c:230:15: [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(sampleName,"sample%03d.ogg",i+1); data/unmo3-0.6/unmo3.c:232:15: [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(sampleName,"sample%03d.dat",i+1); data/unmo3-0.6/16to8.c:10:3: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fgetc(stdin); data/unmo3-0.6/16to8.c:11:7: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(stdin); data/unmo3-0.6/16to8.c:15:5: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). fgetc(stdin); data/unmo3-0.6/16to8.c:16:9: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). c = fgetc(stdin); data/unmo3-0.6/endian_macros.h:5:35: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define ifget8(f) ((unsigned long)fgetc(f)) ANALYSIS SUMMARY: Hits = 30 Lines analyzed = 1310 in approximately 0.05 seconds (23956 lines/second) Physical Source Lines of Code (SLOC) = 1013 Hits@level = [0] 80 [1] 5 [2] 24 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 110 [1+] 30 [2+] 25 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 108.588 [1+] 29.615 [2+] 24.6792 [3+] 0.987167 [4+] 0.987167 [5+] 0 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.