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/flann-1.9.1+dfsg/examples/flann_example.c Examining data/flann-1.9.1+dfsg/examples/flann_example.cpp Examining data/flann-1.9.1+dfsg/examples/flann_example_mpi.cpp Examining data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/all_indices.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/autotuned_index.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/center_chooser.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/composite_index.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/dist.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/hierarchical_clustering_index.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/kdtree_cuda_3d_index.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/kdtree_cuda_builder.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/kdtree_index.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/kdtree_single_index.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/kmeans_index.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/linear_index.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/lsh_index.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/nn_index.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/config.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/defines.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4.c Examining data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4hc.c Examining data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4hc.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/flann.cpp Examining data/flann-1.9.1+dfsg/src/cpp/flann/flann.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/flann.hpp Examining data/flann-1.9.1+dfsg/src/cpp/flann/flann_cpp.cpp Examining data/flann-1.9.1+dfsg/src/cpp/flann/general.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/io/hdf5.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/mpi/client.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/mpi/flann_mpi_client.cpp Examining data/flann-1.9.1+dfsg/src/cpp/flann/mpi/flann_mpi_server.cpp Examining data/flann-1.9.1+dfsg/src/cpp/flann/mpi/index.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/mpi/matrix.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/mpi/queries.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/mpi/server.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/nn/ground_truth.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/nn/index_testing.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/nn/simplex_downhill.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/allocator.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/any.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/cuda/heap.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/cuda/result_set.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/dynamic_bitset.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/heap.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/logger.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/lsh_table.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/matrix.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/object_factory.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/params.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/random.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/result_set.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/sampling.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/saving.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/timer.h Examining data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h Examining data/flann-1.9.1+dfsg/src/cpp/empty.cpp Examining data/flann-1.9.1+dfsg/src/matlab/nearest_neighbors.cpp Examining data/flann-1.9.1+dfsg/test/flann_autotuned_test.cpp Examining data/flann-1.9.1+dfsg/test/flann_hierarchical_test.cpp Examining data/flann-1.9.1+dfsg/test/flann_kdtree_single_test.cpp Examining data/flann-1.9.1+dfsg/test/flann_kdtree_test.cpp Examining data/flann-1.9.1+dfsg/test/flann_kmeans_test.cpp Examining data/flann-1.9.1+dfsg/test/flann_linear_test.cpp Examining data/flann-1.9.1+dfsg/test/flann_lsh_test.cpp Examining data/flann-1.9.1+dfsg/test/flann_multithreaded_test.cpp Examining data/flann-1.9.1+dfsg/test/flann_tests.h FINAL RESULTS: data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/hierarchical_clustering_index.h:346:35: [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. friend struct serialization::access; data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/hierarchical_clustering_index.h:420:35: [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. friend struct serialization::access; data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/kdtree_index.h:347:35: [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. friend struct serialization::access; data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/kdtree_single_index.h:315:38: [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. friend struct serialization::access; data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/kdtree_single_index.h:331:38: [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. friend struct serialization::access; data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/kmeans_index.h:365:35: [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. friend struct serialization::access; data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/kmeans_index.h:448:35: [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. friend struct serialization::access; data/flann-1.9.1+dfsg/src/cpp/flann/util/dynamic_bitset.h:151:34: [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. friend struct serialization::access; data/flann-1.9.1+dfsg/src/cpp/flann/util/logger.h:76:19: [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. int ret = vfprintf(stream, fmt, arglist); data/flann-1.9.1+dfsg/src/cpp/flann/util/lsh_table.h:325:34: [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. friend struct serialization::access; data/flann-1.9.1+dfsg/src/cpp/flann/util/matrix.h:91:34: [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. friend struct serialization::access; data/flann-1.9.1+dfsg/src/cpp/flann/util/saving.h:58:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(h.signature, FLANN_SIGNATURE_); data/flann-1.9.1+dfsg/src/cpp/flann/util/saving.h:60:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(h.version, FLANN_VERSION_); data/flann-1.9.1+dfsg/src/cpp/flann/util/saving.h:79:34: [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. friend struct serialization::access; data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h:29:8: [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. struct access data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h:42:5: [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. access::serialize(ar,type); data/flann-1.9.1+dfsg/src/matlab/nearest_neighbors.cpp:636:5: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(msg, "%s", "Expecting first argument to be one of: "); data/flann-1.9.1+dfsg/src/matlab/nearest_neighbors.cpp:643:9: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(msg, "%s", __functionTable[i].name); data/flann-1.9.1+dfsg/test/flann_tests.h:147:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(message, "Building %s index... ", index_name); data/flann-1.9.1+dfsg/test/flann_tests.h:184:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(message, "Building %s index... ", index_name); data/flann-1.9.1+dfsg/test/flann_tests.h:224:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(message, "Building %s index... ", index_name); data/flann-1.9.1+dfsg/test/flann_tests.h:296:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(message, "Building %s index... ", index_name); data/flann-1.9.1+dfsg/test/flann_tests.h:365:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(message, "Building %s index... ", index_name); data/flann-1.9.1+dfsg/test/flann_tests.h:437:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(message, "Building %s index... ", index_name); data/flann-1.9.1+dfsg/test/flann_tests.h:509:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(message, "Building %s index... ", index_name); data/flann-1.9.1+dfsg/test/flann_tests.h:577:3: [4] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. sprintf(message, "Building %s index... ", index_name); data/flann-1.9.1+dfsg/src/cpp/flann/util/random.h:50:5: [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. srand(seed); data/flann-1.9.1+dfsg/test/flann_kdtree_single_test.cpp:161:3: [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. srand(static_cast<unsigned int> (time (NULL))); data/flann-1.9.1+dfsg/examples/flann_example.c:16:11: [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). fin = fopen(filename,"r"); data/flann-1.9.1+dfsg/examples/flann_example.c:47:12: [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). fout = fopen(filename,"w"); data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/dist.h:396:31: [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 const unsigned char table[256] = { data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/dist.h:515:13: [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(&a_final, a2, modulo); data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/dist.h:516:13: [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(&b_final, b2, modulo); data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4.c:148: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(&val16, memPtr, 2); data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4.c:169:9: [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(memPtr, &value, 2); data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4.c:182: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(&val32, memPtr, 4); data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4.c:189: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(&val64, memPtr, 8); data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4.c:202:59: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. static void LZ4_copy4(void* dstPtr, const void* srcPtr) { memcpy(dstPtr, srcPtr, 4); } data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4.c:204:59: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. static void LZ4_copy8(void* dstPtr, const void* srcPtr) { memcpy(dstPtr, srcPtr, 8); } data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4.c:648:9: [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(op, anchor, lastRun); data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4.c:884:9: [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(op, anchor, lastRunSize); data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4.c:1186:13: [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(op, ip, length); data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4.c:1228:17: [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(op, dictEnd - copySize, copySize); data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4.c:1239:21: [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(op, lowPrefix, copySize); data/flann-1.9.1+dfsg/src/cpp/flann/ext/lz4hc.c:529:9: [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(op, anchor, iend - anchor); data/flann-1.9.1+dfsg/src/cpp/flann/flann.hpp:179:22: [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* fout = fopen(filename.c_str(), "wb"); data/flann-1.9.1+dfsg/src/cpp/flann/flann.hpp:373: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* fin = fopen(filename.c_str(), "rb"); data/flann-1.9.1+dfsg/src/cpp/flann/mpi/flann_mpi_server.cpp:15:71: [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). flann::mpi::Server<flann::L2<float> > server(argv[1], argv[2], std::atoi(argv[3]), data/flann-1.9.1+dfsg/src/cpp/flann/util/logger.h:66:22: [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). stream = fopen(name,"w"); data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h:16: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 signature[24]; data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h:17: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 version[16]; data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h:435:13: [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(compressed_buffer_, buffer_, headSz); data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h:452:13: [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(compressed_buffer_, &compSz, headSz); data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h:484:19: [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). stream_ = fopen(filename, "wb"); data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h:513:9: [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_+offset_, &val, sizeof(val)); data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h:532:13: [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_, ptr, BLOCK_BYTES); data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h:543:9: [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_+offset_, ptr, size); data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h:622:9: [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_, compBuffer, headSz); data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h:670:9: [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_, head, headSz); data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h:751:19: [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). stream_ = fopen(filename, "rb"); data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h:796:13: [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(ptr, ptr_, BLOCK_BYTES); data/flann-1.9.1+dfsg/src/cpp/flann/util/serialization.h:806:9: [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(ptr, ptr_, size); data/flann-1.9.1+dfsg/src/matlab/nearest_neighbors.cpp:350: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(data,mxGetData(array),mem_size); data/flann-1.9.1+dfsg/src/matlab/nearest_neighbors.cpp:530: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[128]; data/flann-1.9.1+dfsg/src/matlab/nearest_neighbors.cpp:560: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[128]; data/flann-1.9.1+dfsg/src/matlab/nearest_neighbors.cpp:633: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[512]; data/flann-1.9.1+dfsg/src/matlab/nearest_neighbors.cpp:640:13: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(msg,", "); data/flann-1.9.1+dfsg/src/matlab/nearest_neighbors.cpp:657: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 selector[128]; data/flann-1.9.1+dfsg/test/flann_autotuned_test.cpp:144:15: [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("autotuned.idx", "r"); data/flann-1.9.1+dfsg/test/flann_tests.h:145: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 message[256]; data/flann-1.9.1+dfsg/test/flann_tests.h:182: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 message[256]; data/flann-1.9.1+dfsg/test/flann_tests.h:222: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 message[256]; data/flann-1.9.1+dfsg/test/flann_tests.h:294: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 message[256]; data/flann-1.9.1+dfsg/test/flann_tests.h:363: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 message[256]; data/flann-1.9.1+dfsg/test/flann_tests.h:435: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 message[256]; data/flann-1.9.1+dfsg/test/flann_tests.h:507: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 message[256]; data/flann-1.9.1+dfsg/test/flann_tests.h:575: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 message[256]; data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/nn_index.h:242:25: [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). strlen(FLANN_SIGNATURE_) - strlen("v0.0")) != 0) { data/flann-1.9.1+dfsg/src/cpp/flann/algorithms/nn_index.h:242: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). strlen(FLANN_SIGNATURE_) - strlen("v0.0")) != 0) { data/flann-1.9.1+dfsg/src/cpp/flann/mpi/queries.h:75:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). boost::asio::read(sock, boost::asio::buffer(&size, sizeof(size))); data/flann-1.9.1+dfsg/src/cpp/flann/mpi/queries.h:79:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). boost::asio::read(sock, archive_stream, boost::asio::transfer_at_least(size)); data/flann-1.9.1+dfsg/src/cpp/flann/util/saving.h:117:17: [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). strlen(FLANN_SIGNATURE_) - strlen("v0.0")) != 0) { data/flann-1.9.1+dfsg/src/cpp/flann/util/saving.h:117:44: [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). strlen(FLANN_SIGNATURE_) - strlen("v0.0")) != 0) { data/flann-1.9.1+dfsg/src/matlab/nearest_neighbors.cpp:637:15: [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). msg = buf+strlen(buf); data/flann-1.9.1+dfsg/src/matlab/nearest_neighbors.cpp:641:23: [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). msg = buf+strlen(buf); data/flann-1.9.1+dfsg/src/matlab/nearest_neighbors.cpp:644:19: [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). msg = buf+strlen(buf); ANALYSIS SUMMARY: Hits = 86 Lines analyzed = 23658 in approximately 0.77 seconds (30711 lines/second) Physical Source Lines of Code (SLOC) = 15454 Hits@level = [0] 136 [1] 9 [2] 49 [3] 2 [4] 26 [5] 0 Hits@level+ = [0+] 222 [1+] 86 [2+] 77 [3+] 28 [4+] 26 [5+] 0 Hits/KSLOC@level+ = [0+] 14.3652 [1+] 5.5649 [2+] 4.98253 [3+] 1.81183 [4+] 1.68241 [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.