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/lmdbxx-0.9.14.1+git20160228.0b43ca8/example.cc Examining data/lmdbxx-0.9.14.1+git20160228.0b43ca8/lmdb++.h Examining data/lmdbxx-0.9.14.1+git20160228.0b43ca8/check.cc FINAL RESULTS: data/lmdbxx-0.9.14.1+git20160228.0b43ca8/check.cc:30:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. std::sprintf(filename, "%s/data.mdb", tmpdir); data/lmdbxx-0.9.14.1+git20160228.0b43ca8/check.cc:32:10: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. std::sprintf(filename, "%s/lock.mdb", tmpdir); data/lmdbxx-0.9.14.1+git20160228.0b43ca8/check.cc:21:9: [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). env.open(tmpdir); data/lmdbxx-0.9.14.1+git20160228.0b43ca8/check.cc:29: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 filename[30]; // enough room for tmpdir + filename data/lmdbxx-0.9.14.1+git20160228.0b43ca8/example.cc:11: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). env.open("./example.mdb", 0, 0664); data/lmdbxx-0.9.14.1+git20160228.0b43ca8/example.cc:15:25: [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). auto dbi = lmdb::dbi::open(wtxn, nullptr); data/lmdbxx-0.9.14.1+git20160228.0b43ca8/example.cc:23:31: [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). auto cursor = lmdb::cursor::open(rtxn, dbi); data/lmdbxx-0.9.14.1+git20160228.0b43ca8/lmdb++.h:99:25: [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. static thread_local char buffer[1024]; data/lmdbxx-0.9.14.1+git20160228.0b43ca8/lmdb++.h:1194:8: [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). env& open(const char* const path, data/lmdbxx-0.9.14.1+git20160228.0b43ca8/lmdb++.h:1403:3: [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). open(MDB_txn* const txn, data/lmdbxx-0.9.14.1+git20160228.0b43ca8/lmdb++.h:1731:3: [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). open(MDB_txn* const txn, data/lmdbxx-0.9.14.1+git20160228.0b43ca8/lmdb++.h:959:22: [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). : val{data, std::strlen(data)} {} data/lmdbxx-0.9.14.1+git20160228.0b43ca8/lmdb++.h:1056:30: [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 assign(data, std::strlen(data)); data/lmdbxx-0.9.14.1+git20160228.0b43ca8/lmdb++.h:1578:33: [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). const lmdb::val k{key, std::strlen(key)}; data/lmdbxx-0.9.14.1+git20160228.0b43ca8/lmdb++.h:1653:33: [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). const lmdb::val k{key, std::strlen(key)}; data/lmdbxx-0.9.14.1+git20160228.0b43ca8/lmdb++.h:1671:33: [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). const lmdb::val k{key, std::strlen(key)}; data/lmdbxx-0.9.14.1+git20160228.0b43ca8/lmdb++.h:1672:27: [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). lmdb::val v{val, std::strlen(val)}; ANALYSIS SUMMARY: Hits = 17 Lines analyzed = 1989 in approximately 0.06 seconds (31169 lines/second) Physical Source Lines of Code (SLOC) = 1054 Hits@level = [0] 4 [1] 6 [2] 9 [3] 0 [4] 2 [5] 0 Hits@level+ = [0+] 21 [1+] 17 [2+] 11 [3+] 2 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 19.9241 [1+] 16.129 [2+] 10.4364 [3+] 1.89753 [4+] 1.89753 [5+] 0 Dot directories skipped = 2 (--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.