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/altree-1.3.1/CUtils/ppport.h Examining data/altree-1.3.1/CUtils/c_sources/rhyper.h Examining data/altree-1.3.1/CUtils/c_sources/chisq.h Examining data/altree-1.3.1/CUtils/c_sources/double_permutation.c Examining data/altree-1.3.1/CUtils/c_sources/z.c Examining data/altree-1.3.1/CUtils/c_sources/stats.c Examining data/altree-1.3.1/CUtils/c_sources/debug.h Examining data/altree-1.3.1/CUtils/c_sources/mt19937ar.c Examining data/altree-1.3.1/CUtils/c_sources/fisher.h Examining data/altree-1.3.1/CUtils/c_sources/myrand.h Examining data/altree-1.3.1/CUtils/c_sources/myrand.c Examining data/altree-1.3.1/CUtils/c_sources/z.h Examining data/altree-1.3.1/CUtils/c_sources/resampling.h Examining data/altree-1.3.1/CUtils/c_sources/fisher.c Examining data/altree-1.3.1/CUtils/c_sources/stats.h Examining data/altree-1.3.1/CUtils/c_sources/resampling.c Examining data/altree-1.3.1/CUtils/c_sources/datatype.h Examining data/altree-1.3.1/CUtils/c_sources/chisq.c Examining data/altree-1.3.1/CUtils/c_sources/double_permutation.h Examining data/altree-1.3.1/CUtils/c_sources/mt19937ar.h Examining data/altree-1.3.1/CUtils/c_sources/rhyper.c FINAL RESULTS: data/altree-1.3.1/CUtils/c_sources/debug.h:8:26: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define debug(str,...) fprintf(stderr, str "\n", ##__VA_ARGS__) data/altree-1.3.1/CUtils/c_sources/double_permutation.c:20:8: [4] (buffer) scanf: 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. res=scanf(CONV, &d); data/altree-1.3.1/CUtils/c_sources/double_permutation.c:211:4: [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("\t"CONV, mat[j][i]); data/altree-1.3.1/CUtils/c_sources/resampling.c:306:4: [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("\t"CONV, *(r++)); data/altree-1.3.1/CUtils/c_sources/stats.c:68:16: [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. size_t len=1+snprintf(ch, 0, str, ##__VA_ARGS__); \ data/altree-1.3.1/CUtils/c_sources/stats.c:70:3: [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. snprintf(ch, len, str, ##__VA_ARGS__); \ data/altree-1.3.1/CUtils/c_sources/stats.c:78:15: [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. size_t slen=snprintf(ch, 0, str, ##__VA_ARGS__); \ data/altree-1.3.1/CUtils/c_sources/stats.c:80:3: [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. snprintf(ch+dlen, slen+1, str, ##__VA_ARGS__); \ data/altree-1.3.1/CUtils/c_sources/myrand.c:31: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(getpid()); data/altree-1.3.1/CUtils/c_sources/resampling.c:210:15: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. char* envvar=getenv("ALTREE_PARALLEL"); data/altree-1.3.1/CUtils/c_sources/chisq.c:62:11: [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). df=atoi(argv[2]); data/altree-1.3.1/CUtils/c_sources/double_permutation.c:154: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). FILE*out=fopen("/tmp/out.txt", "w+"); data/altree-1.3.1/CUtils/c_sources/double_permutation.c:201:12: [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). nb_sample=atoi(argv[1]); data/altree-1.3.1/CUtils/c_sources/double_permutation.c:202:10: [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). nb_chi2=atoi(argv[2]); data/altree-1.3.1/CUtils/c_sources/resampling.c:200: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). FILE* dump=fopen("/tmp/dump", "w+"); data/altree-1.3.1/CUtils/c_sources/resampling.c:212:12: [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). parallel=atoi(envvar); data/altree-1.3.1/CUtils/c_sources/resampling.c:273: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). FILE* dump=fopen("/tmp/dump.read", "r"); data/altree-1.3.1/CUtils/c_sources/stats.c:77:23: [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). size_t dlen=((dest)?strlen(dest):0); \ data/altree-1.3.1/CUtils/ppport.h:730:22: [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). STRLEN len = strlen(radix); ANALYSIS SUMMARY: Hits = 19 Lines analyzed = 3449 in approximately 0.14 seconds (24318 lines/second) Physical Source Lines of Code (SLOC) = 2442 Hits@level = [0] 41 [1] 2 [2] 7 [3] 2 [4] 8 [5] 0 Hits@level+ = [0+] 60 [1+] 19 [2+] 17 [3+] 10 [4+] 8 [5+] 0 Hits/KSLOC@level+ = [0+] 24.57 [1+] 7.78051 [2+] 6.96151 [3+] 4.095 [4+] 3.276 [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.