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/gffread-0.12.1/gff_utils.cpp Examining data/gffread-0.12.1/gff_utils.h Examining data/gffread-0.12.1/gffread.cpp FINAL RESULTS: data/gffread-0.12.1/gff_utils.cpp:223:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(charbuf, s.chars()); data/gffread-0.12.1/gff_utils.cpp:233:3: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(charbuf, seqid); data/gffread-0.12.1/gff_utils.cpp:200: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. static char charbuf[128]; data/gffread-0.12.1/gff_utils.cpp:230:10: [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. static char charbuf[128]; data/gffread-0.12.1/gff_utils.cpp:1286:10: [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). FILE* f=fopen(flst.chars(), "r"); data/gffread-0.12.1/gff_utils.h:599: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 nt[3]; data/gffread-0.12.1/gff_utils.h:708: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). if ((f=fopen(fname.chars(), "r"))==NULL) { data/gffread-0.12.1/gffread.cpp:311:6: [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). f=fopen(s,"w"); data/gffread-0.12.1/gffread.cpp:567:15: [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). f_repl=fopen(s.chars(), "w"); data/gffread-0.12.1/gffread.cpp:613:13: [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). FILE* ft=fopen(s,"r"); data/gffread-0.12.1/gffread.cpp:620:16: [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). FILE* fsize=fopen(s,"r"); data/gffread-0.12.1/gffread.cpp:665:28: [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). else if ((f_in=fopen(infile, "r"))==NULL) data/gffread-0.12.1/gff_utils.cpp:68:28: [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=(seqlen>0)?seqlen:strlen(seq); data/gffread-0.12.1/gff_utils.cpp:1289:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). slurp.read(f, NULL); ANALYSIS SUMMARY: Hits = 14 Lines analyzed = 3103 in approximately 0.12 seconds (25559 lines/second) Physical Source Lines of Code (SLOC) = 2435 Hits@level = [0] 52 [1] 2 [2] 10 [3] 0 [4] 2 [5] 0 Hits@level+ = [0+] 66 [1+] 14 [2+] 12 [3+] 2 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 27.1047 [1+] 5.74949 [2+] 4.92813 [3+] 0.821355 [4+] 0.821355 [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.