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/leveldb-1.22/db/autocompact_test.cc Examining data/leveldb-1.22/db/builder.cc Examining data/leveldb-1.22/db/builder.h Examining data/leveldb-1.22/db/c.cc Examining data/leveldb-1.22/db/c_test.c Examining data/leveldb-1.22/db/corruption_test.cc Examining data/leveldb-1.22/db/db_bench.cc Examining data/leveldb-1.22/db/db_impl.cc Examining data/leveldb-1.22/db/db_impl.h Examining data/leveldb-1.22/db/db_iter.cc Examining data/leveldb-1.22/db/db_iter.h Examining data/leveldb-1.22/db/db_test.cc Examining data/leveldb-1.22/db/dbformat.cc Examining data/leveldb-1.22/db/dbformat.h Examining data/leveldb-1.22/db/dbformat_test.cc Examining data/leveldb-1.22/db/dumpfile.cc Examining data/leveldb-1.22/db/fault_injection_test.cc Examining data/leveldb-1.22/db/filename.cc Examining data/leveldb-1.22/db/filename.h Examining data/leveldb-1.22/db/filename_test.cc Examining data/leveldb-1.22/db/leveldbutil.cc Examining data/leveldb-1.22/db/log_format.h Examining data/leveldb-1.22/db/log_reader.cc Examining data/leveldb-1.22/db/log_reader.h Examining data/leveldb-1.22/db/log_test.cc Examining data/leveldb-1.22/db/log_writer.cc Examining data/leveldb-1.22/db/log_writer.h Examining data/leveldb-1.22/db/memtable.cc Examining data/leveldb-1.22/db/memtable.h Examining data/leveldb-1.22/db/recovery_test.cc Examining data/leveldb-1.22/db/repair.cc Examining data/leveldb-1.22/db/skiplist.h Examining data/leveldb-1.22/db/skiplist_test.cc Examining data/leveldb-1.22/db/snapshot.h Examining data/leveldb-1.22/db/table_cache.cc Examining data/leveldb-1.22/db/table_cache.h Examining data/leveldb-1.22/db/version_edit.cc Examining data/leveldb-1.22/db/version_edit.h Examining data/leveldb-1.22/db/version_edit_test.cc Examining data/leveldb-1.22/db/version_set.cc Examining data/leveldb-1.22/db/version_set.h Examining data/leveldb-1.22/db/version_set_test.cc Examining data/leveldb-1.22/db/write_batch.cc Examining data/leveldb-1.22/db/write_batch_internal.h Examining data/leveldb-1.22/db/write_batch_test.cc Examining data/leveldb-1.22/doc/bench/db_bench_sqlite3.cc Examining data/leveldb-1.22/doc/bench/db_bench_tree_db.cc Examining data/leveldb-1.22/helpers/memenv/memenv.cc Examining data/leveldb-1.22/helpers/memenv/memenv.h Examining data/leveldb-1.22/helpers/memenv/memenv_test.cc Examining data/leveldb-1.22/include/leveldb/c.h Examining data/leveldb-1.22/include/leveldb/cache.h Examining data/leveldb-1.22/include/leveldb/comparator.h Examining data/leveldb-1.22/include/leveldb/db.h Examining data/leveldb-1.22/include/leveldb/dumpfile.h Examining data/leveldb-1.22/include/leveldb/env.h Examining data/leveldb-1.22/include/leveldb/export.h Examining data/leveldb-1.22/include/leveldb/filter_policy.h Examining data/leveldb-1.22/include/leveldb/iterator.h Examining data/leveldb-1.22/include/leveldb/options.h Examining data/leveldb-1.22/include/leveldb/slice.h Examining data/leveldb-1.22/include/leveldb/status.h Examining data/leveldb-1.22/include/leveldb/table.h Examining data/leveldb-1.22/include/leveldb/table_builder.h Examining data/leveldb-1.22/include/leveldb/write_batch.h Examining data/leveldb-1.22/issues/issue178_test.cc Examining data/leveldb-1.22/issues/issue200_test.cc Examining data/leveldb-1.22/issues/issue320_test.cc Examining data/leveldb-1.22/port/port.h Examining data/leveldb-1.22/port/port_example.h Examining data/leveldb-1.22/port/port_stdcxx.h Examining data/leveldb-1.22/port/thread_annotations.h Examining data/leveldb-1.22/table/block.cc Examining data/leveldb-1.22/table/block.h Examining data/leveldb-1.22/table/block_builder.cc Examining data/leveldb-1.22/table/block_builder.h Examining data/leveldb-1.22/table/filter_block.cc Examining data/leveldb-1.22/table/filter_block.h Examining data/leveldb-1.22/table/filter_block_test.cc Examining data/leveldb-1.22/table/format.cc Examining data/leveldb-1.22/table/format.h Examining data/leveldb-1.22/table/iterator.cc Examining data/leveldb-1.22/table/iterator_wrapper.h Examining data/leveldb-1.22/table/merger.cc Examining data/leveldb-1.22/table/merger.h Examining data/leveldb-1.22/table/table.cc Examining data/leveldb-1.22/table/table_builder.cc Examining data/leveldb-1.22/table/table_test.cc Examining data/leveldb-1.22/table/two_level_iterator.cc Examining data/leveldb-1.22/table/two_level_iterator.h Examining data/leveldb-1.22/util/arena.cc Examining data/leveldb-1.22/util/arena.h Examining data/leveldb-1.22/util/arena_test.cc Examining data/leveldb-1.22/util/bloom.cc Examining data/leveldb-1.22/util/cache.cc Examining data/leveldb-1.22/util/cache_test.cc Examining data/leveldb-1.22/util/coding.cc Examining data/leveldb-1.22/util/coding.h Examining data/leveldb-1.22/util/coding_test.cc Examining data/leveldb-1.22/util/comparator.cc Examining data/leveldb-1.22/util/crc32c.cc Examining data/leveldb-1.22/util/crc32c.h Examining data/leveldb-1.22/util/crc32c_test.cc Examining data/leveldb-1.22/util/env.cc Examining data/leveldb-1.22/util/env_posix.cc Examining data/leveldb-1.22/util/env_posix_test.cc Examining data/leveldb-1.22/util/env_posix_test_helper.h Examining data/leveldb-1.22/util/env_test.cc Examining data/leveldb-1.22/util/env_windows.cc Examining data/leveldb-1.22/util/env_windows_test.cc Examining data/leveldb-1.22/util/env_windows_test_helper.h Examining data/leveldb-1.22/util/filter_policy.cc Examining data/leveldb-1.22/util/hash.cc Examining data/leveldb-1.22/util/hash.h Examining data/leveldb-1.22/util/hash_test.cc Examining data/leveldb-1.22/util/histogram.cc Examining data/leveldb-1.22/util/histogram.h Examining data/leveldb-1.22/util/logging.cc Examining data/leveldb-1.22/util/logging.h Examining data/leveldb-1.22/util/logging_test.cc Examining data/leveldb-1.22/util/mutexlock.h Examining data/leveldb-1.22/util/no_destructor.h Examining data/leveldb-1.22/util/no_destructor_test.cc Examining data/leveldb-1.22/util/options.cc Examining data/leveldb-1.22/util/posix_logger.h Examining data/leveldb-1.22/util/random.h Examining data/leveldb-1.22/util/status.cc Examining data/leveldb-1.22/util/status_test.cc Examining data/leveldb-1.22/util/testharness.cc Examining data/leveldb-1.22/util/testharness.h Examining data/leveldb-1.22/util/testutil.cc Examining data/leveldb-1.22/util/testutil.h Examining data/leveldb-1.22/util/windows_logger.h Examining data/leveldb-1.22/util/bloom_test.cc FINAL RESULTS: data/leveldb-1.22/util/env_posix.cc:562:14: [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. return ::access(filename.c_str(), F_OK) == 0; data/leveldb-1.22/util/posix_logger.h:84:16: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. std::vsnprintf(buffer + buffer_offset, buffer_size - buffer_offset, data/leveldb-1.22/util/windows_logger.h:78:16: [4] (format) vsnprintf: If format strings can be influenced by an attacker, they can be exploited, and note that sprintf variations do not always \0-terminate (CWE-134). Use a constant for the format specification. std::vsnprintf(buffer + buffer_offset, buffer_size - buffer_offset, data/leveldb-1.22/issues/issue320_test.cc:43:8: [3] (random) srand: This function is not sufficiently random for security-related functions such as key and nonce creation (CWE-327). Use a more secure technique for acquiring random values. std::srand(0); data/leveldb-1.22/util/env_posix.cc:660:28: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* env = std::getenv("TEST_TMPDIR"); data/leveldb-1.22/util/env_windows.cc:581:23: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* env = getenv("TEST_TMPDIR"); data/leveldb-1.22/util/testharness.cc:41:25: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* matcher = getenv("LEVELDB_TESTS"); data/leveldb-1.22/util/testharness.cc:72:21: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* env = getenv("TEST_RANDOM_SEED"); data/leveldb-1.22/db/autocompact_test.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 buf[100]; data/leveldb-1.22/db/c.cc:160:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(result, str.data(), sizeof(char) * str.size()); data/leveldb-1.22/db/c.cc:555:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buffer, result.data(), result.size()); data/leveldb-1.22/db/c_test.c:135:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(result, "fake", 4); data/leveldb-1.22/db/c_test.c:275: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 keybuf[100]; data/leveldb-1.22/db/c_test.c:276: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 valbuf[100]; data/leveldb-1.22/db/corruption_test.cc:171: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 buf[100]; data/leveldb-1.22/db/db_bench.cc:264:7: [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 rate[100]; data/leveldb-1.22/db/db_bench.cc:371:21: [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* cpuinfo = fopen("/proc/cpuinfo", "r"); data/leveldb-1.22/db/db_bench.cc:373:7: [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 line[1000]; data/leveldb-1.22/db/db_bench.cc:652:7: [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[100]; data/leveldb-1.22/db/db_bench.cc:715:7: [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 msg[100]; data/leveldb-1.22/db/db_bench.cc:728:9: [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 key[100]; data/leveldb-1.22/db/db_bench.cc:774:7: [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 key[100]; data/leveldb-1.22/db/db_bench.cc:782: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 msg[100]; data/leveldb-1.22/db/db_bench.cc:791:7: [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 key[100]; data/leveldb-1.22/db/db_bench.cc:804:7: [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 key[100]; data/leveldb-1.22/db/db_bench.cc:817:7: [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 key[100]; data/leveldb-1.22/db/db_bench.cc:825: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 msg[100]; data/leveldb-1.22/db/db_bench.cc:838:9: [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 key[100]; data/leveldb-1.22/db/db_bench.cc:871:9: [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 key[100]; data/leveldb-1.22/db/db_bench.cc:900: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 fname[100]; data/leveldb-1.22/db/db_impl.cc:343: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 buf[50]; data/leveldb-1.22/db/db_impl.cc:1388:7: [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[100]; data/leveldb-1.22/db/db_impl.cc:1395: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 buf[200]; data/leveldb-1.22/db/db_impl.cc:1424: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 buf[50]; data/leveldb-1.22/db/db_test.cc:424:7: [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[100]; data/leveldb-1.22/db/db_test.cc:1022: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 buf[100]; data/leveldb-1.22/db/db_test.cc:1138: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 key[100]; data/leveldb-1.22/db/db_test.cc:1575:7: [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[100]; data/leveldb-1.22/db/db_test.cc:1945: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 valbuf[1500]; data/leveldb-1.22/db/db_test.cc:1950: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 keybuf[20]; data/leveldb-1.22/db/db_test.cc:2230: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 buf[30]; data/leveldb-1.22/db/db_test.cc:2280: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 buf[16]; data/leveldb-1.22/db/dbformat.cc:26: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 buf[50]; data/leveldb-1.22/db/dbformat.cc:133:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst, user_key.data(), usize); data/leveldb-1.22/db/dbformat.h:209: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 space_[200]; // Avoid allocation for short keys data/leveldb-1.22/db/fault_injection_test.cc:438: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 buf[100]; data/leveldb-1.22/db/filename.cc:22: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 buf[100]; data/leveldb-1.22/db/filename.cc:45: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 buf[100]; data/leveldb-1.22/db/log_reader.cc:162:9: [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[40]; data/leveldb-1.22/db/log_test.cc:29: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 buf[50]; data/leveldb-1.22/db/log_writer.cc:88: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 buf[kHeaderSize]; data/leveldb-1.22/db/memtable.cc:90:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, key.data(), key_size); data/leveldb-1.22/db/memtable.cc:95:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(p, value.data(), val_size); data/leveldb-1.22/db/recovery_test.cc:248: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 buf[100]; data/leveldb-1.22/db/recovery_test.cc:267: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 buf[100]; data/leveldb-1.22/db/table_cache.cc:44: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 buf[sizeof(file_number)]; data/leveldb-1.22/db/table_cache.cc:115: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 buf[sizeof(file_number)]; data/leveldb-1.22/db/version_set.cc:208:11: [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. mutable char value_buf_[16]; data/leveldb-1.22/db/version_set.h:268: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 buffer[100]; data/leveldb-1.22/doc/bench/db_bench_sqlite3.cc:210:21: [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* cpuinfo = fopen("/proc/cpuinfo", "r"); data/leveldb-1.22/doc/bench/db_bench_sqlite3.cc:212:7: [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 line[1000]; data/leveldb-1.22/doc/bench/db_bench_sqlite3.cc:288:7: [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 rate[100]; data/leveldb-1.22/doc/bench/db_bench_sqlite3.cc:417: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 file_name[100]; data/leveldb-1.22/doc/bench/db_bench_sqlite3.cc:433: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 cache_size[100]; data/leveldb-1.22/doc/bench/db_bench_sqlite3.cc:441:7: [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 page_size[100]; data/leveldb-1.22/doc/bench/db_bench_sqlite3.cc:489:7: [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 msg[100]; data/leveldb-1.22/doc/bench/db_bench_sqlite3.cc:536:9: [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 key[100]; data/leveldb-1.22/doc/bench/db_bench_sqlite3.cc:608:9: [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 key[100]; data/leveldb-1.22/doc/bench/db_bench_tree_db.cc:187:21: [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* cpuinfo = fopen("/proc/cpuinfo", "r"); data/leveldb-1.22/doc/bench/db_bench_tree_db.cc:189:7: [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 line[1000]; data/leveldb-1.22/doc/bench/db_bench_tree_db.cc:265:7: [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 rate[100]; data/leveldb-1.22/doc/bench/db_bench_tree_db.cc:391: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 file_name[100]; data/leveldb-1.22/doc/bench/db_bench_tree_db.cc:414: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). if (!db_->open(file_name, open_options)) { data/leveldb-1.22/doc/bench/db_bench_tree_db.cc:434:7: [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 msg[100]; data/leveldb-1.22/doc/bench/db_bench_tree_db.cc:442:7: [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 key[100]; data/leveldb-1.22/doc/bench/db_bench_tree_db.cc:467:7: [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 key[100]; data/leveldb-1.22/helpers/memenv/memenv.cc:97:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst, blocks_[block] + block_offset, avail); data/leveldb-1.22/helpers/memenv/memenv.cc:130:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(blocks_.back() + offset, src, avail); data/leveldb-1.22/helpers/memenv/memenv_test.cc:98: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 scratch[100]; data/leveldb-1.22/helpers/memenv/memenv_test.cc:207: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 scratch[kFileDataLen]; data/leveldb-1.22/issues/issue178_test.cc:19: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 buf[100]; data/leveldb-1.22/issues/issue320_test.cc:25: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 bytes[len]; data/leveldb-1.22/table/table.cc:45: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 footer_space[Footer::kEncodedLength]; data/leveldb-1.22/table/table.cc:171:7: [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 cache_key_buffer[16]; data/leveldb-1.22/table/table_builder.cc:184: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 trailer[kBlockTrailerSize]; data/leveldb-1.22/table/table_test.cc:126:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(scratch, &contents_[offset], n); data/leveldb-1.22/table/table_test.cc:623: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 data[sizeof(uint32_t)]; data/leveldb-1.22/table/table_test.cc:715: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[100]; data/leveldb-1.22/table/table_test.cc:718:14: [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). files += atoi(value.c_str()); data/leveldb-1.22/util/bloom_test.cc:67: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 buffer[sizeof(int)]; data/leveldb-1.22/util/bloom_test.cc:111: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 buffer[sizeof(int)]; data/leveldb-1.22/util/cache.cc:53: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 key_data[1]; // Beginning of key data/leveldb-1.22/util/cache.cc:281:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(e->key_data, key.data(), key.size()); data/leveldb-1.22/util/coding.cc:11:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst, &value, sizeof(value)); data/leveldb-1.22/util/coding.cc:22:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dst, &value, sizeof(value)); data/leveldb-1.22/util/coding.cc:36: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 buf[sizeof(value)]; data/leveldb-1.22/util/coding.cc:42: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 buf[sizeof(value)]; data/leveldb-1.22/util/coding.cc:76: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 buf[5]; data/leveldb-1.22/util/coding.cc:93: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 buf[10]; data/leveldb-1.22/util/crc32c_test.cc:15: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 buf[32]; data/leveldb-1.22/util/crc32c_test.cc:33:12: [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 data[48] = { data/leveldb-1.22/util/env_posix.cc:168:14: [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). fd = ::open(filename_.c_str(), O_RDONLY); data/leveldb-1.22/util/env_posix.cc:264:10: [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(buf_ + pos_, write_data, copy_size); data/leveldb-1.22/util/env_posix.cc:280: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(buf_, write_data, write_size); data/leveldb-1.22/util/env_posix.cc:346:16: [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). int fd = ::open(dirname_.c_str(), O_RDONLY); data/leveldb-1.22/util/env_posix.cc:423: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 buf_[kWritableFileBufferSize]; data/leveldb-1.22/util/env_posix.cc:494:16: [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). int fd = ::open(filename.c_str(), O_RDONLY); data/leveldb-1.22/util/env_posix.cc:507:16: [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). int fd = ::open(filename.c_str(), O_RDONLY); data/leveldb-1.22/util/env_posix.cc:539:16: [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). int fd = ::open(filename.c_str(), O_TRUNC | O_WRONLY | O_CREAT, 0644); data/leveldb-1.22/util/env_posix.cc:551:16: [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). int fd = ::open(filename.c_str(), O_APPEND | O_WRONLY | O_CREAT, 0644); data/leveldb-1.22/util/env_posix.cc:621:16: [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). int fd = ::open(filename.c_str(), O_RDWR | O_CREAT, 0644); data/leveldb-1.22/util/env_posix.cc:664:7: [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[100]; data/leveldb-1.22/util/env_posix.cc:677:26: [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). std::FILE* fp = std::fopen(filename.c_str(), "w"); data/leveldb-1.22/util/env_posix_test.cc:33: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(test_file.c_str(), "w"); data/leveldb-1.22/util/env_windows.cc:258:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf_ + pos_, p, copy); data/leveldb-1.22/util/env_windows.cc:274:7: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf_, p, n); data/leveldb-1.22/util/env_windows.cc:317: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 buf_[kWritableFileBufferSize]; data/leveldb-1.22/util/env_windows.cc:468:7: [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 base_name[_MAX_FNAME]; data/leveldb-1.22/util/env_windows.cc:469:7: [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 ext[_MAX_EXT]; data/leveldb-1.22/util/env_windows.cc:587: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 tmp_path[MAX_PATH]; data/leveldb-1.22/util/env_windows.cc:601:26: [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). std::FILE* fp = std::fopen(filename.c_str(), "w"); data/leveldb-1.22/util/env_windows_test.cc:32: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(test_file.c_str(), "w"); data/leveldb-1.22/util/hash_test.cc:13:18: [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. const unsigned char data1[1] = {0x62}; data/leveldb-1.22/util/hash_test.cc:14:18: [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. const unsigned char data2[2] = {0xc3, 0x97}; data/leveldb-1.22/util/hash_test.cc:15:18: [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. const unsigned char data3[3] = {0xe2, 0x99, 0xa5}; data/leveldb-1.22/util/hash_test.cc:16:18: [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. const unsigned char data4[4] = {0xe1, 0x80, 0xb9, 0x32}; data/leveldb-1.22/util/hash_test.cc:17:18: [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. const unsigned char data5[48] = { data/leveldb-1.22/util/histogram.cc:243: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 buf[200]; data/leveldb-1.22/util/logging.cc:20: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 buf[30]; data/leveldb-1.22/util/logging.cc:31:7: [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[10]; data/leveldb-1.22/util/posix_logger.h:53: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 stack_buffer[kStackBufferSize]; data/leveldb-1.22/util/status.cc:17:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(result, state, size + 5); data/leveldb-1.22/util/status.cc:27:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(result, &size, sizeof(size)); data/leveldb-1.22/util/status.cc:29:3: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(result + 5, msg.data(), len1); data/leveldb-1.22/util/status.cc:33:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(result + 7 + len1, msg2.data(), len2); data/leveldb-1.22/util/status.cc:42: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 tmp[30]; data/leveldb-1.22/util/testharness.cc:73: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). int result = (env != nullptr ? atoi(env) : 301); data/leveldb-1.22/util/windows_logger.h:47: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 stack_buffer[kStackBufferSize]; data/leveldb-1.22/db/autocompact_test.cc:82:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ASSERT_LT(read, 100) << "Taking too long to compact"; data/leveldb-1.22/db/c_test.c:34:52: [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). } else if (expected != NULL && v != NULL && n == strlen(expected) && data/leveldb-1.22/db/c_test.c:62: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). val = leveldb_get(db, options, key, strlen(key), &val_len, &err); data/leveldb-1.22/db/c_test.c:286: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). leveldb_put(db, woptions, keybuf, strlen(keybuf), valbuf, strlen(valbuf), data/leveldb-1.22/db/c_test.c:286:65: [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). leveldb_put(db, woptions, keybuf, strlen(keybuf), valbuf, strlen(valbuf), data/leveldb-1.22/db/corruption_test.cc:173:26: [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). storage->assign(buf, strlen(buf)); data/leveldb-1.22/db/db_bench.cc:731:32: [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). bytes += value_size_ + strlen(key); data/leveldb-1.22/db/db_bench.cc:931:36: [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). FLAGS_benchmarks = argv[i] + strlen("--benchmarks="); data/leveldb-1.22/db/db_impl.cc:1382: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). in.remove_prefix(strlen("num-files-at-level")); data/leveldb-1.22/db/fault_injection_test.cc:440:26: [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). storage->assign(buf, strlen(buf)); data/leveldb-1.22/db/filename.cc:91:24: [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). rest.remove_prefix(strlen("MANIFEST-")); data/leveldb-1.22/doc/bench/db_bench_sqlite3.cc:547:32: [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). bytes_ += value_size + strlen(key); data/leveldb-1.22/doc/bench/db_bench_sqlite3.cc:672:36: [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). FLAGS_benchmarks = argv[i] + strlen("--benchmarks="); data/leveldb-1.22/doc/bench/db_bench_tree_db.cc:444: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). bytes_ += value_size + strlen(key); data/leveldb-1.22/doc/bench/db_bench_tree_db.cc:485:36: [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). FLAGS_benchmarks = argv[i] + strlen("--benchmarks="); data/leveldb-1.22/helpers/memenv/memenv_test.cc:181:10: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (read < kWriteSize) { data/leveldb-1.22/helpers/memenv/memenv_test.cc:182:43: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ASSERT_OK(seq_file->Read(kWriteSize - read, &result, scratch)); data/leveldb-1.22/include/leveldb/slice.h:40:42: [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). Slice(const char* s) : data_(s), size_(strlen(s)) {} data/leveldb-1.22/util/env_posix.cc:110:31: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ::ssize_t read_size = ::read(fd_, scratch, n); data/leveldb-1.22/util/env_posix.cc:694:54: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. void SleepForMicroseconds(int micros) override { ::usleep(micros); } data/leveldb-1.22/util/env_test.cc:72:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). Slice read; data/leveldb-1.22/util/env_test.cc:73:43: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ASSERT_OK(sequential_file->Read(len, &read, &scratch[0])); data/leveldb-1.22/util/env_test.cc:75:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ASSERT_GT(read.size(), 0); data/leveldb-1.22/util/env_test.cc:77:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ASSERT_LE(read.size(), len); data/leveldb-1.22/util/env_test.cc:78:24: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read_result.append(read.data(), read.size()); data/leveldb-1.22/util/env_test.cc:78:37: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read_result.append(read.data(), read.size()); ANALYSIS SUMMARY: Hits = 164 Lines analyzed = 28121 in approximately 0.74 seconds (37888 lines/second) Physical Source Lines of Code (SLOC) = 20655 Hits@level = [0] 219 [1] 26 [2] 130 [3] 5 [4] 3 [5] 0 Hits@level+ = [0+] 383 [1+] 164 [2+] 138 [3+] 8 [4+] 3 [5+] 0 Hits/KSLOC@level+ = [0+] 18.5427 [1+] 7.93997 [2+] 6.68119 [3+] 0.387315 [4+] 0.145243 [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.