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/bfm-0.6.4/gkrellm-bfm.c Examining data/bfm-0.6.4/include/sprites.h Examining data/bfm-0.6.4/include/ducks.h Examining data/bfm-0.6.4/include/load_screen.h Examining data/bfm-0.6.4/include/mem_screen.h Examining data/bfm-0.6.4/include/fishmon.h Examining data/bfm-0.6.4/include/chars.h Examining data/bfm-0.6.4/include/digits.h Examining data/bfm-0.6.4/include/sys_include.h Examining data/bfm-0.6.4/include/bubblemon.h Examining data/bfm-0.6.4/fishmon.c Examining data/bfm-0.6.4/bubblemon.c Examining data/bfm-0.6.4/sys_freebsd.c Examining data/bfm-0.6.4/sys_sunos.c Examining data/bfm-0.6.4/sys_openbsd.c Examining data/bfm-0.6.4/sys_linux.c FINAL RESULTS: data/bfm-0.6.4/bubblemon.c:288:2: [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, #x" value is out of range. Using default value ("#def")\n"); \ data/bfm-0.6.4/bubblemon.c:557:4: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system(execute); data/bfm-0.6.4/gkrellm-bfm.c:128:5: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. system(cmd); data/bfm-0.6.4/sys_linux.c:91:8: [4] (buffer) sscanf: The scanf() family's %s operation, without a limit specification, permits buffer overflows (CWE-120, CWE-20). Specify a limit to %s, or use a different input function. if (sscanf(line, "%s %Ld", name, &value) != 2) continue; data/bfm-0.6.4/bubblemon.c:260:16: [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 ((ptr = getenv("HOME")) != NULL) { data/bfm-0.6.4/bubblemon.c:429:18: [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. while ((ch = getopt(argc, argv, execute)) != -1) { data/bfm-0.6.4/sys_sunos.c:77:14: [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 ((str = getenv("DBG_PRINT_MEM"))) data/bfm-0.6.4/sys_sunos.c:79:14: [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 ((str = getenv("DBG_PRINT_CPU"))) data/bfm-0.6.4/sys_sunos.c:81:14: [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 ((str = getenv("DBG_HARDCODE"))) data/bfm-0.6.4/bubblemon.c:160: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 options[1024]; data/bfm-0.6.4/bubblemon.c:220: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 name[BUFSIZ] = "", *ptr; data/bfm-0.6.4/bubblemon.c:271:26: [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). *(int *) tab[i].var = atoi(val.addr); data/bfm-0.6.4/bubblemon.c:365: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 execute[256]; data/bfm-0.6.4/bubblemon.c:402:5: [2] (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). Risk is low because the source is a constant string. strcat(options, "DUCK "); data/bfm-0.6.4/bubblemon.c:405:5: [2] (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). Risk is low because the source is a constant string. strcat(options, "INVERT "); data/bfm-0.6.4/bubblemon.c:410:5: [2] (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). Risk is low because the source is a constant string. strcat(options, "CPU "); data/bfm-0.6.4/bubblemon.c:414:5: [2] (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). Risk is low because the source is a constant string. strcat(options, "MEMSCREEN "); data/bfm-0.6.4/bubblemon.c:415:5: [2] (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). Risk is low because the source is a constant string. strcat(execute, "pmk"); data/bfm-0.6.4/bubblemon.c:418:5: [2] (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). Risk is low because the source is a constant string. strcat(options, "FISH "); data/bfm-0.6.4/bubblemon.c:420:5: [2] (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). Risk is low because the source is a constant string. strcat(execute, "n::"); data/bfm-0.6.4/bubblemon.c:423:5: [2] (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). Risk is low because the source is a constant string. strcat(options, "TIME "); data/bfm-0.6.4/bubblemon.c:649: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 keys[32]; data/bfm-0.6.4/bubblemon.c:1224: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 percent[4]; data/bfm-0.6.4/bubblemon.c:1225: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 number[8]; data/bfm-0.6.4/bubblemon.c:1234: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(bm.mem_buf, bm.screen_type ? load_screen : mem_screen, data/bfm-0.6.4/bubblemon.c:1239:6: [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(number, "%2d", bm.loadavg[i].i); data/bfm-0.6.4/bubblemon.c:1241:6: [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(number, "%02d", bm.loadavg[i].f); data/bfm-0.6.4/bubblemon.c:1245: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(bm.mem_buf + 19 * 56 * 3, bm.his_bufb, 56 * 33 * 3); data/bfm-0.6.4/bubblemon.c:1266: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(bm.mem_buf + 21 * 56 * 3, bm.his_bufa, 56 * 31 * 3); data/bfm-0.6.4/bubblemon.c:1307:6: [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(bm.his_bufa, mem_screen + 21 * 56 * 3, 31 * 56 * 3); data/bfm-0.6.4/bubblemon.c:1308:6: [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(bm.his_bufb, load_screen + 19 * 56 * 3, 33 * 56 * 3); data/bfm-0.6.4/bubblemon.c:1370:21: [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 unsigned char kit[25 * 3 * 9 + 1]; data/bfm-0.6.4/include/bubblemon.h:81: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 rgb_buf[56 * 56 * 3 + 1]; data/bfm-0.6.4/include/bubblemon.h:85: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 mem_buf[56 * 56 * 3 + 1]; data/bfm-0.6.4/include/bubblemon.h:87: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 his_bufa[56 * 31 * 3 + 1]; data/bfm-0.6.4/include/bubblemon.h:89: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 his_bufb[56 * 33 * 3 + 1]; data/bfm-0.6.4/include/bubblemon.h:151: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 image[CMAPSIZE]; data/bfm-0.6.4/include/chars.h:1:17: [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 unsigned char font_cmap[3][3] = { data/bfm-0.6.4/include/digits.h:2:10: [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 digits[95 * 9 * 3 + 1] = data/bfm-0.6.4/include/ducks.h:1:8: [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 duck_cmap[4][3] = { data/bfm-0.6.4/include/load_screen.h:1:10: [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 load_screen[56 * 80 * 3 + 1] = data/bfm-0.6.4/include/mem_screen.h:1:10: [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 mem_screen[56 * 80 * 3 + 1] = data/bfm-0.6.4/include/sprites.h:14:17: [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 unsigned char header_data_cmap[256][3] = { data/bfm-0.6.4/sys_linux.c:41: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). stat = fopen("/proc/stat", "r"); data/bfm-0.6.4/sys_linux.c:83: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 name[256]; data/bfm-0.6.4/sys_linux.c:84: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 line[256]; data/bfm-0.6.4/sys_linux.c:87:9: [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). mem = fopen("/proc/meminfo", "r"); data/bfm-0.6.4/sys_linux.c:128: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). avg = fopen("/proc/loadavg", "r"); data/bfm-0.6.4/sys_linux.c:185: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[256]; data/bfm-0.6.4/sys_linux.c:198: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). if((dev = fopen("/proc/net/dev", "r")) == NULL) data/bfm-0.6.4/sys_linux.c:211: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[256]; data/bfm-0.6.4/sys_sunos.c:78:20: [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). dbg_print_mem = atoi(str); data/bfm-0.6.4/sys_sunos.c:80:20: [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). dbg_print_cpu = atoi(str); data/bfm-0.6.4/bubblemon.c:400:5: [1] (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). Risk is low because the source is a constant character. strcat(execute, "h"); /* help, always in */ data/bfm-0.6.4/bubblemon.c:403:5: [1] (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). Risk is low because the source is a constant character. strcat(execute, "d"); data/bfm-0.6.4/bubblemon.c:406:5: [1] (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). Risk is low because the source is a constant character. strcat(execute, "u"); data/bfm-0.6.4/bubblemon.c:411:5: [1] (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). Risk is low because the source is a constant character. strcat(execute, "c"); data/bfm-0.6.4/bubblemon.c:419:5: [1] (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). Risk is low because the source is a constant character. strcat(execute, "f"); data/bfm-0.6.4/bubblemon.c:424:5: [1] (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). Risk is low because the source is a constant character. strcat(execute, "t"); data/bfm-0.6.4/bubblemon.c:580:2: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(15000); ANALYSIS SUMMARY: Hits = 60 Lines analyzed = 6610 in approximately 0.25 seconds (26031 lines/second) Physical Source Lines of Code (SLOC) = 5239 Hits@level = [0] 35 [1] 7 [2] 44 [3] 5 [4] 4 [5] 0 Hits@level+ = [0+] 95 [1+] 60 [2+] 53 [3+] 9 [4+] 4 [5+] 0 Hits/KSLOC@level+ = [0+] 18.1332 [1+] 11.4526 [2+] 10.1164 [3+] 1.71789 [4+] 0.763504 [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.