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/poti-5.0/examples/containers.c Examining data/poti-5.0/examples/eventdef.c Examining data/poti-5.0/examples/events.c Examining data/poti-5.0/examples/header.c Examining data/poti-5.0/examples/links.c Examining data/poti-5.0/examples/main_example.c Examining data/poti-5.0/examples/states.c Examining data/poti-5.0/examples/states_unaliased.c Examining data/poti-5.0/examples/tracegen.c Examining data/poti-5.0/examples/variables.c Examining data/poti-5.0/examples/vite-1.2.c Examining data/poti-5.0/examples/vite-svn.c Examining data/poti-5.0/include/poti.h Examining data/poti-5.0/src/poti.c Examining data/poti-5.0/src/poti_events.c Examining data/poti-5.0/src/poti_events_unaliased.c Examining data/poti-5.0/src/poti_events_unique.c Examining data/poti-5.0/src/poti_header.c Examining data/poti-5.0/src/poti_header_default.c Examining data/poti-5.0/src/poti_private.h FINAL RESULTS: data/poti-5.0/src/poti.c:125:3: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(paje_file, format, arg); data/poti-5.0/examples/tracegen.c:72:3: [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(1); data/poti-5.0/src/poti.c:37:17: [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 *value = getenv(name); data/poti-5.0/examples/header.c:37: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). tn = atoi(argv[1]); data/poti-5.0/examples/tracegen.c:42:37: [2] (integer) atol: 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). case 's': arguments->targetSize = atol(arg); break; data/poti-5.0/src/poti.c:41:9: [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). if (atoi(value) == 0){ data/poti-5.0/src/poti.c:83:17: [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). paje_file = fopen(filename, "w"); data/poti-5.0/src/poti_events_unique.c:53:15: [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). int len = strlen(field)+1; data/poti-5.0/src/poti_events_unique.c:55:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(*buffer, field, len); data/poti-5.0/src/poti_events_unique.c:59:13: [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). int len = strlen(field) + 3; data/poti-5.0/src/poti_events_unique.c:62:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(*(buffer)+1, field, len-1); data/poti-5.0/src/poti_events_unique.c:63:9: [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). len = strlen(field); ANALYSIS SUMMARY: Hits = 12 Lines analyzed = 1892 in approximately 0.10 seconds (19862 lines/second) Physical Source Lines of Code (SLOC) = 1189 Hits@level = [0] 139 [1] 5 [2] 4 [3] 2 [4] 1 [5] 0 Hits@level+ = [0+] 151 [1+] 12 [2+] 7 [3+] 3 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 126.997 [1+] 10.0925 [2+] 5.8873 [3+] 2.52313 [4+] 0.841043 [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.