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/apertium-recursive-0.0.1/src/apertium_re.cc Examining data/apertium-recursive-0.0.1/src/apertium_re.h Examining data/apertium-recursive-0.0.1/src/bytecode.h Examining data/apertium-recursive-0.0.1/src/chunk.h Examining data/apertium-recursive-0.0.1/src/matcher.h Examining data/apertium-recursive-0.0.1/src/pattern.cc Examining data/apertium-recursive-0.0.1/src/pattern.h Examining data/apertium-recursive-0.0.1/src/pool.h Examining data/apertium-recursive-0.0.1/src/randpath.cc Examining data/apertium-recursive-0.0.1/src/rtx_comp.cc Examining data/apertium-recursive-0.0.1/src/rtx_compiler.cc Examining data/apertium-recursive-0.0.1/src/rtx_compiler.h Examining data/apertium-recursive-0.0.1/src/rtx_config.h Examining data/apertium-recursive-0.0.1/src/rtx_decomp.cc Examining data/apertium-recursive-0.0.1/src/rtx_proc.cc Examining data/apertium-recursive-0.0.1/src/rtx_processor.cc Examining data/apertium-recursive-0.0.1/src/rtx_processor.h Examining data/apertium-recursive-0.0.1/src/trx_comp.cc Examining data/apertium-recursive-0.0.1/src/trx_compiler.cc Examining data/apertium-recursive-0.0.1/src/trx_compiler.h FINAL RESULTS: data/apertium-recursive-0.0.1/src/rtx_comp.cc:58:13: [3] (buffer) getopt_long: 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. int c = getopt_long(argc, argv, "e:fl:sSh", long_options, &option_index); data/apertium-recursive-0.0.1/src/rtx_comp.cc:60:13: [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. int c = getopt(argc, argv, "e:fl:sSh"); data/apertium-recursive-0.0.1/src/rtx_decomp.cc:220:13: [3] (buffer) getopt_long: 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. int c = getopt_long(argc, argv, "h", long_options, &option_index); data/apertium-recursive-0.0.1/src/rtx_decomp.cc:222:13: [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. int c = getopt(argc, argv, "h"); data/apertium-recursive-0.0.1/src/rtx_proc.cc:71:13: [3] (buffer) getopt_long: 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. int c = getopt_long(argc, argv, "abefFm:rstTzh", long_options, &option_index); data/apertium-recursive-0.0.1/src/rtx_proc.cc:73:13: [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. int c = getopt(argc, argv, "abefFm:rstTzh"); data/apertium-recursive-0.0.1/src/trx_comp.cc:39:13: [3] (buffer) getopt_long: 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. int c = getopt_long(argc, argv, "l:h", long_options, &option_index); data/apertium-recursive-0.0.1/src/trx_comp.cc:41:13: [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. int c = getopt(argc, argv, "l:h"); data/apertium-recursive-0.0.1/src/matcher.h:262: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(local_state, state, RTXStateSize*sizeof(int)); data/apertium-recursive-0.0.1/src/pattern.cc:354:7: [2] (misc) open: 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). lex.open(fname); data/apertium-recursive-0.0.1/src/randpath.cc:25:7: [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 header[4]{}; data/apertium-recursive-0.0.1/src/randpath.cc:178: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). FILE* tf = fopen(argv[1], "rb"); data/apertium-recursive-0.0.1/src/rtx_compiler.cc:2313:10: [2] (misc) open: 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). source.open(fname); data/apertium-recursive-0.0.1/src/rtx_compiler.cc:2347: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). FILE *out = fopen(fname.c_str(), "wb"); data/apertium-recursive-0.0.1/src/rtx_decomp.cc:250: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). in = fopen(argv[optind], "rb"); data/apertium-recursive-0.0.1/src/rtx_decomp.cc:259:11: [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). out = fopen(argv[optind+1], "wb"); data/apertium-recursive-0.0.1/src/rtx_proc.cc:154: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). input = fopen(argv[optind+1], "rb"); data/apertium-recursive-0.0.1/src/rtx_proc.cc:163: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). output = fopen(argv[optind+2], "wb"); data/apertium-recursive-0.0.1/src/rtx_processor.cc:42: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). FILE *in = fopen(filename.c_str(), "rb"); data/apertium-recursive-0.0.1/src/trx_compiler.cc:501:16: [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 npar = atoi((const char*) requireAttr(mac, (const xmlChar*) "npar")); data/apertium-recursive-0.0.1/src/trx_compiler.cc:1683: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). FILE* bin = fopen(binfile, "wb"); data/apertium-recursive-0.0.1/src/apertium_re.cc:43:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ApertiumRE::read(FILE *input) data/apertium-recursive-0.0.1/src/apertium_re.h:36:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(FILE *); data/apertium-recursive-0.0.1/src/randpath.cc:48:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). A.read(input); data/apertium-recursive-0.0.1/src/randpath.cc:63:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). T.read(input); data/apertium-recursive-0.0.1/src/rtx_comp.cc:95:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). myCompiler.read(argv[optind]); data/apertium-recursive-0.0.1/src/rtx_compiler.cc:2309:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). RTXCompiler::read(const string &fname) data/apertium-recursive-0.0.1/src/rtx_compiler.h:615:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(string const &filename); data/apertium-recursive-0.0.1/src/rtx_config.h:7:25: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define fgetc_unlocked fgetc data/apertium-recursive-0.0.1/src/rtx_proc.cc:148:5: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). p.read(argv[optind]); data/apertium-recursive-0.0.1/src/rtx_processor.cc:40:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). RTXProcessor::read(string const &filename) data/apertium-recursive-0.0.1/src/rtx_processor.cc:67:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). alphabet.read(in); data/apertium-recursive-0.0.1/src/rtx_processor.cc:70:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). t->read(in, alphabet.size()); data/apertium-recursive-0.0.1/src/rtx_processor.cc:92:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). attr_items[cad_k].read(in); data/apertium-recursive-0.0.1/src/rtx_processor.h:431:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(string const &filename); ANALYSIS SUMMARY: Hits = 35 Lines analyzed = 10252 in approximately 0.25 seconds (41221 lines/second) Physical Source Lines of Code (SLOC) = 8789 Hits@level = [0] 64 [1] 14 [2] 13 [3] 8 [4] 0 [5] 0 Hits@level+ = [0+] 99 [1+] 35 [2+] 21 [3+] 8 [4+] 0 [5+] 0 Hits/KSLOC@level+ = [0+] 11.2641 [1+] 3.98225 [2+] 2.38935 [3+] 0.910229 [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.