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/id3v2-0.1.12+dfsg/genre.cpp Examining data/id3v2-0.1.12+dfsg/create_map.cpp Examining data/id3v2-0.1.12+dfsg/genre.h Examining data/id3v2-0.1.12+dfsg/frametable.h Examining data/id3v2-0.1.12+dfsg/convert.cpp Examining data/id3v2-0.1.12+dfsg/charset.h Examining data/id3v2-0.1.12+dfsg/charset.cpp Examining data/id3v2-0.1.12+dfsg/id3v2.cpp Examining data/id3v2-0.1.12+dfsg/list.cpp FINAL RESULTS: data/id3v2-0.1.12+dfsg/id3v2.cpp:751:9: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. if (chmod(argv[nIndex], filestat.st_mode)) data/id3v2-0.1.12+dfsg/id3v2.cpp:13: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 _snprintf data/id3v2-0.1.12+dfsg/id3v2.cpp:13:18: [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 _snprintf data/id3v2-0.1.12+dfsg/id3v2.cpp:471:15: [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(newTrackNum, frameList[ii].data); data/id3v2-0.1.12+dfsg/id3v2.cpp:472:15: [4] (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). strcat(newTrackNum, currentTrackNum); data/id3v2-0.1.12+dfsg/id3v2.cpp:218:12: [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. iOpt = getopt_long (argc, argv, "12hfLvlRdsDCr:a:A:t:c:g:y:T:", data/id3v2-0.1.12+dfsg/charset.cpp:57:4: [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 ((void *) realloced, (void *) mbs_text, outp - mbs_text); data/id3v2-0.1.12+dfsg/convert.cpp:101:12: [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). fp = fopen(argv[nIndex], "r+"); data/id3v2-0.1.12+dfsg/id3v2.cpp:93: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 tmp[TMPSIZE]; data/id3v2-0.1.12+dfsg/id3v2.cpp:301:21: [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(tmp, "(%d)", genre_id); data/id3v2-0.1.12+dfsg/id3v2.cpp:351:10: [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). fp = fopen(argv[nIndex], "r+"); data/id3v2-0.1.12+dfsg/list.cpp:326: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 tag[3]; data/id3v2-0.1.12+dfsg/list.cpp:327: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 title[30]; data/id3v2-0.1.12+dfsg/list.cpp: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 artist[30]; data/id3v2-0.1.12+dfsg/list.cpp:329: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 album[30]; data/id3v2-0.1.12+dfsg/list.cpp:330: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 year[4]; data/id3v2-0.1.12+dfsg/list.cpp:333: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 comment[30]; data/id3v2-0.1.12+dfsg/list.cpp:338:8: [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). fp = fopen(sFileName, "r"); /* read only */ data/id3v2-0.1.12+dfsg/charset.cpp:88: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). size_t inl = strlen (text); data/id3v2-0.1.12+dfsg/charset.cpp:107: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). size_t inl = strlen (text); data/id3v2-0.1.12+dfsg/convert.cpp:11:6: [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(abr) != 4){ data/id3v2-0.1.12+dfsg/id3v2.cpp:424:15: [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(frameList[ii].data) > 0) { data/id3v2-0.1.12+dfsg/id3v2.cpp:437:15: [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(frameList[ii].data) > 0) { data/id3v2-0.1.12+dfsg/id3v2.cpp:450:17: [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(test) > 0) { data/id3v2-0.1.12+dfsg/id3v2.cpp:469:44: [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). newTrackNum = (char *)malloc(strlen(currentTrackNum) data/id3v2-0.1.12+dfsg/id3v2.cpp:470:38: [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). + strlen(frameList[ii].data)); data/id3v2-0.1.12+dfsg/id3v2.cpp:508:15: [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(ID3_GetString(myFrame, ID3FN_TEXT)) > 0) { data/id3v2-0.1.12+dfsg/id3v2.cpp:583:15: [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(temp) > 0) { data/id3v2-0.1.12+dfsg/id3v2.cpp:608:15: [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(frameList[ii].data) > 0) { ANALYSIS SUMMARY: Hits = 29 Lines analyzed = 1803 in approximately 0.07 seconds (25338 lines/second) Physical Source Lines of Code (SLOC) = 1515 Hits@level = [0] 12 [1] 11 [2] 12 [3] 1 [4] 4 [5] 1 Hits@level+ = [0+] 41 [1+] 29 [2+] 18 [3+] 6 [4+] 5 [5+] 1 Hits/KSLOC@level+ = [0+] 27.0627 [1+] 19.1419 [2+] 11.8812 [3+] 3.9604 [4+] 3.30033 [5+] 0.660066 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.