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/libcpuid-0.5.0+repack1/cpuid_tool/cpuid_tool.c Examining data/libcpuid-0.5.0+repack1/libcpuid/amd_code_t.h Examining data/libcpuid-0.5.0+repack1/libcpuid/asm-bits.c Examining data/libcpuid-0.5.0+repack1/libcpuid/asm-bits.h Examining data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c Examining data/libcpuid-0.5.0+repack1/libcpuid/embed_drivers.cpp Examining data/libcpuid-0.5.0+repack1/libcpuid/intel_code_t.h Examining data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_constants.h Examining data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_internal.h Examining data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_types.h Examining data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_util.c Examining data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_util.h Examining data/libcpuid-0.5.0+repack1/libcpuid/msrdriver.c Examining data/libcpuid-0.5.0+repack1/libcpuid/rdmsr.c Examining data/libcpuid-0.5.0+repack1/libcpuid/rdtsc.c Examining data/libcpuid-0.5.0+repack1/libcpuid/rdtsc.h Examining data/libcpuid-0.5.0+repack1/libcpuid/recog_amd.c Examining data/libcpuid-0.5.0+repack1/libcpuid/recog_amd.h Examining data/libcpuid-0.5.0+repack1/libcpuid/recog_intel.c Examining data/libcpuid-0.5.0+repack1/libcpuid/recog_intel.h Examining data/libcpuid-0.5.0+repack1/libcpuid/libcpuid.h Examining data/libcpuid-0.5.0+repack1/tests/convert_instlatx64.c FINAL RESULTS: data/libcpuid-0.5.0+repack1/cpuid_tool/cpuid_tool.c:236:4: [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). strcpy(raw_data_file, arg + 7); data/libcpuid-0.5.0+repack1/cpuid_tool/cpuid_tool.c:250:4: [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). strcpy(raw_data_file, arg + 7); data/libcpuid-0.5.0+repack1/cpuid_tool/cpuid_tool.c:257:4: [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). strcpy(out_file, arg + 10); data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:78:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(format, "%s[%%d]", expected_token); data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:80:11: [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. if (1 == sscanf(token, format, &index) && index >=0 && index < limit) { data/libcpuid-0.5.0+repack1/libcpuid/embed_drivers.cpp:21:2: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(fn, "%s%s", drivers_root, filename); data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_util.c:53:10: [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. # define vsnprintf _vsnprintf data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_util.c:61: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(buff, sizeof(buff), format, va); data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_util.c:72: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(buff, sizeof(buff), format, va); data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_util.c:129:2: [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). strcpy(data->cpu_codename, matchtable[bestindex].name); data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_util.h:54:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 1, 2))) data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_util.h:59:23: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. __attribute__((format(printf, 2, 3))) data/libcpuid-0.5.0+repack1/libcpuid/rdmsr.c:50:29: [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. const int file_exists = !access(msr_path, F_OK); data/libcpuid-0.5.0+repack1/libcpuid/rdmsr.c:51:29: [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. const int file_readable = !access(msr_path, R_OK); data/libcpuid-0.5.0+repack1/libcpuid/rdmsr.c:60:11: [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. return !system("modprobe msr 2> /dev/null"); data/libcpuid-0.5.0+repack1/libcpuid/rdmsr.c:134:29: [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. const int file_exists = !access(msr_path, F_OK); data/libcpuid-0.5.0+repack1/libcpuid/rdmsr.c:135:29: [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. const int file_readable = !access(msr_path, R_OK); data/libcpuid-0.5.0+repack1/libcpuid/rdmsr.c:144:11: [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. return !system("kldload -n cpuctl 2> /dev/null"); data/libcpuid-0.5.0+repack1/tests/convert_instlatx64.c:132:5: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. if(system(cmd)) data/libcpuid-0.5.0+repack1/tests/convert_instlatx64.c:142:6: [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(cmd)) data/libcpuid-0.5.0+repack1/cpuid_tool/cpuid_tool.c:57:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char raw_data_file[256] = ""; data/libcpuid-0.5.0+repack1/cpuid_tool/cpuid_tool.c:58:1: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char out_file[256] = ""; data/libcpuid-0.5.0+repack1/cpuid_tool/cpuid_tool.c:212: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(raw_data_file, "raw.txt"); data/libcpuid-0.5.0+repack1/cpuid_tool/cpuid_tool.c:213: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(out_file, "report.txt"); data/libcpuid-0.5.0+repack1/cpuid_tool/cpuid_tool.c:564:10: [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). fout = fopen(out_file, "wt"); data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:72: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/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:275:38: [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. const struct { cpu_vendor_t vendor; char match[16]; } data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:291: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(vendor_str + 0, &raw_vendor[1], 4); data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:292: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(vendor_str + 4, &raw_vendor[3], 4); data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:293: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(vendor_str + 8, &raw_vendor[2], 4); data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:308: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 brandstr[64] = {0}; data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:332:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(brandstr + i * 16 + j * 4, data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:358: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(list->names[n], &csv[last + 1], i - last - 1); data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:440:7: [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). f = fopen(filename, "wt"); data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:481: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[100]; data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:482: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 token[100]; data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:494:7: [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). f = fopen(filename, "rt"); data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:753: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_str[VENDOR_STR_MAX]; data/libcpuid-0.5.0+repack1/libcpuid/embed_drivers.cpp:20: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 fn[512]; data/libcpuid-0.5.0+repack1/libcpuid/embed_drivers.cpp:22: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). FILE* f = fopen(fn, "rb"); data/libcpuid-0.5.0+repack1/libcpuid/embed_drivers.cpp:37: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). FILE* f = fopen(filename, "rt"); data/libcpuid-0.5.0+repack1/libcpuid/embed_drivers.cpp:39: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[200]; data/libcpuid-0.5.0+repack1/libcpuid/embed_drivers.cpp:71: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). FILE* f = fopen(sourcefile, "wt"); data/libcpuid-0.5.0+repack1/libcpuid/libcpuid.h:234: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_str[VENDOR_STR_MAX]; data/libcpuid-0.5.0+repack1/libcpuid/libcpuid.h:237: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 brand_str[BRAND_STR_MAX]; data/libcpuid-0.5.0+repack1/libcpuid/libcpuid.h:370: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 cpu_codename[64]; data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_util.c:57: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 buff[1024]; data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_util.c:68: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 buff[1024]; data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_util.h:44: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[32]; data/libcpuid-0.5.0+repack1/libcpuid/rdmsr.c: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 msr[MSR_PATH_LEN]; data/libcpuid-0.5.0+repack1/libcpuid/rdmsr.c:85:11: [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). int fd = open(msr, O_RDONLY); data/libcpuid-0.5.0+repack1/libcpuid/rdmsr.c:154: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 msr[MSR_PATH_LEN]; data/libcpuid-0.5.0+repack1/libcpuid/rdmsr.c:169:11: [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). int fd = open(msr, O_RDONLY); data/libcpuid-0.5.0+repack1/libcpuid/rdmsr.c:220: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 driver_path[MAX_PATH + 1]; data/libcpuid-0.5.0+repack1/libcpuid/rdmsr.c:287:2: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(driver->driver_path, "TmpRdr.sys"); data/libcpuid-0.5.0+repack1/libcpuid/rdmsr.c:289:6: [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). f = fopen(driver->driver_path, "wb"); data/libcpuid-0.5.0+repack1/libcpuid/rdmsr.c:1029:7: [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). f = fopen(filename, "wt"); data/libcpuid-0.5.0+repack1/libcpuid/rdtsc.c:130: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[1024], *s; data/libcpuid-0.5.0+repack1/libcpuid/rdtsc.c:133:6: [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). f = fopen("/proc/cpuinfo", "rt"); data/libcpuid-0.5.0+repack1/libcpuid/recog_amd.c:453: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 code[3] = {0}; data/libcpuid-0.5.0+repack1/tests/convert_instlatx64.c:61: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[LINE_LEN], raw_filename[FILENAME_LEN], report_filename[FILENAME_LEN], cmd[CMD_LEN]; data/libcpuid-0.5.0+repack1/tests/convert_instlatx64.c:78: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((fin = fopen(input_filename, "r")) == NULL) data/libcpuid-0.5.0+repack1/tests/convert_instlatx64.c:83: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((fout = fopen(raw_filename, "w")) == NULL) data/libcpuid-0.5.0+repack1/cpuid_tool/cpuid_tool.c:184:13: [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). l = (int) strlen(matchtable[i].synopsis); data/libcpuid-0.5.0+repack1/cpuid_tool/cpuid_tool.c:232: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). if (strlen(arg) <= 7) { data/libcpuid-0.5.0+repack1/cpuid_tool/cpuid_tool.c:246: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). if (strlen(arg) <= 7) { data/libcpuid-0.5.0+repack1/cpuid_tool/cpuid_tool.c:254: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). if (strlen(arg) <= 10) { data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:77: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). if (strncmp(token, expected_token, strlen(expected_token))) return 1; /* not what we search for */ data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:337:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(data->brand_str, brandstr + i, sizeof(data->brand_str)); data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:348: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). l = (int) strlen(csv); data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:498: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). len = (int) strlen(line); data/libcpuid-0.5.0+repack1/libcpuid/cpuid_main.c:507:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(token, line, i); data/libcpuid-0.5.0+repack1/libcpuid/embed_drivers.cpp:41: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). int i = (int) strlen(line); data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_util.c:177: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). n = (int) strlen(s); data/libcpuid-0.5.0+repack1/libcpuid/libcpuid_util.c:178: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). m = (int) strlen(p); data/libcpuid-0.5.0+repack1/libcpuid/recog_amd.c:455: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). l = (int) strlen(bs); data/libcpuid-0.5.0+repack1/libcpuid/recog_intel.c:803:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). int l = (int) strlen(data->brand_str); ANALYSIS SUMMARY: Hits = 77 Lines analyzed = 8156 in approximately 0.54 seconds (15113 lines/second) Physical Source Lines of Code (SLOC) = 5810 Hits@level = [0] 180 [1] 14 [2] 43 [3] 0 [4] 20 [5] 0 Hits@level+ = [0+] 257 [1+] 77 [2+] 63 [3+] 20 [4+] 20 [5+] 0 Hits/KSLOC@level+ = [0+] 44.2341 [1+] 13.253 [2+] 10.8434 [3+] 3.44234 [4+] 3.44234 [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.