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/bmon-4.0/include/bmon/attr.h Examining data/bmon-4.0/include/bmon/bmon.h Examining data/bmon-4.0/include/bmon/compile-fixes.h Examining data/bmon-4.0/include/bmon/conf.h Examining data/bmon-4.0/include/bmon/config.h Examining data/bmon-4.0/include/bmon/element.h Examining data/bmon-4.0/include/bmon/element_cfg.h Examining data/bmon-4.0/include/bmon/graph.h Examining data/bmon-4.0/include/bmon/group.h Examining data/bmon-4.0/include/bmon/history.h Examining data/bmon-4.0/include/bmon/info.h Examining data/bmon-4.0/include/bmon/input.h Examining data/bmon-4.0/include/bmon/layout.h Examining data/bmon-4.0/include/bmon/list.h Examining data/bmon-4.0/include/bmon/module.h Examining data/bmon-4.0/include/bmon/output.h Examining data/bmon-4.0/include/bmon/unit.h Examining data/bmon-4.0/include/bmon/utils.h Examining data/bmon-4.0/src/attr.c Examining data/bmon-4.0/src/bmon.c Examining data/bmon-4.0/src/conf.c Examining data/bmon-4.0/src/element.c Examining data/bmon-4.0/src/element_cfg.c Examining data/bmon-4.0/src/graph.c Examining data/bmon-4.0/src/group.c Examining data/bmon-4.0/src/history.c Examining data/bmon-4.0/src/in_dummy.c Examining data/bmon-4.0/src/in_netlink.c Examining data/bmon-4.0/src/in_null.c Examining data/bmon-4.0/src/in_proc.c Examining data/bmon-4.0/src/input.c Examining data/bmon-4.0/src/module.c Examining data/bmon-4.0/src/out_ascii.c Examining data/bmon-4.0/src/out_curses.c Examining data/bmon-4.0/src/out_format.c Examining data/bmon-4.0/src/out_null.c Examining data/bmon-4.0/src/output.c Examining data/bmon-4.0/src/unit.c Examining data/bmon-4.0/src/utils.c Examining data/bmon-4.0/src/in_sysctl.c FINAL RESULTS: data/bmon-4.0/include/bmon/bmon.h:73: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, \ data/bmon-4.0/src/bmon.c:100:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, fmt, args); data/bmon-4.0/src/conf.c:483:6: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (access(path, R_OK) != 0) { data/bmon-4.0/src/out_curses.c:157:2: [4] (format) vsnprintf: 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. vsnprintf(buf, sizeof(buf), fmt, args); data/bmon-4.0/src/out_format.c:126:4: [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. snprintf(buf, len, "%" PRIu64, rate_get_total(&a->a_rx_rate)); data/bmon-4.0/src/out_format.c:129:4: [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. snprintf(buf, len, "%" PRIu64, rate_get_total(&a->a_tx_rate)); data/bmon-4.0/src/unit.c:194:3: [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. snprintf(buf, len, "%" PRIu64, bytes); data/bmon-4.0/src/unit.c:209:3: [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. snprintf(buf, len, "%" PRIu64, bits); data/bmon-4.0/src/bmon.c:135:11: [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. int c = getopt_long(argc, argv, gostr, long_opts, NULL); data/bmon-4.0/src/bmon.c:181:11: [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. int c = getopt_long(argc, argv, gostr, long_opts, NULL); data/bmon-4.0/src/conf.c:612:7: [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 (getenv("HOME")) { data/bmon-4.0/src/conf.c:615:6: [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. getenv("HOME")); data/bmon-4.0/src/in_dummy.c:192:3: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(time(NULL)); data/bmon-4.0/src/in_dummy.c:194:3: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. srand(strtol(value, NULL, 0)); data/bmon-4.0/include/bmon/config.h:71:9: [2] (race) vfork: On some old systems, vfork() permits race conditions, and it's very difficult to use correctly (CWE-362). Use fork() instead. #define vfork fork data/bmon-4.0/include/bmon/group.h:47: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 * gh_column[GROUP_COL_MAX]; data/bmon-4.0/src/attr.c:39: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 * allowed_attrs[MAX_POLICY]; data/bmon-4.0/src/attr.c:40: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 * denied_attrs[MAX_POLICY]; data/bmon-4.0/src/conf.c:613: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 path[FILENAME_MAX+1]; data/bmon-4.0/src/element.c:536: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 buf[32]; data/bmon-4.0/src/element.c:550: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 buf[32]; data/bmon-4.0/src/graph.c:142: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(&g->g_cfg, cfg, sizeof(*cfg)); data/bmon-4.0/src/in_dummy.c:89: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 gname[32]; data/bmon-4.0/src/in_dummy.c:100: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 ifname[IFNAMSIZ]; data/bmon-4.0/src/in_dummy.c:227: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 groupname[32]; data/bmon-4.0/src/in_netlink.c:527: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 buf[64]; data/bmon-4.0/src/in_netlink.c:553: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 buf[IFNAME_MAX], name[IFNAME_MAX]; data/bmon-4.0/src/in_netlink.c:723: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 buf[64]; data/bmon-4.0/src/in_netlink.c:779: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 parent[IFNAMSIZ+1]; data/bmon-4.0/src/in_proc.c:104: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 buf[512], *p, *s, *unused __unused__; data/bmon-4.0/src/in_proc.c:107:13: [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 (!(fd = fopen(c_path, "r"))) data/bmon-4.0/src/in_proc.c:214:13: [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 *fd = fopen(c_path, "r"); data/bmon-4.0/src/in_sysctl.c:166: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 info_buf[64]; data/bmon-4.0/src/out_ascii.c:59: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 pad[IFNAMSIZ + 32]; data/bmon-4.0/src/out_curses.c:150: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 buf[2048]; data/bmon-4.0/src/out_curses.c:240: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 *rx_u, *tx_u, buf1[32], buf2[32]; data/bmon-4.0/src/out_curses.c:340: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 pad[HW+1]; data/bmon-4.0/src/out_curses.c:434: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 s[27]; data/bmon-4.0/src/out_curses.c:547: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 buf[32]; data/bmon-4.0/src/out_curses.c:573: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 pad[IFNAMSIZ + 32]; data/bmon-4.0/src/out_curses.c:692: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 buf[32]; data/bmon-4.0/src/out_curses.c:717:9: [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(buf, "%'8.2f ", tbl->gt_scale[i]); data/bmon-4.0/src/out_format.c:150: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 buf[128]; data/bmon-4.0/src/utils.c:211: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(t, s, strlen(s)); data/bmon-4.0/src/utils.c:234: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 t[64]; data/bmon-4.0/include/bmon/utils.h:92:9: [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. return strncat(dest, src, n - strlen(dest) - 1); data/bmon-4.0/include/bmon/utils.h:92:32: [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). return strncat(dest, src, n - strlen(dest) - 1); data/bmon-4.0/src/bmon.c:380:4: [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(st); data/bmon-4.0/src/out_ascii.c:75:2: [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. strncat(pad, e->e_name, sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_ascii.c:75:40: [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(pad, e->e_name, sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_ascii.c:78:3: [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(pad, " (", sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_ascii.c:78: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(pad, " (", sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_ascii.c:79:3: [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. strncat(pad, e->e_description, sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_ascii.c:79:48: [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(pad, e->e_description, sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_ascii.c:80:3: [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 character. strncat(pad, ")", sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_ascii.c:80: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(pad, ")", sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_curses.c:160: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(buf) > cols-x) data/bmon-4.0/src/out_curses.c:163: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). memset(&buf[strlen(buf)], ' ', cols - strlen(buf)-x); data/bmon-4.0/src/out_curses.c:163:41: [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). memset(&buf[strlen(buf)], ' ', cols - strlen(buf)-x); data/bmon-4.0/src/out_curses.c:181:22: [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). col = (cols / 2) - (strlen(str) / 2); data/bmon-4.0/src/out_curses.c:307:12: [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 len = strlen(text); data/bmon-4.0/src/out_curses.c:420: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). move(row, COLS - strlen(PACKAGE_STRING) - 1); data/bmon-4.0/src/out_curses.c:440:4: [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). s[strlen(s) - 1] = '\0'; data/bmon-4.0/src/out_curses.c:446: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). move(row, COLS - strlen(help_text) - 1); data/bmon-4.0/src/out_curses.c:592:3: [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. strncat(pad, e->e_name, sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_curses.c:592:41: [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(pad, e->e_name, sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_curses.c:595: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(pad, " (", sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_curses.c:595:37: [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(pad, " (", sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_curses.c:596: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. strncat(pad, e->e_description, sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_curses.c:596:49: [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(pad, e->e_description, sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_curses.c:597: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 character. strncat(pad, ")", sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_curses.c:597: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(pad, ")", sizeof(pad) - strlen(pad) - 1); data/bmon-4.0/src/out_curses.c:679:43: [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 hcenter = (g->g_cfg.gc_width / 2) - (strlen(text) / 2) + 8; data/bmon-4.0/src/out_curses.c:714: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). memset(buf, 0, strlen(buf)); data/bmon-4.0/src/utils.c:210: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). char *t = xcalloc(1, strlen(s) + 1); data/bmon-4.0/src/utils.c:211: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). memcpy(t, s, strlen(s)); data/bmon-4.0/src/utils.c:236: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). strlen(buf) ? " " : "", split[i], units[i]); data/bmon-4.0/src/utils.c:237: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. strncat(buf, t, len - strlen(buf) - 1); data/bmon-4.0/src/utils.c:237:26: [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(buf, t, len - strlen(buf) - 1); ANALYSIS SUMMARY: Hits = 79 Lines analyzed = 9677 in approximately 0.28 seconds (34182 lines/second) Physical Source Lines of Code (SLOC) = 6823 Hits@level = [0] 106 [1] 34 [2] 31 [3] 6 [4] 8 [5] 0 Hits@level+ = [0+] 185 [1+] 79 [2+] 45 [3+] 14 [4+] 8 [5+] 0 Hits/KSLOC@level+ = [0+] 27.1142 [1+] 11.5785 [2+] 6.59534 [3+] 2.05188 [4+] 1.1725 [5+] 0 Dot directories skipped = 2 (--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.