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/leaktracer-2.4/LeakTracer.cc Examining data/leaktracer-2.4/test.cc FINAL RESULTS: data/leaktracer-2.4/LeakTracer.cc:164:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(uniqFilename, "%s.%d", filename, getpid()); data/leaktracer-2.4/LeakTracer.cc:170:4: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(uniqFilename, "%s", filename); data/leaktracer-2.4/LeakTracer.cc:161:26: [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. const char *filename = getenv("LEAKTRACE_FILE") ? : "leak.out"; data/leaktracer-2.4/LeakTracer.cc:207:7: [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. if (getenv("LT_ABORTREASON")) { data/leaktracer-2.4/LeakTracer.cc:208:19: [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. abortOn = atoi(getenv("LT_ABORTREASON")); data/leaktracer-2.4/LeakTracer.cc:160: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 uniqFilename[256]; data/leaktracer-2.4/LeakTracer.cc:172:18: [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). int reportfd = open(uniqFilename, data/leaktracer-2.4/LeakTracer.cc:208: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). abortOn = atoi(getenv("LT_ABORTREASON")); data/leaktracer-2.4/LeakTracer.cc:310:9: [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((char*)p+size, MAGIC, MAGIC_SIZE); ANALYSIS SUMMARY: Hits = 9 Lines analyzed = 532 in approximately 0.02 seconds (22651 lines/second) Physical Source Lines of Code (SLOC) = 353 Hits@level = [0] 36 [1] 0 [2] 4 [3] 3 [4] 2 [5] 0 Hits@level+ = [0+] 45 [1+] 9 [2+] 9 [3+] 5 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 127.479 [1+] 25.4958 [2+] 25.4958 [3+] 14.1643 [4+] 5.66572 [5+] 0 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.