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/mythes-1.2.4/example.cxx Examining data/mythes-1.2.4/mythes.cxx FINAL RESULTS: data/mythes-1.2.4/example.cxx:37:12: [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). wtclst = fopen(argv[3], "r"); data/mythes-1.2.4/example.cxx:55: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 buf[101]; data/mythes-1.2.4/example.cxx:56: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 oldbuf[101]; data/mythes-1.2.4/mythes.cxx:38:21: [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 * pifile = fopen(idxpath,"r"); data/mythes-1.2.4/mythes.cxx:49:17: [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). int idxsz = atoi(wrd); data/mythes-1.2.4/mythes.cxx:82:17: [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((list[nw]),wrd,np); data/mythes-1.2.4/mythes.cxx:83:29: [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). offst[nw] = atoi(wrd+np+1); data/mythes-1.2.4/mythes.cxx:93:14: [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). pdfile = fopen(datpath,"r"); data/mythes-1.2.4/mythes.cxx:154:5: [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(wrd,pText,len); data/mythes-1.2.4/mythes.cxx:178:21: [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). int nmeanings = atoi(buf+np+1); data/mythes-1.2.4/mythes.cxx:189: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 dfn[MAX_WD_LEN]; data/mythes-1.2.4/mythes.cxx:354:12: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. if (d) memcpy(d,s,sl); data/mythes-1.2.4/example.cxx:61:11: [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). k = strlen(buf); data/mythes-1.2.4/example.cxx:63:17: [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(buf); data/mythes-1.2.4/example.cxx:73:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(oldbuf,buf, sizeof(oldbuf)-1); data/mythes-1.2.4/example.cxx:75:13: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(buf, stem[0], sizeof(buf)-1); data/mythes-1.2.4/example.cxx:77:19: [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(buf); data/mythes-1.2.4/mythes.cxx:242:21: [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 k = strlen(pos); data/mythes-1.2.4/mythes.cxx:243:21: [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 m = strlen(pm->psyns[0]); data/mythes-1.2.4/mythes.cxx:245:18: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dfn,pos,k); data/mythes-1.2.4/mythes.cxx:247:18: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((dfn+k+1),(pm->psyns[0]),m+1); data/mythes-1.2.4/mythes.cxx:305:12: [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). return strlen(buf); data/mythes-1.2.4/mythes.cxx:352: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). int sl = strlen(s)+1; data/mythes-1.2.4/mythes.cxx:362:11: [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 k = strlen(s); ANALYSIS SUMMARY: Hits = 24 Lines analyzed = 492 in approximately 0.07 seconds (6655 lines/second) Physical Source Lines of Code (SLOC) = 361 Hits@level = [0] 18 [1] 12 [2] 12 [3] 0 [4] 0 [5] 0 Hits@level+ = [0+] 42 [1+] 24 [2+] 12 [3+] 0 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 116.343 [1+] 66.482 [2+] 33.241 [3+] 0 [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.