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/minisat2-2.2.1/minisat/core/Dimacs.h Examining data/minisat2-2.2.1/minisat/core/Main.cc Examining data/minisat2-2.2.1/minisat/core/Solver.cc Examining data/minisat2-2.2.1/minisat/core/Solver.h Examining data/minisat2-2.2.1/minisat/core/SolverTypes.h Examining data/minisat2-2.2.1/minisat/mtl/Alg.h Examining data/minisat2-2.2.1/minisat/mtl/Alloc.h Examining data/minisat2-2.2.1/minisat/mtl/Heap.h Examining data/minisat2-2.2.1/minisat/mtl/IntTypes.h Examining data/minisat2-2.2.1/minisat/mtl/Map.h Examining data/minisat2-2.2.1/minisat/mtl/Queue.h Examining data/minisat2-2.2.1/minisat/mtl/Sort.h Examining data/minisat2-2.2.1/minisat/mtl/Vec.h Examining data/minisat2-2.2.1/minisat/mtl/XAlloc.h Examining data/minisat2-2.2.1/minisat/simp/SimpSolver.cc Examining data/minisat2-2.2.1/minisat/simp/SimpSolver.h Examining data/minisat2-2.2.1/minisat/simp/Main.cc Examining data/minisat2-2.2.1/minisat/utils/Options.cc Examining data/minisat2-2.2.1/minisat/utils/Options.h Examining data/minisat2-2.2.1/minisat/utils/ParseUtils.h Examining data/minisat2-2.2.1/minisat/utils/System.cc Examining data/minisat2-2.2.1/minisat/utils/System.h FINAL RESULTS: data/minisat2-2.2.1/minisat/core/Main.cc:167:9: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(ret == l_True ? "SATISFIABLE\n" : ret == l_False ? "UNSATISFIABLE\n" : "INDETERMINATE\n"); data/minisat2-2.2.1/minisat/simp/Main.cc:186:9: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf(ret == l_True ? "SATISFIABLE\n" : ret == l_False ? "UNSATISFIABLE\n" : "INDETERMINATE\n"); data/minisat2-2.2.1/minisat/utils/Options.cc:63:9: [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. fprintf(stderr, usage, argv[0]); data/minisat2-2.2.1/minisat/utils/Options.h:285:13: [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. fprintf(stderr, "%4"PRIi64, range.begin); data/minisat2-2.2.1/minisat/utils/Options.h:291:13: [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. fprintf(stderr, "%4"PRIi64, range.end); data/minisat2-2.2.1/minisat/core/Main.cc:135:35: [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* res = (argc >= 3) ? fopen(argv[2], "wb") : NULL; data/minisat2-2.2.1/minisat/core/Solver.cc:832: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* f = fopen(file, "wr"); data/minisat2-2.2.1/minisat/simp/Main.cc:139:35: [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* res = (argc >= 3) ? fopen(argv[2], "wb") : NULL; data/minisat2-2.2.1/minisat/utils/ParseUtils.h:39:14: [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. unsigned char buf[buffer_size]; data/minisat2-2.2.1/minisat/utils/System.cc:32: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 name[256]; data/minisat2-2.2.1/minisat/utils/System.cc:36:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(name, "/proc/%d/statm", pid); data/minisat2-2.2.1/minisat/utils/System.cc:37: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* in = fopen(name, "rb"); data/minisat2-2.2.1/minisat/utils/System.cc:50: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 name[256]; data/minisat2-2.2.1/minisat/utils/System.cc:53:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(name, "/proc/%d/status", pid); data/minisat2-2.2.1/minisat/utils/System.cc:54: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* in = fopen(name, "rb"); data/minisat2-2.2.1/minisat/utils/Options.h:371:39: [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). for (uint32_t i = 0; i < 32 - strlen(name)*2; i++) data/minisat2-2.2.1/minisat/utils/System.cc:60:29: [1] (buffer) fgetc: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (!feof(in) && fgetc(in) != '\n') ANALYSIS SUMMARY: Hits = 17 Lines analyzed = 4831 in approximately 0.16 seconds (29893 lines/second) Physical Source Lines of Code (SLOC) = 2952 Hits@level = [0] 140 [1] 2 [2] 10 [3] 0 [4] 5 [5] 0 Hits@level+ = [0+] 157 [1+] 17 [2+] 15 [3+] 5 [4+] 5 [5+] 0 Hits/KSLOC@level+ = [0+] 53.1843 [1+] 5.75881 [2+] 5.0813 [3+] 1.69377 [4+] 1.69377 [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.