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/cpuid-20201006/cpuid.c FINAL RESULTS: data/cpuid-20201006/cpuid.c:1341:15: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. p += sprintf(p, "%s%02d", s1, partialmodel); data/cpuid-20201006/cpuid.c:1342:18: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. if (s2) sprintf(p, "%s", s2); data/cpuid-20201006/cpuid.c:1366:15: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. b += sprintf(b, "%s %s", brand_pre, proc); data/cpuid-20201006/cpuid.c:1367:34: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. if (brand_post != NULL) sprintf(b, " %s", brand_post); data/cpuid-20201006/cpuid.c:2456:17: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. ptr += sprintf(ptr, "%s", synth); data/cpuid-20201006/cpuid.c:2459:20: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. ptr += sprintf(ptr, " [%s]", arch.uarch); data/cpuid-20201006/cpuid.c:2462:20: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. ptr += sprintf(ptr, " {%s}", arch.family); data/cpuid-20201006/cpuid.c:2465:20: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. ptr += sprintf(ptr, ", %s", arch.phys); data/cpuid-20201006/cpuid.c:4300:7: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(buffer, "%s %s", result, proc); data/cpuid-20201006/cpuid.c:5161:20: [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. #define ACT(str) (printf(str)) data/cpuid-20201006/cpuid.c:5400:15: [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. printf(CONT "data TLB: 1G pages, 4-way, 4 entries"); break; data/cpuid-20201006/cpuid.c:9931:18: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. int opt = getopt_long(argc, argv, shortopts, longopts, &longindex); data/cpuid-20201006/cpuid.c:349:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char brand[48+1]; data/cpuid-20201006/cpuid.c:350:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char transmeta_info[64+1]; data/cpuid-20201006/cpuid.c:351:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char override_brand[48*2+1]; data/cpuid-20201006/cpuid.c:352:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char soc_brand[48+1]; data/cpuid-20201006/cpuid.c:527:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", XX); data/cpuid-20201006/cpuid.c:531:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", XX); data/cpuid-20201006/cpuid.c:535:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "FX-%02d", ZZ); data/cpuid-20201006/cpuid.c:540:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", XX); data/cpuid-20201006/cpuid.c:544:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", XX); data/cpuid-20201006/cpuid.c:548:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "ML-%02d", XX); data/cpuid-20201006/cpuid.c:552:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "MT-%02d", XX); data/cpuid-20201006/cpuid.c:557:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 1%02d", YY); data/cpuid-20201006/cpuid.c:561:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 1%02d HE", YY); data/cpuid-20201006/cpuid.c:565:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 1%02d EE", YY); data/cpuid-20201006/cpuid.c:570:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 2%02d", YY); data/cpuid-20201006/cpuid.c:574:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 2%02d HE", YY); data/cpuid-20201006/cpuid.c:578:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 2%02d EE", YY); data/cpuid-20201006/cpuid.c:583:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 8%02d", YY); data/cpuid-20201006/cpuid.c:587:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 8%02d HE", YY); data/cpuid-20201006/cpuid.c:591:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 8%02d EE", YY); data/cpuid-20201006/cpuid.c:595:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", EE); data/cpuid-20201006/cpuid.c:599:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", XX); data/cpuid-20201006/cpuid.c:603:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", XX); data/cpuid-20201006/cpuid.c:607:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", XX); data/cpuid-20201006/cpuid.c:612:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", TT); data/cpuid-20201006/cpuid.c:617:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", TT); data/cpuid-20201006/cpuid.c:621:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "FX-%02d", ZZ); data/cpuid-20201006/cpuid.c:629:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 1%02d", RR); data/cpuid-20201006/cpuid.c:637:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 2%02d", RR); data/cpuid-20201006/cpuid.c:645:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 8%02d", RR); data/cpuid-20201006/cpuid.c:649:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 1%02d HE", RR); data/cpuid-20201006/cpuid.c:653:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 1%02d EE", RR); data/cpuid-20201006/cpuid.c:657:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 2%02d HE", RR); data/cpuid-20201006/cpuid.c:661:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 2%02d EE", RR); data/cpuid-20201006/cpuid.c:665:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 8%02d HE", RR); data/cpuid-20201006/cpuid.c:669:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 8%02d EE", RR); data/cpuid-20201006/cpuid.c:717:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 22%02d EE", RR); data/cpuid-20201006/cpuid.c:721:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 22%02d EE", RR); data/cpuid-20201006/cpuid.c:725:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 12%02d EE", RR); data/cpuid-20201006/cpuid.c:729:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 12%02d HE", RR); data/cpuid-20201006/cpuid.c:733:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 22%02d HE", RR); data/cpuid-20201006/cpuid.c:737:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 22%02d", RR); data/cpuid-20201006/cpuid.c:741:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 22%02d SE", RR); data/cpuid-20201006/cpuid.c:745:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 82%02d EE", RR); data/cpuid-20201006/cpuid.c:749:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 82%02d HE", RR); data/cpuid-20201006/cpuid.c:753:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 82%02d", RR); data/cpuid-20201006/cpuid.c:757:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 82%02d SE", RR); data/cpuid-20201006/cpuid.c:761:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "FX-%02d", ZZ); data/cpuid-20201006/cpuid.c:766:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor LE-1%02d0", RR); data/cpuid-20201006/cpuid.c:770:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor LE-1%02d0", ZZ); data/cpuid-20201006/cpuid.c:774:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 1%02d0B", ZZ); data/cpuid-20201006/cpuid.c:783:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", TT); data/cpuid-20201006/cpuid.c:787:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d50p", RR); data/cpuid-20201006/cpuid.c:792:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", TT); data/cpuid-20201006/cpuid.c:797:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d0U", TT); data/cpuid-20201006/cpuid.c:802:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d50e", TT); data/cpuid-20201006/cpuid.c:806:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor MV-%02d", TT); data/cpuid-20201006/cpuid.c:810:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 2%02dU", RR); data/cpuid-20201006/cpuid.c:814:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 12%02d HE", RR); data/cpuid-20201006/cpuid.c:818:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 12%02d", RR); data/cpuid-20201006/cpuid.c:822:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor 12%02d SE", RR); data/cpuid-20201006/cpuid.c:826:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor BE-2%02d0", TT); data/cpuid-20201006/cpuid.c:834:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", TT); data/cpuid-20201006/cpuid.c:838:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "FX-%02d", ZZ); data/cpuid-20201006/cpuid.c:843:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00", RR); data/cpuid-20201006/cpuid.c:847:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d50e", TT); data/cpuid-20201006/cpuid.c:852:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00B", TT); data/cpuid-20201006/cpuid.c:856:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d50B", TT); data/cpuid-20201006/cpuid.c:860:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d50e", TT); data/cpuid-20201006/cpuid.c:865:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d50e", TT); data/cpuid-20201006/cpuid.c:869:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor L6%02d", RR); data/cpuid-20201006/cpuid.c:873:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor L3%02d", RR); data/cpuid-20201006/cpuid.c:878:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", TT); data/cpuid-20201006/cpuid.c:882:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "MK-%02d", YY); data/cpuid-20201006/cpuid.c:886:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", TT); data/cpuid-20201006/cpuid.c:891:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", PP); data/cpuid-20201006/cpuid.c:895:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", TT); data/cpuid-20201006/cpuid.c:901:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor TF-%02d", TT); data/cpuid-20201006/cpuid.c:905:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor L1%02d", RR); data/cpuid-20201006/cpuid.c:909:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor TJ-%02d", YY); data/cpuid-20201006/cpuid.c:913:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor TL-%02d", YY); data/cpuid-20201006/cpuid.c:918:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor TK-%02d", YY); data/cpuid-20201006/cpuid.c:922:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor %02d00+", TT); data/cpuid-20201006/cpuid.c:926:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor L3%02d", RR); data/cpuid-20201006/cpuid.c:930:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(proc, "Processor L5%02d", RR); data/cpuid-20201006/cpuid.c:1362:7: [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[96]; data/cpuid-20201006/cpuid.c:2453:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[1024]; data/cpuid-20201006/cpuid.c:4296:4: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char proc[96]; data/cpuid-20201006/cpuid.c:4299:14: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char buffer[1024]; data/cpuid-20201006/cpuid.c:8528:7: [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(&stash->transmeta_info[0], words, sizeof(unsigned int)*WORD_NUM); data/cpuid-20201006/cpuid.c:8530:7: [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(&stash->transmeta_info[16], words, sizeof(unsigned int)*WORD_NUM); data/cpuid-20201006/cpuid.c:8532:7: [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(&stash->transmeta_info[32], words, sizeof(unsigned int)*WORD_NUM); data/cpuid-20201006/cpuid.c:8534:7: [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(&stash->transmeta_info[48], words, sizeof(unsigned int)*WORD_NUM); data/cpuid-20201006/cpuid.c:8754:10: [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(&stash->soc_brand[0], words, sizeof(unsigned int)*WORD_NUM); data/cpuid-20201006/cpuid.c:8756:10: [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(&stash->soc_brand[16], words, sizeof(unsigned int)*WORD_NUM); data/cpuid-20201006/cpuid.c:8758:10: [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(&stash->soc_brand[32], words, sizeof(unsigned int)*WORD_NUM); data/cpuid-20201006/cpuid.c:8943:7: [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(&stash->brand[0], words, sizeof(unsigned int)*WORD_NUM); data/cpuid-20201006/cpuid.c:8945:7: [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(&stash->brand[16], words, sizeof(unsigned int)*WORD_NUM); data/cpuid-20201006/cpuid.c:8947:7: [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(&stash->brand[32], words, sizeof(unsigned int)*WORD_NUM); data/cpuid-20201006/cpuid.c:9176:7: [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 cpuid_name[20]; data/cpuid-20201006/cpuid.c:9179:21: [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). cpuid_fd = open("/dev/cpuid", O_RDONLY); data/cpuid-20201006/cpuid.c:9189:10: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(cpuid_name, "/dev/cpu/%u/cpuid", cpu); data/cpuid-20201006/cpuid.c:9190:21: [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). cpuid_fd = open(cpuid_name, O_RDONLY); data/cpuid-20201006/cpuid.c:9216:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char tmpname[20]; data/cpuid-20201006/cpuid.c:9218:10: [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(tmpname, "/tmp/cpuidXXXXXX"); data/cpuid-20201006/cpuid.c:9219:21: [2] (tmpfile) mkstemp: Potential for temporary file vulnerability in some circumstances. Some older Unix-like systems create temp files with permission to write by all by default, so be sure to set the umask to override this. Also, some older Unix systems might fail to use O_EXCL when opening the file, so make sure that O_EXCL is used by the library (CWE-377). dummy_fd = mkstemp(tmpname); data/cpuid-20201006/cpuid.c:9228:30: [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). cpuid_fd = open(tmpname, O_RDONLY); data/cpuid-20201006/cpuid.c:9783:14: [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 = fopen(filename, "r"); data/cpuid-20201006/cpuid.c:9793:7: [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[88]; data/cpuid-20201006/cpuid.c:201:28: [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). result = MAX(result, strlen(names[i].name)); data/cpuid-20201006/cpuid.c:6058:31: [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 feature_pad = 17-strlen(feature); data/cpuid-20201006/cpuid.c:9297:16: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). status = read(cpuid_fd, words, 16); ANALYSIS SUMMARY: Hits = 124 Lines analyzed = 10064 in approximately 0.46 seconds (21792 lines/second) Physical Source Lines of Code (SLOC) = 8760 Hits@level = [0] 507 [1] 3 [2] 109 [3] 1 [4] 11 [5] 0 Hits@level+ = [0+] 631 [1+] 124 [2+] 121 [3+] 12 [4+] 11 [5+] 0 Hits/KSLOC@level+ = [0+] 72.032 [1+] 14.1553 [2+] 13.8128 [3+] 1.36986 [4+] 1.25571 [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.