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/wmbubble-1.54/bubblemon.c Examining data/wmbubble-1.54/include/bubblemon.h Examining data/wmbubble-1.54/include/digits.h Examining data/wmbubble-1.54/include/ducks.h Examining data/wmbubble-1.54/include/numbers-2.h Examining data/wmbubble-1.54/include/sys_include.h Examining data/wmbubble-1.54/sys_freebsd.c Examining data/wmbubble-1.54/sys_linux.c Examining data/wmbubble-1.54/sys_netbsd.c Examining data/wmbubble-1.54/sys_openbsd.c Examining data/wmbubble-1.54/sys_sunos.c Examining data/wmbubble-1.54/wmx11pixmap.c Examining data/wmbubble-1.54/wmx11pixmap.h FINAL RESULTS: data/wmbubble-1.54/bubblemon.c:448:10: [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. if (system(execute) == -1) data/wmbubble-1.54/sys_linux.c:50:6: [4] (buffer) fscanf: 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 the scanf format is influenceable by an attacker, it's exploitable. if (fscanf(stat, "%*s %"PRIu64" %"PRIu64" %"PRIu64" %"PRIu64, data/wmbubble-1.54/sys_linux.c:108:3: [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 the scanf format is influenceable by an attacker, it's exploitable. sscanf(p, "MemTotal:%"PRIu64, &bm.mem_max); data/wmbubble-1.54/sys_linux.c:113:4: [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 the scanf format is influenceable by an attacker, it's exploitable. sscanf(p, "Active:%"PRIu64, &bm.mem_used); data/wmbubble-1.54/sys_linux.c:118:5: [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 the scanf format is influenceable by an attacker, it's exploitable. sscanf(p, "SwapTotal:%"PRIu64, &bm.swap_max); data/wmbubble-1.54/sys_linux.c:123:6: [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 the scanf format is influenceable by an attacker, it's exploitable. sscanf(p, "SwapFree:%"PRIu64, data/wmbubble-1.54/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/wmbubble-1.54/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/wmbubble-1.54/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/wmbubble-1.54/bubblemon.c:171: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 cpu_gauge[25*9*3]; data/wmbubble-1.54/bubblemon.c:233: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[BUFSIZ] = ""; data/wmbubble-1.54/bubblemon.c:322: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 preformat[33]; data/wmbubble-1.54/bubblemon.c:349: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 execute[256]; data/wmbubble-1.54/bubblemon.c:610: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 keys[32]; data/wmbubble-1.54/bubblemon.c:851:11: [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 reds[3], grns[3], blus[3]; data/wmbubble-1.54/bubblemon.c:928: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(whither, from, 12); data/wmbubble-1.54/bubblemon.c:1009: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 percent[4]; data/wmbubble-1.54/bubblemon.c:1010: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 number[8]; data/wmbubble-1.54/bubblemon.c:1014: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, bm.screen_type ? empty_loadgraph : empty_memgraph, data/wmbubble-1.54/bubblemon.c:1020:4: [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/wmbubble-1.54/bubblemon.c:1022:4: [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/wmbubble-1.54/bubblemon.c:1067: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(whither,from,21); data/wmbubble-1.54/bubblemon.c:1237: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 format[32]; data/wmbubble-1.54/include/bubblemon.h:74: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[BOX_SIZE * BOX_SIZE * 3 + 1]; data/wmbubble-1.54/include/bubblemon.h:77: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[BOX_SIZE * BOX_SIZE * 3 + 1]; data/wmbubble-1.54/include/bubblemon.h:84: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 bubblebuf[BOX_SIZE * (BOX_SIZE+4)]; data/wmbubble-1.54/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/wmbubble-1.54/include/numbers-2.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 bigdigits[130*32]={ data/wmbubble-1.54/sys_linux.c:37: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). stat = fopen("/proc/stat", "r"); data/wmbubble-1.54/sys_linux.c:94: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 meminfo[2048]; data/wmbubble-1.54/sys_linux.c:98: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). mem = fopen("/proc/meminfo", "r"); data/wmbubble-1.54/sys_linux.c:135: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/wmbubble-1.54/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/wmbubble-1.54/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/wmbubble-1.54/bubblemon.c:257:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(name,NAME,BUFSIZ), strncat(name,x_resource_unified[i].specifier,BUFSIZ-strlen(name)); data/wmbubble-1.54/bubblemon.c:257:30: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncpy(name,NAME,BUFSIZ), strncat(name,x_resource_unified[i].specifier,BUFSIZ-strlen(name)); data/wmbubble-1.54/bubblemon.c:257:82: [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). strncpy(name,NAME,BUFSIZ), strncat(name,x_resource_unified[i].specifier,BUFSIZ-strlen(name)); data/wmbubble-1.54/bubblemon.c:328:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(preformat,x_resource_unified[i].option,32); data/wmbubble-1.54/bubblemon.c:331:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. strncat(preformat," [num]",32-strlen(preformat)); data/wmbubble-1.54/bubblemon.c:331:34: [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). strncat(preformat," [num]",32-strlen(preformat)); data/wmbubble-1.54/bubblemon.c:334:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. strncat(preformat," [color]",32-strlen(preformat)); data/wmbubble-1.54/bubblemon.c:334:36: [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). strncat(preformat," [color]",32-strlen(preformat)); data/wmbubble-1.54/bubblemon.c:337:4: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. strncat(preformat," [float]",32-strlen(preformat)); data/wmbubble-1.54/bubblemon.c:337:36: [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). strncat(preformat," [float]",32-strlen(preformat)); data/wmbubble-1.54/bubblemon.c:341:5: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. Risk is low because the source is a constant string. strncat(preformat," [y/n]",32-strlen(preformat)); data/wmbubble-1.54/bubblemon.c:341:35: [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). strncat(preformat," [y/n]",32-strlen(preformat)); data/wmbubble-1.54/bubblemon.c:478:3: [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(delay_time); data/wmbubble-1.54/bubblemon.c:1242: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). for (width = ii = 0; ii < strlen(format); ii++) data/wmbubble-1.54/bubblemon.c:1246:30: [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). for (width = ii = 0; ii < strlen(format); ii++) data/wmbubble-1.54/bubblemon.c:1251: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). for (width = ii = 0; ii < strlen(format); ii++) data/wmbubble-1.54/bubblemon.c:1257: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). for (ii = 0; ii < strlen(format); ii++) { ANALYSIS SUMMARY: Hits = 51 Lines analyzed = 2994 in approximately 0.13 seconds (22766 lines/second) Physical Source Lines of Code (SLOC) = 2141 Hits@level = [0] 41 [1] 17 [2] 25 [3] 3 [4] 6 [5] 0 Hits@level+ = [0+] 92 [1+] 51 [2+] 34 [3+] 9 [4+] 6 [5+] 0 Hits/KSLOC@level+ = [0+] 42.9706 [1+] 23.8206 [2+] 15.8804 [3+] 4.20364 [4+] 2.80243 [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.