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/id3-1.1.2/genre.h Examining data/id3-1.1.2/id3.c FINAL RESULTS: data/id3-1.1.2/id3.c:157:17: [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. const int r = getopt(argc, argv, "dhlLRvt:T:a:A:y:c:g:-:"); data/id3-1.1.2/id3.c:54:2: [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 tag[3]; data/id3-1.1.2/id3.c:55:2: [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 title[30]; data/id3-1.1.2/id3.c:56:2: [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 artist[30]; data/id3-1.1.2/id3.c:57:2: [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 album[30]; data/id3-1.1.2/id3.c:58:2: [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 year[4]; data/id3-1.1.2/id3.c:61:2: [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 comment[30]; data/id3-1.1.2/id3.c:104:2: [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, cp); data/id3-1.1.2/id3.c:266: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 * const fp = fopen(argv[i], rw? "r+": "r"); data/id3-1.1.2/id3.c:328: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(newid3.tag, "TAG", 3); data/id3-1.1.2/id3.c:329:18: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (!newtitle) memcpy(&newid3.title, &oldid3.title, 30); data/id3-1.1.2/id3.c:330:19: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (!newartist) memcpy(&newid3.artist, &oldid3.artist, 30); data/id3-1.1.2/id3.c:331:18: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (!newalbum) memcpy(&newid3.album, &oldid3.album, 30); data/id3-1.1.2/id3.c:332:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (!newyear) memcpy(&newid3.year, &oldid3.year, 4); data/id3-1.1.2/id3.c:333:20: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (!newcomment) memcpy(&newid3.comment, &oldid3.comment, 28); data/id3-1.1.2/id3.c:334:20: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (!newtrack) { memcpy(&newid3.comment[28], &oldid3.comment[28], 2); } data/id3-1.1.2/id3.c:335:18: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (!newgenre) memcpy(&newid3.genre, &oldid3.genre, 1); data/id3-1.1.2/id3.c:102:21: [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). const size_t len = strlen(src); ANALYSIS SUMMARY: Hits = 18 Lines analyzed = 545 in approximately 0.24 seconds (2281 lines/second) Physical Source Lines of Code (SLOC) = 440 Hits@level = [0] 21 [1] 1 [2] 16 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 39 [1+] 18 [2+] 17 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 88.6364 [1+] 40.9091 [2+] 38.6364 [3+] 2.27273 [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.