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/swac-get-0.3/src/swac_repository.cc Examining data/swac-get-0.3/src/parser_dom.cc Examining data/swac-get-0.3/src/swac.cc Examining data/swac-get-0.3/src/main.cc Examining data/swac-get-0.3/src/swac_db.cc Examining data/swac-get-0.3/src/options.cc Examining data/swac-get-0.3/src/http.cc Examining data/swac-get-0.3/src/basic.cc Examining data/swac-get-0.3/src/db.cc Examining data/swac-get-0.3/src/swac_index.cc Examining data/swac-get-0.3/src/posix.cc FINAL RESULTS: data/swac-get-0.3/src/swac_index.cc:159:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, msg, args); data/swac-get-0.3/src/swac_index.cc:168:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, msg, args); data/swac-get-0.3/src/swac_index.cc:177:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stderr, msg, args); data/swac-get-0.3/src/db.cc:29:2: [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 formated[255]; data/swac-get-0.3/src/db.cc:34:15: [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). bool tsqlite::open(const char *path) { data/swac-get-0.3/src/http.cc:44:2: [2] (buffer) bcopy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. bcopy(hp->h_addr, &addr.sin_addr, hp->h_length); data/swac-get-0.3/src/http.cc:68:33: [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). fd = sock_connect(uri->server, atoi(int2string((uri->port == 0) ? 80 : uri->port).c_str())); data/swac-get-0.3/src/http.cc:81:2: [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[256]; data/swac-get-0.3/src/swac_db.cc:35:19: [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). bool result = db.open(path); data/swac-get-0.3/src/swac_index.cc:222:2: [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 buffer[BUFSIZ]; data/swac-get-0.3/src/swac_index.cc:275: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 * f = fopen(filename.c_str(), "r"); ANALYSIS SUMMARY: Hits = 11 Lines analyzed = 1587 in approximately 0.07 seconds (22588 lines/second) Physical Source Lines of Code (SLOC) = 994 Hits@level = [0] 9 [1] 0 [2] 8 [3] 0 [4] 3 [5] 0 Hits@level+ = [0+] 20 [1+] 11 [2+] 11 [3+] 3 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 20.1207 [1+] 11.0664 [2+] 11.0664 [3+] 3.01811 [4+] 3.01811 [5+] 0 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.