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/mpc-0.33/src/Compiler.h Examining data/mpc-0.33/src/args.c Examining data/mpc-0.33/src/args.h Examining data/mpc-0.33/src/charset.c Examining data/mpc-0.33/src/charset.h Examining data/mpc-0.33/src/command.c Examining data/mpc-0.33/src/command.h Examining data/mpc-0.33/src/format.c Examining data/mpc-0.33/src/format.h Examining data/mpc-0.33/src/idle.c Examining data/mpc-0.33/src/idle.h Examining data/mpc-0.33/src/list.c Examining data/mpc-0.33/src/list.h Examining data/mpc-0.33/src/main.c Examining data/mpc-0.33/src/message.c Examining data/mpc-0.33/src/message.h Examining data/mpc-0.33/src/mount.c Examining data/mpc-0.33/src/mount.h Examining data/mpc-0.33/src/mpc.h Examining data/mpc-0.33/src/neighbors.c Examining data/mpc-0.33/src/neighbors.h Examining data/mpc-0.33/src/options.c Examining data/mpc-0.33/src/options.h Examining data/mpc-0.33/src/output.c Examining data/mpc-0.33/src/output.h Examining data/mpc-0.33/src/password.c Examining data/mpc-0.33/src/password.h Examining data/mpc-0.33/src/path.c Examining data/mpc-0.33/src/path.h Examining data/mpc-0.33/src/queue.c Examining data/mpc-0.33/src/queue.h Examining data/mpc-0.33/src/search.c Examining data/mpc-0.33/src/search.h Examining data/mpc-0.33/src/song_format.c Examining data/mpc-0.33/src/song_format.h Examining data/mpc-0.33/src/status.c Examining data/mpc-0.33/src/status.h Examining data/mpc-0.33/src/sticker.c Examining data/mpc-0.33/src/sticker.h Examining data/mpc-0.33/src/tab.c Examining data/mpc-0.33/src/tab.h Examining data/mpc-0.33/src/tags.c Examining data/mpc-0.33/src/tags.h Examining data/mpc-0.33/src/util.c Examining data/mpc-0.33/src/util.h Examining data/mpc-0.33/test/test_format.c FINAL RESULTS: data/mpc-0.33/src/Compiler.h:76:47: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. #define gcc_printf(a,b) __attribute__((format(printf, a, b))) data/mpc-0.33/src/options.c:72: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, PACKAGE ": invalid option %s\n", option); data/mpc-0.33/src/options.c:75: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, PACKAGE ": bad argument: %s\n", option); data/mpc-0.33/src/options.c:78: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, PACKAGE ": invalid option %s=%s\n", option, arg); data/mpc-0.33/src/options.c:81: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, PACKAGE ": missing value for %s option\n", option); data/mpc-0.33/src/options.c:84: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, PACKAGE ": internal error %d\n", error); data/mpc-0.33/src/util.h:29:23: [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. #define DIE(...) do { fprintf(stderr, __VA_ARGS__); return -1; } while(0) data/mpc-0.33/src/options.c:332:25: [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. if ((options.format = getenv("MPC_FORMAT")) == NULL) data/mpc-0.33/src/args.c:38: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 buffer[4096]; data/mpc-0.33/src/charset.c:71: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(newp, to, errhand - to); data/mpc-0.33/src/charset.c:77: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(cp, "IGNORE", sizeof("IGNORE")); data/mpc-0.33/src/charset.c:139: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 buffer[BUFFER_SIZE]; data/mpc-0.33/src/charset.c:152: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(ret+retlen,buffer,BUFFER_SIZE-outleft); data/mpc-0.33/src/command.c:396: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 buffer[32]; data/mpc-0.33/src/command.c:531: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 buffer[32]; data/mpc-0.33/src/command.c:1043: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. static char buf[32]; /* Ugh */ data/mpc-0.33/src/format.c:40: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(dest + destlen, src, len); data/mpc-0.33/src/format.c:206:4: [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 name[32]; data/mpc-0.33/src/format.c:213: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(name, p + 1, length - 2); data/mpc-0.33/src/options.c:315: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(password, options.host, password_length); data/mpc-0.33/src/output.c:259: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(p, s, length); data/mpc-0.33/src/song_format.c:63: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. static char buffer[40]; data/mpc-0.33/src/tab.c:42: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(p, prefix, length); data/mpc-0.33/src/args.c:94: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). size_t len = strlen(s); data/mpc-0.33/src/args.c:185: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(str); data/mpc-0.33/src/charset.c:133: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 inleft = strlen(string); data/mpc-0.33/src/command.c:314:14: [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 (min && strlen(sec_ptr) != 2) data/mpc-0.33/src/command.c:316: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). else if (hr && strlen(min_ptr) != 2) data/mpc-0.33/src/command.c:433:10: [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 (arg[strlen(arg) - 1] == '%') { data/mpc-0.33/src/command.c:435:7: [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). arg[strlen(arg) - 1] = '\0'; data/mpc-0.33/src/command.c:505: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 (min && strlen(sec_ptr) != 2) data/mpc-0.33/src/command.c:507:19: [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). else if (hr && strlen(min_ptr) != 2) data/mpc-0.33/src/format.c:36:5: [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(dest) data/mpc-0.33/src/format.c:121:33: [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). ret = string_append(ret, t, strlen(t)); data/mpc-0.33/src/format.c:221:20: [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). value_length = strlen(value); data/mpc-0.33/src/main.c:185:19: [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). unsigned tmp = strlen(mpc_table[i].command) + data/mpc-0.33/src/main.c:186:5: [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(mpc_table[i].usage); data/mpc-0.33/src/main.c:197: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). int spaces = max-(strlen(mpc_table[i].command)+strlen(mpc_table[i].usage)); data/mpc-0.33/src/main.c:197:50: [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 spaces = max-(strlen(mpc_table[i].command)+strlen(mpc_table[i].usage)); data/mpc-0.33/src/main.c:231: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). size_t name_length = strlen(name); data/mpc-0.33/src/options.c:199:29: [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). remaining - (int) strlen(option_table[i].longopt), data/mpc-0.33/src/options.c:218:16: [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 len = strlen(arg); data/mpc-0.33/src/path.c:56:29: [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 path_length = strlen(path); data/mpc-0.33/src/path.c:57:29: [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 base_length = strlen(music_directory); data/mpc-0.33/src/queue.c:137:24: [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 (range[0] == 0 && strlen(s) == 1 && data/mpc-0.33/src/tab.c:62:31: [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 prefix_length = strlen(prefix); data/mpc-0.33/src/tab.c:85:31: [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 prefix_length = strlen(prefix); data/mpc-0.33/src/tab.c:109:31: [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 prefix_length = strlen(prefix); ANALYSIS SUMMARY: Hits = 48 Lines analyzed = 5911 in approximately 0.17 seconds (35776 lines/second) Physical Source Lines of Code (SLOC) = 3752 Hits@level = [0] 105 [1] 25 [2] 15 [3] 1 [4] 7 [5] 0 Hits@level+ = [0+] 153 [1+] 48 [2+] 23 [3+] 8 [4+] 7 [5+] 0 Hits/KSLOC@level+ = [0+] 40.7783 [1+] 12.7932 [2+] 6.13006 [3+] 2.1322 [4+] 1.86567 [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.