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/neartree-5.1.1+dfsg1/CNearTree.c Examining data/neartree-5.1.1+dfsg1/main.cpp Examining data/neartree-5.1.1+dfsg1/TNear.h Examining data/neartree-5.1.1+dfsg1/main_flip.cpp Examining data/neartree-5.1.1+dfsg1/v.h Examining data/neartree-5.1.1+dfsg1/triple.h Examining data/neartree-5.1.1+dfsg1/CNearTreeTest.cpp Examining data/neartree-5.1.1+dfsg1/main.c Examining data/neartree-5.1.1+dfsg1/v.cpp Examining data/neartree-5.1.1+dfsg1/CNearTree.h Examining data/neartree-5.1.1+dfsg1/CNearTreeTest.c Examining data/neartree-5.1.1+dfsg1/rhrand.h FINAL RESULTS: data/neartree-5.1.1+dfsg1/main.cpp:63:13: [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. rhr.srandom( (unsigned int)time( NULL ) ); /* use the current time to seed the data/neartree-5.1.1+dfsg1/main.cpp:66:13: [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. rhr.srandom((unsigned int)atoi(argv[1])); data/neartree-5.1.1+dfsg1/main_flip.cpp:63:13: [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. rhr.srandom( (unsigned int)time( NULL ) ); /* use the current time to seed the data/neartree-5.1.1+dfsg1/main_flip.cpp:66:13: [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. rhr.srandom((unsigned int)atoi(argv[1])); data/neartree-5.1.1+dfsg1/rhrand.h:64:9: [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(0); data/neartree-5.1.1+dfsg1/rhrand.h:69:9: [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(iseed); data/neartree-5.1.1+dfsg1/rhrand.h:75:10: [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. void srandom ( const int iseed ) { data/neartree-5.1.1+dfsg1/rhrand.h:97: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. int random( void ) { data/neartree-5.1.1+dfsg1/CNearTreeTest.c:2490: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 searchPoint[4]; data/neartree-5.1.1+dfsg1/CNearTreeTest.c:2491: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 vstring[4]; data/neartree-5.1.1+dfsg1/CNearTreeTest.cpp:168:9: [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 tagstring[40]; data/neartree-5.1.1+dfsg1/CNearTreeTest.cpp:169:9: [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(tagstring,"testLinearTree %d",i); data/neartree-5.1.1+dfsg1/main.c:81:35: [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). CRHrandSrandom(&rhr, (int)atoi(argv[1])); data/neartree-5.1.1+dfsg1/main.cpp:66:35: [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). rhr.srandom((unsigned int)atoi(argv[1])); data/neartree-5.1.1+dfsg1/main_flip.cpp:66:35: [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). rhr.srandom((unsigned int)atoi(argv[1])); data/neartree-5.1.1+dfsg1/CNearTreeTest.c:2503:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant character. strncpy(vstring,"",4); ANALYSIS SUMMARY: Hits = 16 Lines analyzed = 26092 in approximately 0.63 seconds (41391 lines/second) Physical Source Lines of Code (SLOC) = 18269 Hits@level = [0] 532 [1] 1 [2] 7 [3] 8 [4] 0 [5] 0 Hits@level+ = [0+] 548 [1+] 16 [2+] 15 [3+] 8 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 29.9962 [1+] 0.875801 [2+] 0.821063 [3+] 0.4379 [4+] 0 [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.