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/numatop-2.1/powerpc/plat.c Examining data/numatop-2.1/powerpc/ui_perf_map.c Examining data/numatop-2.1/powerpc/include/types.h Examining data/numatop-2.1/powerpc/include/power9.h Examining data/numatop-2.1/powerpc/include/power8.h Examining data/numatop-2.1/powerpc/power8.c Examining data/numatop-2.1/powerpc/power9.c Examining data/numatop-2.1/powerpc/util.c Examining data/numatop-2.1/test/mgen/powerpc/util.c Examining data/numatop-2.1/test/mgen/include/util.h Examining data/numatop-2.1/test/mgen/mgen.c Examining data/numatop-2.1/test/mgen/intel/util.c Examining data/numatop-2.1/common/perf.c Examining data/numatop-2.1/common/lwp.c Examining data/numatop-2.1/common/reg.c Examining data/numatop-2.1/common/os/os_page.c Examining data/numatop-2.1/common/os/node.c Examining data/numatop-2.1/common/os/os_cmd.c Examining data/numatop-2.1/common/os/plat.c Examining data/numatop-2.1/common/os/os_perf.c Examining data/numatop-2.1/common/os/os_util.c Examining data/numatop-2.1/common/os/pfwrapper.c Examining data/numatop-2.1/common/os/sym.c Examining data/numatop-2.1/common/os/map.c Examining data/numatop-2.1/common/os/os_win.c Examining data/numatop-2.1/common/ui_perf_map.c Examining data/numatop-2.1/common/include/types.h Examining data/numatop-2.1/common/include/page.h Examining data/numatop-2.1/common/include/os/sym.h Examining data/numatop-2.1/common/include/os/linux/perf_event.h Examining data/numatop-2.1/common/include/os/os_perf.h Examining data/numatop-2.1/common/include/os/os_page.h Examining data/numatop-2.1/common/include/os/os_util.h Examining data/numatop-2.1/common/include/os/plat.h Examining data/numatop-2.1/common/include/os/os_win.h Examining data/numatop-2.1/common/include/os/os_types.h Examining data/numatop-2.1/common/include/os/pfwrapper.h Examining data/numatop-2.1/common/include/os/os_cmd.h Examining data/numatop-2.1/common/include/os/node.h Examining data/numatop-2.1/common/include/os/map.h Examining data/numatop-2.1/common/include/disp.h Examining data/numatop-2.1/common/include/util.h Examining data/numatop-2.1/common/include/lwp.h Examining data/numatop-2.1/common/include/ui_perf_map.h Examining data/numatop-2.1/common/include/reg.h Examining data/numatop-2.1/common/include/win.h Examining data/numatop-2.1/common/include/proc.h Examining data/numatop-2.1/common/include/cmd.h Examining data/numatop-2.1/common/include/perf.h Examining data/numatop-2.1/common/disp.c Examining data/numatop-2.1/common/cmd.c Examining data/numatop-2.1/common/page.c Examining data/numatop-2.1/common/numatop.c Examining data/numatop-2.1/common/util.c Examining data/numatop-2.1/common/proc.c Examining data/numatop-2.1/common/win.c Examining data/numatop-2.1/intel/plat.c Examining data/numatop-2.1/intel/ui_perf_map.c Examining data/numatop-2.1/intel/include/types.h Examining data/numatop-2.1/intel/include/bdw.h Examining data/numatop-2.1/intel/include/skl.h Examining data/numatop-2.1/intel/include/snb.h Examining data/numatop-2.1/intel/include/util.h Examining data/numatop-2.1/intel/include/nhm.h Examining data/numatop-2.1/intel/include/wsm.h Examining data/numatop-2.1/intel/wsm.c Examining data/numatop-2.1/intel/nhm.c Examining data/numatop-2.1/intel/bdw.c Examining data/numatop-2.1/intel/skl.c Examining data/numatop-2.1/intel/snb.c Examining data/numatop-2.1/intel/util.c FINAL RESULTS: data/numatop-2.1/common/os/os_util.c:708:7: [4] (shell) popen: 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. fp = popen(command, type); data/numatop-2.1/common/util.c:132:12: [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. (void) vfprintf(s_logfile, fmt, ap); data/numatop-2.1/common/util.c:143:11: [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. (void) vfprintf(out, fmt, ap); data/numatop-2.1/common/util.c:294:16: [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. (void) vsnprintf(s_exit_msg, EXIT_MSG_SIZE, fmt, ap); data/numatop-2.1/common/util.c:368:10: [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. (void) vfprintf(s_dump_ctl.fout, fmt, ap); data/numatop-2.1/common/util.c:373:7: [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. n = vsnprintf(s_dump_ctl.pcur, data/numatop-2.1/common/util.c:417:9: [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. (void) vfprintf(stderr, format, ap); data/numatop-2.1/common/win.c:2086:11: [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. (void) snprintf(buf, size, "%16"PRIX64"%8s%8s%10.1f%11"PRIu64, data/numatop-2.1/common/win.c:2090:11: [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. (void) snprintf(buf, size, "%16"PRIX64"%8s%8d%10.1f%11"PRIu64, data/numatop-2.1/common/win.c:2178:10: [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). (void) strcpy(dst_desc, src_desc); data/numatop-2.1/common/win.c:2538: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. (void) snprintf(buf, size, "%5d%14.1f%15"PRIu64, data/numatop-2.1/common/numatop.c:83:14: [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 ((c = getopt(argc, argv, "d:l:o:f:t:hf:s:")) != EOF) { data/numatop-2.1/test/mgen/mgen.c:151:14: [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 ((c = getopt(argc, argv, "a:c:hf:t:s:")) != EOF) { data/numatop-2.1/test/mgen/mgen.c:262:2: [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(s_randseed); data/numatop-2.1/common/include/cmd.h: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 desc[WIN_DESCBUF_SIZE]; data/numatop-2.1/common/include/os/map.h:92: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 desc[PATH_MAX]; data/numatop-2.1/common/include/os/plat.h:56: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 desc[PLAT_EVENT_DESC_SIZE]; data/numatop-2.1/common/include/os/sym.h:70: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[SYM_NAME_SIZE]; data/numatop-2.1/common/include/os/sym.h:82: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 path[PATH_MAX]; data/numatop-2.1/common/include/os/sym.h:111: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[SYM_NAME_SIZE]; data/numatop-2.1/common/include/proc.h:70: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[PROC_NAME_SIZE]; data/numatop-2.1/common/include/win.h:208: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 proc_name[WIN_PROCNAME_SIZE]; data/numatop-2.1/common/include/win.h:278: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 desc[WIN_DESCBUF_SIZE]; data/numatop-2.1/common/include/win.h:329: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 content[WIN_LINECHAR_MAX]; data/numatop-2.1/common/include/win.h:337: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 desc[WIN_DESCBUF_SIZE]; data/numatop-2.1/common/include/win.h:362: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 proc_name[WIN_PROCNAME_SIZE]; data/numatop-2.1/common/include/win.h:383: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 proc_name[WIN_PROCNAME_SIZE]; data/numatop-2.1/common/numatop.c:91:18: [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). debug_level = atoi(optarg); data/numatop-2.1/common/numatop.c:106:15: [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 ((log = fopen(optarg, "w")) == NULL) { data/numatop-2.1/common/numatop.c:145:16: [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 ((dump = fopen(optarg, "w")) == NULL) { data/numatop-2.1/common/numatop.c:153:17: [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). g_run_secs = atoi(optarg); data/numatop-2.1/common/numatop.c:374: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[PATH_MAX]; data/numatop-2.1/common/os/map.c:144: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 path[PATH_MAX]; data/numatop-2.1/common/os/map.c:145: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[MAPFILE_LINE_SIZE]; data/numatop-2.1/common/os/map.c:146: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 addr_str[128], attr_str[128], off_str[128]; data/numatop-2.1/common/os/map.c:147: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 fd_str[128], inode_str[128], path_str[PATH_MAX]; data/numatop-2.1/common/os/map.c:148: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 s1[64], s2[64]; data/numatop-2.1/common/os/map.c:156: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 ((fp = fopen(path, "r")) == NULL) { data/numatop-2.1/common/os/map.c:251: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(&proc->map, &new_map, sizeof (map_proc_t)); data/numatop-2.1/common/os/node.c:366: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(info, &node->meminfo, sizeof (node_meminfo_t)); data/numatop-2.1/common/os/os_perf.c:196: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(rec->callchain.ips, ips, IP_NUM * sizeof (uint64_t)); data/numatop-2.1/common/os/os_perf.c:438: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(llrec->callchain.ips, record->ips, IP_NUM * sizeof (uint64_t)); data/numatop-2.1/common/os/os_util.c:86: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 pname[PATH_MAX]; data/numatop-2.1/common/os/os_util.c:91:16: [2] (misc) open: 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 ((procfd = open(pname, O_RDONLY)) < 0) { data/numatop-2.1/common/os/os_util.c:111: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 path[PATH_MAX]; data/numatop-2.1/common/os/os_util.c:170: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 unit[11] = {0}; data/numatop-2.1/common/os/os_util.c:199: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/numatop-2.1/common/os/os_util.c:202:12: [2] (misc) open: 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 = open(CPU0_CPUFREQ_PATH, O_RDONLY)) < 0) { data/numatop-2.1/common/os/os_util.c:337: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 tmp[DIGIT_LEN_MAX]; data/numatop-2.1/common/os/os_util.c:440: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[LINE_SIZE]; data/numatop-2.1/common/os/os_util.c:442: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 ((fp = fopen(path, "r")) == NULL) { data/numatop-2.1/common/os/os_util.c:464: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 path[PATH_MAX]; data/numatop-2.1/common/os/os_util.c:474: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 path[PATH_MAX]; data/numatop-2.1/common/os/os_util.c:492: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 tmp[DIGIT_LEN_MAX]; data/numatop-2.1/common/os/os_util.c:511: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 path[PATH_MAX]; data/numatop-2.1/common/os/os_util.c:519: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 ((fp = fopen(path, "r")) == NULL) { data/numatop-2.1/common/os/os_util.c:596: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[LINE_SIZE]; data/numatop-2.1/common/os/os_util.c:600: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 ((fp = fopen(path, "r")) == NULL) { data/numatop-2.1/common/os/os_util.c:619: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 path[PATH_MAX], buf[32]; data/numatop-2.1/common/os/os_util.c:624:13: [2] (misc) open: 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 = open(path, O_RDONLY)) < 0) data/numatop-2.1/common/os/os_util.c:633:17: [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). qpi[i].type = atoi(buf); data/numatop-2.1/common/os/os_util.c:649: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 path[PATH_MAX], buf[32]; data/numatop-2.1/common/os/os_util.c:654:13: [2] (misc) open: 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 = open(path, O_RDONLY)) < 0) data/numatop-2.1/common/os/os_util.c:663:17: [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). qpi[i].type = atoi(buf); data/numatop-2.1/common/os/os_util.c:679: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 path[PATH_MAX], buf[32]; data/numatop-2.1/common/os/os_util.c:684:13: [2] (misc) open: 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 = open(path, O_RDONLY)) < 0) data/numatop-2.1/common/os/os_util.c:693:17: [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). imc[i].type = atoi(buf); data/numatop-2.1/common/os/os_util.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 path[128]; data/numatop-2.1/common/os/os_util.c:728: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 ((fp = fopen(path, "r")) == NULL) data/numatop-2.1/common/os/os_util.c:737: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 command[128]; data/numatop-2.1/common/os/os_util.c:755: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 command[128]; data/numatop-2.1/common/os/os_util.c:769: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 command[160], path[128]; data/numatop-2.1/common/os/os_util.c:806: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[LINE_SIZE], path[128]; data/numatop-2.1/common/os/os_util.c:818: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 ((fp = fopen(path, "r")) == NULL) data/numatop-2.1/common/os/os_util.c:854: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 dir[128]; data/numatop-2.1/common/os/os_win.c:73: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 mem_all[32], mem_free[32]; data/numatop-2.1/common/os/os_win.c:116: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 s2[128], s3[128]; data/numatop-2.1/common/os/os_win.c:196: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 s1[256]; data/numatop-2.1/common/os/os_win.c:209: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 s1[256], s2[32]; data/numatop-2.1/common/os/os_win.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 content[WIN_LINECHAR_MAX]; data/numatop-2.1/common/os/os_win.c:411: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 content[WIN_LINECHAR_MAX]; data/numatop-2.1/common/os/os_win.c:582: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 content[WIN_LINECHAR_MAX]; data/numatop-2.1/common/os/os_win.c:641: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 content[WIN_LINECHAR_MAX]; data/numatop-2.1/common/os/os_win.c:698: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 content[WIN_LINECHAR_MAX], intval_buf[16]; data/numatop-2.1/common/os/os_win.c:699: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 size_str[32]; data/numatop-2.1/common/os/os_win.c:845: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 content[WIN_LINECHAR_MAX]; data/numatop-2.1/common/os/os_win.c:910: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 content[WIN_LINECHAR_MAX], intval_buf[16], size_str[32]; data/numatop-2.1/common/os/pfwrapper.c:92: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(buf, data + data_tail, ncopies); data/numatop-2.1/common/os/pfwrapper.c:93: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(buf + ncopies, data, size - ncopies); data/numatop-2.1/common/os/pfwrapper.c:95: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(buf, data + data_tail, size); data/numatop-2.1/common/os/pfwrapper.c:383: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(&rec_arr[i], rec, sizeof (pf_profiling_rec_t)); data/numatop-2.1/common/os/pfwrapper.c:587: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(&rec_arr[i], rec, sizeof (pf_ll_rec_t)); data/numatop-2.1/common/os/pfwrapper.c:834: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(qpi->qpi_info[i].values, values, sizeof(values)); data/numatop-2.1/common/os/pfwrapper.c:958: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(imc->imc_info[i].values, values, sizeof(values)); data/numatop-2.1/common/os/sym.c:103: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 e_ident[EI_NIDENT]; data/numatop-2.1/common/os/sym.c:568:20: [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 ((binary->fp = fopen(binary->path, "r")) == NULL) { data/numatop-2.1/common/os/sym.c:1048: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(list, &sortlist, sizeof (sym_chainlist_t)); data/numatop-2.1/common/page.c:130:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(&page->cmd, cmd, sizeof (cmd_t)); data/numatop-2.1/common/perf.c:133:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(&s_perf_ctl.task, task, sizeof (perf_task_t)); data/numatop-2.1/common/proc.c:372:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. (void) memcpy(sort_arr, list->id_arr, data/numatop-2.1/common/reg.c:63: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[WIN_LINECHAR_MAX]; data/numatop-2.1/common/reg.c:79: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[WIN_LINECHAR_MAX]; data/numatop-2.1/common/reg.c:103: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[WIN_LINECHAR_MAX]; data/numatop-2.1/common/reg.c:334: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 content[WIN_LINECHAR_MAX]; data/numatop-2.1/common/util.c:61: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 s_exit_msg[EXIT_MSG_SIZE]; data/numatop-2.1/common/util.c:196:13: [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). if ((id = atoi(dentp->d_name)) == 0) { data/numatop-2.1/common/win.c:65: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 tmp[32]; data/numatop-2.1/common/win.c:161: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 tmp[32]; data/numatop-2.1/common/win.c:372: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 content[WIN_LINECHAR_MAX], intval_buf[16]; data/numatop-2.1/common/win.c:487: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 content[64]; data/numatop-2.1/common/win.c:787: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 content[WIN_LINECHAR_MAX], intval_buf[16]; data/numatop-2.1/common/win.c:921: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 content[WIN_LINECHAR_MAX], intval_buf[16]; data/numatop-2.1/common/win.c:1170: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 tmp[32]; data/numatop-2.1/common/win.c:1292: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 content[WIN_LINECHAR_MAX], intval_buf[16]; data/numatop-2.1/common/win.c:1590: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 content[WIN_LINECHAR_MAX], intval_buf[16]; data/numatop-2.1/common/win.c:1753: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 content[WIN_LINECHAR_MAX], intval_buf[16]; data/numatop-2.1/common/win.c:1938: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 content[WIN_LINECHAR_MAX], event_name[32], intval_buf[16]; data/numatop-2.1/common/win.c:2068: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 size_str[32]; data/numatop-2.1/common/win.c:2293: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 content[WIN_LINECHAR_MAX]; data/numatop-2.1/common/win.c:2358: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 content[WIN_LINECHAR_MAX], intval_buf[16], lat_buf[32]; data/numatop-2.1/common/win.c:2373:3: [2] (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). Risk is low because the source is a constant string. strcpy(lat_buf, "unknown"); data/numatop-2.1/common/win.c:2723: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 content[WIN_LINECHAR_MAX], intval_buf[16]; data/numatop-2.1/common/win.c:2853: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 tmp[32], id[16]; data/numatop-2.1/common/win.c:2993: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 content[WIN_LINECHAR_MAX], intval_buf[16]; data/numatop-2.1/common/win.c:3177: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 id[16], total_bw[16], local_bw[16]; data/numatop-2.1/common/win.c:3319: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 content[WIN_LINECHAR_MAX], intval_buf[16]; data/numatop-2.1/common/win.c:3472: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 content[WIN_LINECHAR_MAX]; data/numatop-2.1/intel/bdw.c:63: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(cfg, &s_bdw_ll, sizeof (plat_event_config_t)); data/numatop-2.1/intel/nhm.c:81: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(cfg, &s_nhm_ll, sizeof (plat_event_config_t)); data/numatop-2.1/intel/nhm.c:87: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(cfg, &s_nhm_ll, sizeof (plat_event_config_t)); data/numatop-2.1/intel/plat.c:116: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 vendor[16]; data/numatop-2.1/intel/skl.c:63: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(cfg, &s_skl_ll, sizeof (plat_event_config_t)); data/numatop-2.1/intel/snb.c:63: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(cfg, &s_snb_ll, sizeof (plat_event_config_t)); data/numatop-2.1/intel/util.c:80:11: [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 ((f = fopen(CPUINFO_PATH, "r")) == NULL) { data/numatop-2.1/intel/wsm.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(cfg, &s_wsm_ll, sizeof (plat_event_config_t)); data/numatop-2.1/intel/wsm.c:83: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(cfg, &s_wsm_ll, sizeof (plat_event_config_t)); data/numatop-2.1/powerpc/power8.c:62: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(cfg, &s_power8_ll, sizeof (plat_event_config_t)); data/numatop-2.1/powerpc/power9.c:62: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(cfg, &s_power9_ll, sizeof (plat_event_config_t)); data/numatop-2.1/powerpc/util.c:55:11: [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 ((f = fopen(CPUINFO_PATH, "r")) == NULL) { data/numatop-2.1/test/mgen/mgen.c:79: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[PATH_MAX]; data/numatop-2.1/test/mgen/mgen.c:159:17: [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). node_alloc = atoi(optarg); data/numatop-2.1/test/mgen/mgen.c:163:19: [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). cpu_consumer = atoi(optarg); data/numatop-2.1/test/mgen/mgen.c:167:15: [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). meas_sec = atoi(optarg); data/numatop-2.1/test/mgen/mgen.c:171:17: [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). s_randseed = atoi(optarg); data/numatop-2.1/common/disp.c:655:9: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(s_cons_ctl.pipe[0], &ch, 1) == 1) { data/numatop-2.1/common/numatop.c:376:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(buffer, exec_name, PATH_MAX); data/numatop-2.1/common/os/map.c:100: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(path) > 0) { data/numatop-2.1/common/os/map.c:101:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(entry->desc, path, PATH_MAX); data/numatop-2.1/common/os/map.c:181:7: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (sscanf(addr_str, "%*[^-]-%63s", s2) <= 0) { data/numatop-2.1/common/os/os_util.c:95:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((len = read(procfd, buf, size)) < 0) { data/numatop-2.1/common/os/os_util.c:206:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if ((i = read(fd, buf, sizeof (buf) - 1)) <= 0) { data/numatop-2.1/common/os/os_util.c:339: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(str) >= DIGIT_LEN_MAX) { data/numatop-2.1/common/os/os_util.c:351:6: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (sscanf(str, "%*[^-]-%511s", tmp) <= 0) { data/numatop-2.1/common/os/os_util.c:387: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(str); data/numatop-2.1/common/os/os_util.c:394:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(scopy, str, len); data/numatop-2.1/common/os/os_util.c:627:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buf, sizeof(buf)) < 0) { data/numatop-2.1/common/os/os_util.c:657:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buf, sizeof(buf)) < 0) { data/numatop-2.1/common/os/os_util.c:687:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (read(fd, buf, sizeof(buf)) < 0) { data/numatop-2.1/common/os/os_win.c:124:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. (void) strncpy(s1, "-", size); data/numatop-2.1/common/os/os_win.c:144:17: [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. (void) strncat(s1, s2, strlen(s2)); data/numatop-2.1/common/os/os_win.c:144: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). (void) strncat(s1, s2, strlen(s2)); data/numatop-2.1/common/os/os_win.c:173:21: [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. (void) strncat(s2, s3, strlen(s3)); data/numatop-2.1/common/os/os_win.c:173: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). (void) strncat(s2, s3, strlen(s3)); data/numatop-2.1/common/os/os_win.c:176:20: [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. (void) strncat(s1, s2, strlen(s2)); data/numatop-2.1/common/os/os_win.c:176: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). (void) strncat(s1, s2, strlen(s2)); data/numatop-2.1/common/os/os_win.c:183:20: [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. (void) strncat(s1, s2, strlen(s2)); data/numatop-2.1/common/os/os_win.c:183: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). (void) strncat(s1, s2, strlen(s2)); data/numatop-2.1/common/os/os_win.c:334: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(line->content) > 0) { data/numatop-2.1/common/os/os_win.c:335:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, line->content, size); data/numatop-2.1/common/os/os_win.c:337:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(buf, " ", size); data/numatop-2.1/common/os/os_win.c:381:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(line->content, chain->entry_arr[k].name, WIN_LINECHAR_MAX); data/numatop-2.1/common/os/os_win.c:386:3: [1] (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). Risk is low because the source is a constant character. strcpy(line->content, ""); data/numatop-2.1/common/os/os_win.c:514:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dyn->desc, cmd->desc, WIN_DESCBUF_SIZE); data/numatop-2.1/common/os/pfwrapper.c:685:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if (((ret = read(fd, buf, left)) < 0) && data/numatop-2.1/common/os/plat.c:80:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cfg->desc, cfg_arr[perf_count_id].desc, PLAT_EVENT_DESC_SIZE); data/numatop-2.1/common/os/sym.c:207:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(item->name, sym_name, SYM_NAME_SIZE); data/numatop-2.1/common/os/sym.c:593:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(binary->path, map->desc, PATH_MAX); data/numatop-2.1/common/os/sym.c:634:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(binary->path, path, PATH_MAX); data/numatop-2.1/common/os/sym.c:931:4: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(entry->name, item->name, SYM_NAME_SIZE); data/numatop-2.1/common/perf.c:476:10: [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. (void) usleep(intval_diff * USEC_MS); data/numatop-2.1/common/reg.c:237:8: [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). len = strlen(content); data/numatop-2.1/common/reg.c:264:8: [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). len = strlen(content); data/numatop-2.1/common/util.c:301: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(s_exit_msg) > 0) { data/numatop-2.1/common/win.c:358:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(line->proc_name, proc->name, sizeof (line->proc_name)); data/numatop-2.1/common/win.c:1826: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(line->content) > 0) { data/numatop-2.1/common/win.c:1827:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(buf, line->content, size); data/numatop-2.1/common/win.c:1829:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. (void) strncpy(buf, " ", size); data/numatop-2.1/common/win.c:1909:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(buf, "RMA", size); data/numatop-2.1/common/win.c:1913:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(buf, "Cycle", size); data/numatop-2.1/common/win.c:1917:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(buf, "IR", size); data/numatop-2.1/common/win.c:1921:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(buf, "LMA", size); data/numatop-2.1/common/win.c:1925:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. (void) strncpy(buf, "-", size); data/numatop-2.1/common/win.c:2177: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 ((src_len = strlen(src_desc)) < dst_size) { data/numatop-2.1/common/win.c:2898:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(line->proc_name, proc->name, sizeof (line->proc_name)); data/numatop-2.1/common/win.c:3222:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(line->proc_name, proc->name, sizeof (line->proc_name)); data/numatop-2.1/common/win.c:3487:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(content, "Perf event counting is failed!", data/numatop-2.1/common/win.c:3492:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(content, "Process exists, " data/numatop-2.1/common/win.c:3498:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(content, "Thread exists, " data/numatop-2.1/common/win.c:3504:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(content, "Please wait ...", data/numatop-2.1/common/win.c:3509:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(content, "Retrieving latency data ...", data/numatop-2.1/common/win.c:3514:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(content, "Function is not implemented yet!", data/numatop-2.1/common/win.c:3519:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(content, "Invalid node id, node might " data/numatop-2.1/common/win.c:3525:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(content, "Cannot retrieve process " data/numatop-2.1/common/win.c:3531:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(content, "Cannot retrieve process " data/numatop-2.1/common/win.c:3537:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(content, "Sampling isn't working properly.", data/numatop-2.1/common/win.c:3542:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. (void) strncpy(content, "Stopping ...", data/numatop-2.1/intel/nhm.c:62:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(cfg->desc, cfg_arr[perf_count_id].desc, PLAT_EVENT_DESC_SIZE); data/numatop-2.1/intel/plat.c:121:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(&vendor[0], (char *)(&ebx), 4); data/numatop-2.1/intel/plat.c:122:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(&vendor[4], (char *)(&ecx), 4); data/numatop-2.1/intel/plat.c:123:9: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). (void) strncpy(&vendor[8], (char *)(&edx), 4); data/numatop-2.1/intel/util.c:89:7: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (sscanf(line + strcspn(line, "@") + 1, "%lf%10s", data/numatop-2.1/powerpc/util.c:64:7: [1] (buffer) sscanf: It's unclear if the %s limit in the format string is small enough (CWE-120). Check that the limit is sufficiently small, or use a different input function. if (sscanf(line + strcspn(line, ":") + 1, "%lf%10s", data/numatop-2.1/test/mgen/mgen.c:81:2: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buffer, exec_name, PATH_MAX); ANALYSIS SUMMARY: Hits = 213 Lines analyzed = 22224 in approximately 0.51 seconds (43937 lines/second) Physical Source Lines of Code (SLOC) = 14931 Hits@level = [0] 186 [1] 69 [2] 130 [3] 3 [4] 11 [5] 0 Hits@level+ = [0+] 399 [1+] 213 [2+] 144 [3+] 14 [4+] 11 [5+] 0 Hits/KSLOC@level+ = [0+] 26.7229 [1+] 14.2656 [2+] 9.64436 [3+] 0.937647 [4+] 0.736722 [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.