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/python-kyotocabinet-1.22/kyotocabinet.cc FINAL RESULTS: data/python-kyotocabinet-1.22/kyotocabinet.cc:939:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. std::sprintf(xname, "X%s", name); data/python-kyotocabinet-1.22/kyotocabinet.cc:941:8: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. std::sprintf(fname, "kyotocabinet.Error.%s", xname); data/python-kyotocabinet-1.22/kyotocabinet.cc:776:34: [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). return PyLong_FromLongLong(kc::atoi(str.ptr())); data/python-kyotocabinet-1.22/kyotocabinet.cc:938: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 xname[kc::NUMBUFSIZ]; data/python-kyotocabinet-1.22/kyotocabinet.cc:940: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 fname[kc::NUMBUFSIZ*2]; data/python-kyotocabinet-1.22/kyotocabinet.cc:1001:27: [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). uint32_t code = kc::atoi(expr); data/python-kyotocabinet-1.22/kyotocabinet.cc:2270:17: [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 rv = db->open(tpath, mode); data/python-kyotocabinet-1.22/kyotocabinet.cc:3511:12: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(kbuf_, kbuf, ksiz); data/python-kyotocabinet-1.22/kyotocabinet.cc:3515:12: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy(vbuf_, vbuf, vsiz); data/python-kyotocabinet-1.22/kyotocabinet.cc:237: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). size_ = std::strlen(ptr_); data/python-kyotocabinet-1.22/kyotocabinet.cc:599:41: [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 PyUnicode_DecodeUTF8(str, std::strlen(str), "ignore"); ANALYSIS SUMMARY: Hits = 11 Lines analyzed = 3688 in approximately 0.12 seconds (30216 lines/second) Physical Source Lines of Code (SLOC) = 2966 Hits@level = [0] 0 [1] 2 [2] 7 [3] 0 [4] 2 [5] 0 Hits@level+ = [0+] 11 [1+] 11 [2+] 9 [3+] 2 [4+] 2 [5+] 0 Hits/KSLOC@level+ = [0+] 3.7087 [1+] 3.7087 [2+] 3.03439 [3+] 0.674309 [4+] 0.674309 [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.