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/lutok-0.4+dfsg/c_gate.cpp Examining data/lutok-0.4+dfsg/c_gate.hpp Examining data/lutok-0.4+dfsg/c_gate_test.cpp Examining data/lutok-0.4+dfsg/debug.cpp Examining data/lutok-0.4+dfsg/debug.hpp Examining data/lutok-0.4+dfsg/debug_test.cpp Examining data/lutok-0.4+dfsg/examples/bindings.cpp Examining data/lutok-0.4+dfsg/examples/hello.cpp Examining data/lutok-0.4+dfsg/examples/interpreter.cpp Examining data/lutok-0.4+dfsg/examples/raii.cpp Examining data/lutok-0.4+dfsg/exceptions.cpp Examining data/lutok-0.4+dfsg/exceptions.hpp Examining data/lutok-0.4+dfsg/exceptions_test.cpp Examining data/lutok-0.4+dfsg/include/lutok/c_gate.hpp Examining data/lutok-0.4+dfsg/include/lutok/debug.hpp Examining data/lutok-0.4+dfsg/include/lutok/exceptions.hpp Examining data/lutok-0.4+dfsg/include/lutok/operations.hpp Examining data/lutok-0.4+dfsg/include/lutok/stack_cleaner.hpp Examining data/lutok-0.4+dfsg/include/lutok/state.hpp Examining data/lutok-0.4+dfsg/operations.cpp Examining data/lutok-0.4+dfsg/operations.hpp Examining data/lutok-0.4+dfsg/operations_test.cpp Examining data/lutok-0.4+dfsg/stack_cleaner.cpp Examining data/lutok-0.4+dfsg/stack_cleaner.hpp Examining data/lutok-0.4+dfsg/stack_cleaner_test.cpp Examining data/lutok-0.4+dfsg/state.cpp Examining data/lutok-0.4+dfsg/state.hpp Examining data/lutok-0.4+dfsg/state_test.cpp Examining data/lutok-0.4+dfsg/test_utils.hpp FINAL RESULTS: data/lutok-0.4+dfsg/state.cpp:495:12: [4] (race) access: This usually indicates a security flaw. If an attacker can change anything along the path between the call to access() and the file's actual use (e.g., by moving files), the attacker can exploit the race condition (CWE-362/CWE-367!). Set up the correct permissions (e.g., using setuid()) and try to open the file directly. if (!::access(file.c_str(), R_OK) == 0) data/lutok-0.4+dfsg/state.cpp:142: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 error_buf[1024]; data/lutok-0.4+dfsg/state.cpp:148:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). std::strncpy(error_buf, e.what(), sizeof(error_buf)); data/lutok-0.4+dfsg/state.cpp:150:14: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). Risk is low because the source is a constant string. std::strncpy(error_buf, "Unhandled exception in Lua C++ hook", ANALYSIS SUMMARY: Hits = 4 Lines analyzed = 4500 in approximately 0.21 seconds (21237 lines/second) Physical Source Lines of Code (SLOC) = 2350 Hits@level = [0] 0 [1] 2 [2] 1 [3] 0 [4] 1 [5] 0 Hits@level+ = [0+] 4 [1+] 4 [2+] 2 [3+] 1 [4+] 1 [5+] 0 Hits/KSLOC@level+ = [0+] 1.70213 [1+] 1.70213 [2+] 0.851064 [3+] 0.425532 [4+] 0.425532 [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.