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/libm4rie-20200125/m4rie/gf2x.h Examining data/libm4rie-20200125/m4rie/gf2e.h Examining data/libm4rie-20200125/m4rie/mzed.h Examining data/libm4rie-20200125/m4rie/m4rie.h Examining data/libm4rie-20200125/m4rie/m4ri_functions.h Examining data/libm4rie-20200125/m4rie/newton_john.h Examining data/libm4rie-20200125/m4rie/echelonform.h Examining data/libm4rie-20200125/m4rie/strassen.h Examining data/libm4rie-20200125/m4rie/mzd_slice.h Examining data/libm4rie-20200125/m4rie/mzd_poly.h Examining data/libm4rie-20200125/m4rie/mzd_ptr.h Examining data/libm4rie-20200125/m4rie/blm.h Examining data/libm4rie-20200125/m4rie/trsm.h Examining data/libm4rie-20200125/m4rie/ple.h Examining data/libm4rie-20200125/m4rie/permutation.h Examining data/libm4rie-20200125/m4rie/conversion.h Examining data/libm4rie-20200125/m4rie/gf2e.c Examining data/libm4rie-20200125/m4rie/mzed.c Examining data/libm4rie-20200125/m4rie/newton_john.c Examining data/libm4rie-20200125/m4rie/echelonform.c Examining data/libm4rie-20200125/m4rie/strassen.c Examining data/libm4rie-20200125/m4rie/mzd_slice.c Examining data/libm4rie-20200125/m4rie/mzd_poly.c Examining data/libm4rie-20200125/m4rie/mzd_ptr.c Examining data/libm4rie-20200125/m4rie/karatsuba.c Examining data/libm4rie-20200125/m4rie/blm.c Examining data/libm4rie-20200125/m4rie/trsm.c Examining data/libm4rie-20200125/m4rie/ple.c Examining data/libm4rie-20200125/m4rie/conversion.c Examining data/libm4rie-20200125/m4rie/conversion_slice8.c Examining data/libm4rie-20200125/m4rie/conversion_slice16.c Examining data/libm4rie-20200125/m4rie/conversion_cling8.c Examining data/libm4rie-20200125/m4rie/conversion_cling16.c Examining data/libm4rie-20200125/tests/test_elimination.c Examining data/libm4rie-20200125/tests/test_multiplication.c Examining data/libm4rie-20200125/tests/test_ple.c Examining data/libm4rie-20200125/tests/test_smallops.c Examining data/libm4rie-20200125/tests/test_trsm.c Examining data/libm4rie-20200125/tests/testing.h Examining data/libm4rie-20200125/bench/cpucycles-20060326/alpha.c Examining data/libm4rie-20200125/bench/cpucycles-20060326/amd64cpuinfo.c Examining data/libm4rie-20200125/bench/cpucycles-20060326/amd64tscfreq.c Examining data/libm4rie-20200125/bench/cpucycles-20060326/clockmonotonic.c Examining data/libm4rie-20200125/bench/cpucycles-20060326/gettimeofday.c Examining data/libm4rie-20200125/bench/cpucycles-20060326/hppapstat.c Examining data/libm4rie-20200125/bench/cpucycles-20060326/powerpcaix.c Examining data/libm4rie-20200125/bench/cpucycles-20060326/powerpclinux.c Examining data/libm4rie-20200125/bench/cpucycles-20060326/powerpcmacos.c Examining data/libm4rie-20200125/bench/cpucycles-20060326/sparc32psrinfo.c Examining data/libm4rie-20200125/bench/cpucycles-20060326/sparcpsrinfo.c Examining data/libm4rie-20200125/bench/cpucycles-20060326/test.c Examining data/libm4rie-20200125/bench/cpucycles-20060326/x86cpuinfo.c Examining data/libm4rie-20200125/bench/cpucycles-20060326/x86tscfreq.c Examining data/libm4rie-20200125/bench/cpucycles-20060326/alpha.h Examining data/libm4rie-20200125/bench/cpucycles-20060326/amd64cpuinfo.h Examining data/libm4rie-20200125/bench/cpucycles-20060326/amd64tscfreq.h Examining data/libm4rie-20200125/bench/cpucycles-20060326/clockmonotonic.h Examining data/libm4rie-20200125/bench/cpucycles-20060326/cpucycles.h Examining data/libm4rie-20200125/bench/cpucycles-20060326/gettimeofday.h Examining data/libm4rie-20200125/bench/cpucycles-20060326/hppapstat.h Examining data/libm4rie-20200125/bench/cpucycles-20060326/powerpcaix.h Examining data/libm4rie-20200125/bench/cpucycles-20060326/powerpclinux.h Examining data/libm4rie-20200125/bench/cpucycles-20060326/powerpcmacos.h Examining data/libm4rie-20200125/bench/cpucycles-20060326/sparc32psrinfo.h Examining data/libm4rie-20200125/bench/cpucycles-20060326/sparcpsrinfo.h Examining data/libm4rie-20200125/bench/cpucycles-20060326/x86cpuinfo.h Examining data/libm4rie-20200125/bench/cpucycles-20060326/x86tscfreq.h Examining data/libm4rie-20200125/bench/bench_elimination.c Examining data/libm4rie-20200125/bench/benchmarking.c Examining data/libm4rie-20200125/bench/benchmarking.h Examining data/libm4rie-20200125/bench/bench_multiplication.c Examining data/libm4rie-20200125/bench/bench_ple.c Examining data/libm4rie-20200125/bench/bench_smallops.c Examining data/libm4rie-20200125/bench/bench_trsm.c FINAL RESULTS: data/libm4rie-20200125/bench/cpucycles-20060326/powerpcaix.c:47: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. f = popen("/usr/sbin/lsattr -E -l proc0 -a frequency","r"); data/libm4rie-20200125/bench/cpucycles-20060326/sparc32psrinfo.c:22: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. f = popen("/usr/sbin/psrinfo -v","r"); data/libm4rie-20200125/bench/cpucycles-20060326/sparcpsrinfo.c:17: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. f = popen("/usr/sbin/psrinfo -v","r"); data/libm4rie-20200125/m4rie/mzd_slice.c:74:7: [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(formatstr,(int)tmp); data/libm4rie-20200125/m4rie/mzed.c:264:7: [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(formatstr,(int)tmp); data/libm4rie-20200125/bench/bench_elimination.c:134:3: [3] (random) srandom: 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. srandom(17); data/libm4rie-20200125/bench/bench_multiplication.c:135:3: [3] (random) srandom: 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. srandom(17); data/libm4rie-20200125/bench/bench_ple.c:86:3: [3] (random) srandom: 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. srandom(17); data/libm4rie-20200125/bench/bench_smallops.c:119:3: [3] (random) srandom: 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. srandom(17); data/libm4rie-20200125/bench/bench_trsm.c:27:32: [3] (random) random: 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. mzed_write_elem(A, i, i, random()&bitmask) ; data/libm4rie-20200125/bench/bench_trsm.c:76:37: [3] (random) random: 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. mzd_slice_write_elem(A, i, i, random()&bitmask) ; data/libm4rie-20200125/bench/bench_trsm.c:156:3: [3] (random) srandom: 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. srandom(17); data/libm4rie-20200125/bench/benchmarking.c:722:13: [3] (random) random: 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. word a0 = random(); data/libm4rie-20200125/bench/benchmarking.c:723:13: [3] (random) random: 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. word a1 = random(); data/libm4rie-20200125/bench/benchmarking.c:724:13: [3] (random) random: 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. word a2 = random(); data/libm4rie-20200125/m4rie/mzed.c:48:30: [3] (random) random: 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. mzed_write_elem(A,r,c, random()&bitmask); data/libm4rie-20200125/tests/test_elimination.c:90:3: [3] (random) srandom: 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. srandom(17); data/libm4rie-20200125/tests/test_multiplication.c:129:12: [3] (random) random: 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. word a = random() & ((1<<ff->degree)-1); data/libm4rie-20200125/tests/test_multiplication.c:131:9: [3] (random) random: 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. a = random() & ((1<<ff->degree)-1); data/libm4rie-20200125/tests/test_multiplication.c:222:3: [3] (random) srandom: 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. srandom(17); data/libm4rie-20200125/tests/test_ple.c:208:3: [3] (random) srandom: 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. srandom(17); data/libm4rie-20200125/tests/test_trsm.c:37:32: [3] (random) random: 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. mzed_write_elem(U, i, i, random()&bitmask) ; data/libm4rie-20200125/tests/test_trsm.c:52:32: [3] (random) random: 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. mzed_write_elem(L, i, i, random()&bitmask) ; data/libm4rie-20200125/tests/test_trsm.c:67:37: [3] (random) random: 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. mzd_slice_write_elem(U, i, i, random()&bitmask) ; data/libm4rie-20200125/tests/test_trsm.c:82:37: [3] (random) random: 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. mzd_slice_write_elem(L, i, i, random()&bitmask) ; data/libm4rie-20200125/tests/test_trsm.c:128:32: [3] (random) random: 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. mzed_write_elem(U, i, i, random()&bitmask) ; data/libm4rie-20200125/tests/test_trsm.c:203:32: [3] (random) random: 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. mzed_write_elem(L, i, i, random()&bitmask) ; data/libm4rie-20200125/tests/test_trsm.c:281:37: [3] (random) random: 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. mzd_slice_write_elem(U, i, i, random()&bitmask) ; data/libm4rie-20200125/tests/test_trsm.c:360:37: [3] (random) random: 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. mzd_slice_write_elem(L, i, i, random()&bitmask) ; data/libm4rie-20200125/tests/test_trsm.c:421:3: [3] (random) srandom: 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. srandom(17); data/libm4rie-20200125/tests/testing.h:163:22: [3] (random) random: 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. const rci_t ii = random() % A->nrows; data/libm4rie-20200125/tests/testing.h:167:22: [3] (random) random: 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. const rci_t ii = random() % A->ncols; data/libm4rie-20200125/tests/testing.h:178:15: [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, "l")) != -1) { data/libm4rie-20200125/bench/bench_elimination.c:116:14: [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). params.k = atoi(argv[1]); data/libm4rie-20200125/bench/bench_elimination.c:117:14: [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). params.m = atoi(argv[2]); data/libm4rie-20200125/bench/bench_elimination.c:118:14: [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). params.n = atoi(argv[3]); data/libm4rie-20200125/bench/bench_multiplication.c:116:14: [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). params.k = atoi(argv[1]); data/libm4rie-20200125/bench/bench_multiplication.c:117:14: [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). params.m = atoi(argv[2]); data/libm4rie-20200125/bench/bench_multiplication.c:118:14: [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). params.n = atoi(argv[3]); data/libm4rie-20200125/bench/bench_ple.c:70:14: [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). params.k = atoi(argv[1]); data/libm4rie-20200125/bench/bench_ple.c:71:14: [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). params.m = atoi(argv[2]); data/libm4rie-20200125/bench/bench_ple.c:72:14: [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). params.n = atoi(argv[3]); data/libm4rie-20200125/bench/bench_ple.c:78:16: [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). params.c = atoi(argv[5]); data/libm4rie-20200125/bench/bench_smallops.c:115:14: [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). params.k = atoi(argv[1]); data/libm4rie-20200125/bench/bench_smallops.c:116:14: [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). params.m = atoi(argv[2]); data/libm4rie-20200125/bench/bench_smallops.c:117:14: [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). params.n = atoi(argv[3]); data/libm4rie-20200125/bench/bench_trsm.c:139:14: [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). params.e = atoi(argv[1]); data/libm4rie-20200125/bench/bench_trsm.c:140:14: [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). params.m = atoi(argv[2]); data/libm4rie-20200125/bench/bench_trsm.c:141:14: [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). params.n = atoi(argv[3]); data/libm4rie-20200125/bench/bench_trsm.c:152:21: [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). params.cutoff = atoi(argv[7]); data/libm4rie-20200125/bench/benchmarking.c:125: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. static char buf[PAPI_MAX_STR_LEN]; data/libm4rie-20200125/bench/benchmarking.c:202:25: [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). bench_dump_counter = atoi((*argvp)[1]); data/libm4rie-20200125/bench/benchmarking.c:238: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). bench_minimum = atoi((*argvp)[1]); data/libm4rie-20200125/bench/benchmarking.c:243: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). bench_maximum = atoi((*argvp)[1]); data/libm4rie-20200125/bench/benchmarking.c:259: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). int confidence = atoi((*argvp)[1]); data/libm4rie-20200125/bench/benchmarking.c:291:16: [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). bench_stats = atoi((*argvp)[1]); data/libm4rie-20200125/bench/cpucycles-20060326/amd64cpuinfo.c:18: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("/proc/cpuinfo","r"); data/libm4rie-20200125/bench/cpucycles-20060326/gettimeofday.c:14: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("/proc/cpuinfo","r"); data/libm4rie-20200125/bench/cpucycles-20060326/powerpclinux.c:48: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("/proc/cpuinfo","r"); data/libm4rie-20200125/bench/cpucycles-20060326/x86cpuinfo.c:17: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("/proc/cpuinfo","r"); data/libm4rie-20200125/m4rie/mzd_slice.c:64:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char formatstr[10]; data/libm4rie-20200125/m4rie/mzd_slice.c:68:3: [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(formatstr,"%%%dx",width); data/libm4rie-20200125/m4rie/mzed.c:255:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char formatstr[10]; data/libm4rie-20200125/m4rie/mzed.c:259:3: [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(formatstr,"%%%dx",width); ANALYSIS SUMMARY: Hits = 64 Lines analyzed = 15541 in approximately 0.74 seconds (20971 lines/second) Physical Source Lines of Code (SLOC) = 9901 Hits@level = [0] 220 [1] 0 [2] 31 [3] 28 [4] 5 [5] 0 Hits@level+ = [0+] 284 [1+] 64 [2+] 64 [3+] 33 [4+] 5 [5+] 0 Hits/KSLOC@level+ = [0+] 28.684 [1+] 6.46399 [2+] 6.46399 [3+] 3.333 [4+] 0.504999 [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.