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/packup-0.6/basic_types.h Examining data/packup-0.6/cl_registry.cc Examining data/packup-0.6/collections.cc Examining data/packup-0.6/common_types.cc Examining data/packup-0.6/ConverterMem.cc Examining data/packup-0.6/EncoderTypes.cc Examining data/packup-0.6/IntervalVariables.cc Examining data/packup-0.6/Lexer.cc Examining data/packup-0.6/NotRemoved.cc Examining data/packup-0.6/Options.cc Examining data/packup-0.6/p.tab.cc Examining data/packup-0.6/PackageVersionVariables.cc Examining data/packup-0.6/package_version.cc Examining data/packup-0.6/parser.cc Examining data/packup-0.6/Printer.cc Examining data/packup-0.6/SolutionReader.cc Examining data/packup-0.6/ExternalWrapper.cc Examining data/packup-0.6/cudf_msu.cc Examining data/packup-0.6/Encoder.cc FINAL RESULTS: data/packup-0.6/ExternalWrapper.cc:161:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const int retv = system (command.c_str()); data/packup-0.6/ExternalWrapper.cc:224:22: [4] (shell) system: This causes a new program to execute and is difficult to use safely (CWE-78). try using a library call that implements the same functionality if available. const int retv = system (command.c_str()); data/packup-0.6/p.tab.cc:790:21: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. # define YYFPRINTF fprintf data/packup-0.6/Options.cc:64:12: [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. c = getopt_long(argc, argv, "hu:pt", long_options, &option_index); data/packup-0.6/cudf_msu.cc:177:17: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. pPath = getenv("TMPDIR"); data/packup-0.6/ConverterMem.cc:30:79: [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). void ConverterMem::set_maping_file (const char* filen) {encoder.get_mapping().open(filen);} data/packup-0.6/Lexer.cc:514:6: [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(return_value, ts, length); data/packup-0.6/SolutionReader.cc:53: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). file.open(file_name); data/packup-0.6/SolutionReader.cc:91: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). package_version=atoi(version_str.c_str()); data/packup-0.6/cudf_msu.cc:146:20: [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). input_file.open(options.get_input_file_name().c_str()); data/packup-0.6/cudf_msu.cc:153:21: [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). output_file.open(options.get_output_file_name().c_str()); data/packup-0.6/p.tab.cc:1090: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 const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; data/packup-0.6/p.tab.cc:1107: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 yyformat[sizeof yyunexpected data/packup-0.6/p.tab.cc:1297: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 yymsgbuf[128]; data/packup-0.6/ConverterMem.cc:34:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). sr.read(file_name); data/packup-0.6/Lexer.cc:561:19: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). input.read(p, space); data/packup-0.6/SolutionReader.cc:51:22: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void SolutionReader::read (const char* file_name) data/packup-0.6/p.tab.cc:971: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). # define yystrlen strlen ANALYSIS SUMMARY: Hits = 18 Lines analyzed = 6810 in approximately 0.19 seconds (36345 lines/second) Physical Source Lines of Code (SLOC) = 5184 Hits@level = [0] 6 [1] 4 [2] 9 [3] 2 [4] 3 [5] 0 Hits@level+ = [0+] 24 [1+] 18 [2+] 14 [3+] 5 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 4.62963 [1+] 3.47222 [2+] 2.70062 [3+] 0.964506 [4+] 0.578704 [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.