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/node-crc-3.8.0+ds/test/pycrc/test/main.c FINAL RESULTS: data/node-crc-3.8.0+ds/test/pycrc/test/main.c:272:13: [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(format, "poly", (unsigned int)cfg.poly); data/node-crc-3.8.0+ds/test/pycrc/test/main.c:274:13: [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(format, "xor_in", cfg.xor_in); data/node-crc-3.8.0+ds/test/pycrc/test/main.c:276:13: [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(format, "xor_out", (unsigned int)cfg.xor_out); data/node-crc-3.8.0+ds/test/pycrc/test/main.c:277:13: [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(format, "crc_mask", (unsigned int)cfg.crc_mask); data/node-crc-3.8.0+ds/test/pycrc/test/main.c:278:13: [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(format, "msb_mask", (unsigned int)cfg.msb_mask); data/node-crc-3.8.0+ds/test/pycrc/test/main.c:107:13: [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. c = getopt_long(argc, argv, "w:p:ni:uo:v", long_options, &option_index); data/node-crc-3.8.0+ds/test/pycrc/test/main.c:40: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 unsigned char str[256] = "123456789"; data/node-crc-3.8.0+ds/test/pycrc/test/main.c:48:22: [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). return (bool)atoi(str); data/node-crc-3.8.0+ds/test/pycrc/test/main.c:118:30: [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). cfg->width = atoi(optarg); data/node-crc-3.8.0+ds/test/pycrc/test/main.c:237:5: [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[20]; data/node-crc-3.8.0+ds/test/pycrc/test/main.c:136: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). memcpy(str, optarg, strlen(optarg) < sizeof(str) ? strlen(optarg) + 1 : sizeof(str)); data/node-crc-3.8.0+ds/test/pycrc/test/main.c:136:68: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). memcpy(str, optarg, strlen(optarg) < sizeof(str) ? strlen(optarg) + 1 : sizeof(str)); data/node-crc-3.8.0+ds/test/pycrc/test/main.c:246:58: [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). crc = crc_pre_final = crc_update(&cfg, crc, str, strlen((char *)str)); ANALYSIS SUMMARY: Hits = 13 Lines analyzed = 283 in approximately 0.03 seconds (9468 lines/second) Physical Source Lines of Code (SLOC) = 227 Hits@level = [0] 12 [1] 3 [2] 4 [3] 1 [4] 5 [5] 0 Hits@level+ = [0+] 25 [1+] 13 [2+] 10 [3+] 6 [4+] 5 [5+] 0 Hits/KSLOC@level+ = [0+] 110.132 [1+] 57.2687 [2+] 44.0529 [3+] 26.4317 [4+] 22.0264 [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.