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/maildir-filter-1.20/maildir-filter.c FINAL RESULTS: data/maildir-filter-1.20/maildir-filter.c:57:11: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while((c=getopt(argc,argv,"r:kd:pDibVnH"))>0) { data/maildir-filter-1.20/maildir-filter.c:104: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 line[BUFSIZ]; data/maildir-filter-1.20/maildir-filter.c:218: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 fname[BUFSIZ]; data/maildir-filter-1.20/maildir-filter.c:219: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 tmpname[BUFSIZ]; data/maildir-filter-1.20/maildir-filter.c:230:5: [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). fp=fopen(tmpname, "w"); data/maildir-filter-1.20/maildir-filter.c:106: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). msg_len += strlen(line); data/maildir-filter-1.20/maildir-filter.c:138:35: [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). fwrite(message[c],sizeof(char),strlen(message[c]),stdout); data/maildir-filter-1.20/maildir-filter.c:150:66: [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). ret=pcre_exec(regexp,(const pcre_extra *)reg_info,message[c],strlen(message[c]),0,0 /* opt */,NULL,0); data/maildir-filter-1.20/maildir-filter.c:236:34: [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). fwrite(message[c],sizeof(char),strlen(message[c]),fp); ANALYSIS SUMMARY: Hits = 9 Lines analyzed = 245 in approximately 0.02 seconds (10040 lines/second) Physical Source Lines of Code (SLOC) = 217 Hits@level = [0] 27 [1] 4 [2] 4 [3] 1 [4] 0 [5] 0 Hits@level+ = [0+] 36 [1+] 9 [2+] 5 [3+] 1 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 165.899 [1+] 41.4747 [2+] 23.0415 [3+] 4.60829 [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.