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/enscribe-0.1.0/enscribe.c FINAL RESULTS: data/enscribe-0.1.0/enscribe.c:79:18: [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. #define FRand() (random()/(float)RAND_MAX) data/enscribe-0.1.0/enscribe.c:80:24: [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. #define FRand2() (2.0*(random()/(float)RAND_MAX)-1.0) data/enscribe-0.1.0/enscribe.c:241:2: [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 arg[256]; data/enscribe-0.1.0/enscribe.c:470:8: [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). j=atoi(arg); data/enscribe-0.1.0/enscribe.c:493:8: [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). j=atoi(arg); data/enscribe-0.1.0/enscribe.c:516:8: [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). j=atol(arg); data/enscribe-0.1.0/enscribe.c:931:8: [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). in = fopen(inputfilename, "r"); data/enscribe-0.1.0/enscribe.c:377:45: [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). if ( (strncmp(argv[i],"-lf=",4)!=0) || (strlen(argv[i])<5) ) data/enscribe-0.1.0/enscribe.c:385:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(arg,&(argv[i][4]),255); data/enscribe-0.1.0/enscribe.c:400:45: [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). if ( (strncmp(argv[i],"-hf=",4)!=0) || (strlen(argv[i])<5) ) data/enscribe-0.1.0/enscribe.c:408:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(arg,&(argv[i][4]),255); data/enscribe-0.1.0/enscribe.c:423:49: [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). if ( (strncmp(argv[i],"-length=",8)!=0) || (strlen(argv[i])<9) ) data/enscribe-0.1.0/enscribe.c:431:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(arg,&(argv[i][8]),255); data/enscribe-0.1.0/enscribe.c:461:47: [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). if ( (strncmp(argv[i],"-rate=",6)!=0) || (strlen(argv[i])<7) ) data/enscribe-0.1.0/enscribe.c:469:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(arg,&(argv[i][6]),255); data/enscribe-0.1.0/enscribe.c:484:57: [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). if ( (strncmp(argv[i],"-transform-size=",6)!=0) || (strlen(argv[i])<7) ) data/enscribe-0.1.0/enscribe.c:492:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(arg,&(argv[i][6]),255); data/enscribe-0.1.0/enscribe.c:507:45: [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). if ( (strncmp(argv[i],"-ts=",4)!=0) || (strlen(argv[i])<5) ) data/enscribe-0.1.0/enscribe.c:515:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(arg,&(argv[i][4]),255); data/enscribe-0.1.0/enscribe.c:538:6: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(arg,&(argv[i][7]),255); data/enscribe-0.1.0/enscribe.c:940:14: [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). namelength=strlen(inputfilename); ANALYSIS SUMMARY: Hits = 21 Lines analyzed = 1443 in approximately 0.07 seconds (21291 lines/second) Physical Source Lines of Code (SLOC) = 1131 Hits@level = [0] 127 [1] 14 [2] 5 [3] 2 [4] 0 [5] 0 Hits@level+ = [0+] 148 [1+] 21 [2+] 7 [3+] 2 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 130.858 [1+] 18.5676 [2+] 6.18921 [3+] 1.76835 [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.