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/gloo-0.0~git20200918.3dc0328/gloo/algorithm.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/algorithm.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/allgather.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/allgather.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/allgather_ring.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/allgatherv.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/allgatherv.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/allreduce.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/allreduce.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_bcube.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_halving_doubling.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_local.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_local.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_ring.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_ring_chunked.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/alltoall.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/alltoall.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/alltoallv.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/alltoallv.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/barrier.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/barrier.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/barrier_all_to_all.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/barrier_all_to_one.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/benchmark.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/cuda_main.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/main.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/runner.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/runner.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/timer.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/broadcast.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/broadcast.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/broadcast_one_to_all.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/common/aligned_allocator.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/common/common.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/common/error.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/common/linux.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/common/linux.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/common/linux_devices.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/common/logging.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/common/logging.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/common/memory.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/common/string.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/common/win.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/common/win.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/context.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/context.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_allreduce_bcube.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_allreduce_bcube.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_allreduce_halving_doubling.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_allreduce_halving_doubling.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_allreduce_halving_doubling_pipelined.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_allreduce_local.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_allreduce_local.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_allreduce_ring.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_allreduce_ring.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_allreduce_ring_chunked.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_allreduce_ring_chunked.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_broadcast_one_to_all.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_broadcast_one_to_all.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_collectives_device.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_collectives_host.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_collectives_native.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_collectives_nccl.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_private.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/cuda_workspace.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/examples/example1.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_allreduce.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_reduce.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/examples/looks_like_mpi.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/gather.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/gather.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/gatherv.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/gatherv.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/math.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/math.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/mpi/context.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/mpi/context.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/mpi/example/main_managed.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/mpi/example/main_unmanaged.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/nccl/nccl.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/pairwise_exchange.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/reduce.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/reduce.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/reduce_scatter.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/rendezvous/context.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/rendezvous/context.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/rendezvous/file_store.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/rendezvous/file_store.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/rendezvous/hash_store.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/rendezvous/hash_store.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/rendezvous/prefix_store.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/rendezvous/prefix_store.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/rendezvous/redis_store.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/rendezvous/redis_store.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/rendezvous/store.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/rendezvous/store.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/scatter.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/scatter.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/allgather_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/allgatherv_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/allreduce_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/alltoall_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/alltoallv_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/barrier_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/base_test.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/broadcast_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/buffer_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/context_factory_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/cuda_allreduce_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/cuda_base_test.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/cuda_broadcast_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/gather_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/gatherv_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/linux_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/main.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/math_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/memory_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/multiproc_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/multiproc_test.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/reduce_scatter_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/reduce_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/scatter_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/send_recv_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/test/transport_test.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/address.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/address.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/buffer.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/buffer.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/context.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/context.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/device.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/device.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/ibverbs/address.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/ibverbs/address.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/ibverbs/buffer.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/ibverbs/buffer.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/ibverbs/context.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/ibverbs/context.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/ibverbs/device.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/ibverbs/device.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/ibverbs/memory_region.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/ibverbs/memory_region.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/ibverbs/pair.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/ibverbs/pair.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/pair.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/pair.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/address.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/address.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/attr.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/buffer.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/buffer.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/context.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/context.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/device.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/device.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/loop.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/loop.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/pair.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/pair.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/unbound_buffer.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/unbound_buffer.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/unbound_buffer.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/unbound_buffer.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/address.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/address.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/common.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/context.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/context.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/device.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/device.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/libuv.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/libuv.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/pair.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/pair.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/unbound_buffer.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/unbound_buffer.h Examining data/gloo-0.0~git20200918.3dc0328/gloo/types.cc Examining data/gloo-0.0~git20200918.3dc0328/gloo/types.h FINAL RESULTS: data/gloo-0.0~git20200918.3dc0328/gloo/common/linux.cc:110:13: [5] (race) readlink: This accepts filename arguments; if an attacker can move those files or change the link content, a race condition results. Also, it does not terminate with ASCII NUL. (CWE-362, CWE-20). Reconsider approach. auto rv = readlink(path.c_str(), buf.data(), buf.size()); data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/common.h:18:7: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf( \ data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/libuv.h:41:7: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf( \ data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:159:11: [3] (buffer) getopt_long: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. opt = getopt_long(argc, argv, "r:s:h:p:x:t:", long_options, &option_index); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:299:17: [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. result.mpi = (getenv("OMPI_UNIVERSE_SIZE") != nullptr); data/gloo-0.0~git20200918.3dc0328/gloo/examples/example1.cc:28:7: [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. if (getenv("PREFIX") == nullptr || data/gloo-0.0~git20200918.3dc0328/gloo/examples/example1.cc:29:7: [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. getenv("SIZE") == nullptr || data/gloo-0.0~git20200918.3dc0328/gloo/examples/example1.cc:30:7: [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. getenv("RANK") == nullptr) { data/gloo-0.0~git20200918.3dc0328/gloo/examples/example1.cc:89:24: [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. std::string prefix = getenv("PREFIX"); data/gloo-0.0~git20200918.3dc0328/gloo/examples/example1.cc:97: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 int rank = atoi(getenv("RANK")); data/gloo-0.0~git20200918.3dc0328/gloo/examples/example1.cc:98: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 int size = atoi(getenv("SIZE")); data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_allreduce.cc:43:7: [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. if (getenv("PREFIX") == nullptr || data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_allreduce.cc:44:7: [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. getenv("SIZE") == nullptr || data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_allreduce.cc:45:7: [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. getenv("RANK") == nullptr) { data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_allreduce.cc:104:24: [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. std::string prefix = getenv("PREFIX"); data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_allreduce.cc:112: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 int rank = atoi(getenv("RANK")); data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_allreduce.cc:113: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 int size = atoi(getenv("SIZE")); data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_reduce.cc:43:7: [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. if (getenv("PREFIX") == nullptr || data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_reduce.cc:44:7: [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. getenv("SIZE") == nullptr || data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_reduce.cc:45:7: [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. getenv("RANK") == nullptr) { data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_reduce.cc:104:24: [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. std::string prefix = getenv("PREFIX"); data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_reduce.cc:112: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 int rank = atoi(getenv("RANK")); data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_reduce.cc:113: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 int size = atoi(getenv("SIZE")); data/gloo-0.0~git20200918.3dc0328/gloo/examples/looks_like_mpi.cc:175:7: [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. if (getenv("PREFIX") == nullptr || data/gloo-0.0~git20200918.3dc0328/gloo/examples/looks_like_mpi.cc:176:7: [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. getenv("SIZE") == nullptr || data/gloo-0.0~git20200918.3dc0328/gloo/examples/looks_like_mpi.cc:177:7: [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. getenv("RANK") == nullptr) { data/gloo-0.0~git20200918.3dc0328/gloo/examples/looks_like_mpi.cc:184:30: [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 std::string prefix = getenv("PREFIX"); data/gloo-0.0~git20200918.3dc0328/gloo/examples/looks_like_mpi.cc:185: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 int rank = atoi(getenv("RANK")); data/gloo-0.0~git20200918.3dc0328/gloo/examples/looks_like_mpi.cc:186: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 int size = atoi(getenv("SIZE")); data/gloo-0.0~git20200918.3dc0328/gloo/rendezvous/file_store.cc:45:14: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. auto ret = realpath(path.c_str(), buf.data()); data/gloo-0.0~git20200918.3dc0328/gloo/allgather.cc:50: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/gloo-0.0~git20200918.3dc0328/gloo/allgather_ring.h:63: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(outPtr_ + rank * inputStride_ + i * count_, inPtrs_[i], bytes_); data/gloo-0.0~git20200918.3dc0328/gloo/allgatherv.cc:107: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( data/gloo-0.0~git20200918.3dc0328/gloo/allreduce.cc:52: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( data/gloo-0.0~git20200918.3dc0328/gloo/allreduce.cc:89: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( data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_bcube.h:347: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(ptrs_[i], ptrs_[0], bytes_); data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_bcube.h:402:14: [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( data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_bcube.h:420: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(ptrs_[i], ptrs_[0], bytes_); data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_halving_doubling.h:235: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(ptrs_[i], ptrs_[0], bytes_); data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_halving_doubling.h:298: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( data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_halving_doubling.h:328: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( data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_halving_doubling.h:342: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(ptrs_[i], ptrs_[0], bytes_); data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_local.cc:36: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(ptrs_[i], ptrs_[0], bytes_); data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_ring.h:76: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(outbox_, ptrs_[0], bytes_); data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_ring.h:94: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(outbox_, inbox_, bytes_); data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_ring.h:107: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(ptrs_[i], ptrs_[0], bytes_); data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_ring_chunked.h:92: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(ptrs_[i], ptrs_[0], bytes_); data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_ring_chunked.h:180: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(&ptrs_[0][offset], inbox_[chunkOffset & 1], length * sizeof(T)); data/gloo-0.0~git20200918.3dc0328/gloo/allreduce_ring_chunked.h:206: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(ptrs_[i], ptrs_[0], bytes_); data/gloo-0.0~git20200918.3dc0328/gloo/alltoall.cc:37: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( data/gloo-0.0~git20200918.3dc0328/gloo/alltoallv.cc:142: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( data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:166:30: [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). result.contextRank = atoi(optarg); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:170:30: [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). result.contextSize = atoi(optarg); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:178:28: [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). result.redisPort = atoi(optarg); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:196:27: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). result.elements = atoi(optarg); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:201:33: [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). result.iterationCount = atoi(optarg); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:212:11: [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). atoi(optarg) == 1 || data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:225:11: [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). atoi(optarg) == 1 || data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:232:25: [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). result.inputs = atoi(optarg); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:247:31: [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). result.destinations = atoi(optarg); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:252:26: [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). result.threads = atoi(optarg); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:262:31: [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). result.ibverbsIndex = atoi(optarg); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:267:30: [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). result.ibverbsPort = atoi(optarg); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:277:23: [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). result.base = atoi(optarg); data/gloo-0.0~git20200918.3dc0328/gloo/broadcast.cc:88: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(out->ptr, in->ptr, out->size); data/gloo-0.0~git20200918.3dc0328/gloo/broadcast_one_to_all.h:110: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(ptrs_[i], ptrs_[rootPointerRank_], bytes_); data/gloo-0.0~git20200918.3dc0328/gloo/common/linux.cc:250: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(ifr.ifr_name, ifname.c_str(), len); data/gloo-0.0~git20200918.3dc0328/gloo/examples/example1.cc:97:20: [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). const int rank = atoi(getenv("RANK")); data/gloo-0.0~git20200918.3dc0328/gloo/examples/example1.cc:98:20: [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). const int size = atoi(getenv("SIZE")); data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_allreduce.cc:112:20: [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). const int rank = atoi(getenv("RANK")); data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_allreduce.cc:113:20: [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). const int size = atoi(getenv("SIZE")); data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_reduce.cc:112:20: [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). const int rank = atoi(getenv("RANK")); data/gloo-0.0~git20200918.3dc0328/gloo/examples/example_reduce.cc:113:20: [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). const int size = atoi(getenv("SIZE")); data/gloo-0.0~git20200918.3dc0328/gloo/examples/looks_like_mpi.cc:185:20: [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). const int rank = atoi(getenv("RANK")); data/gloo-0.0~git20200918.3dc0328/gloo/examples/looks_like_mpi.cc:186:20: [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). const int size = atoi(getenv("SIZE")); data/gloo-0.0~git20200918.3dc0328/gloo/gather.cc:44: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/gloo-0.0~git20200918.3dc0328/gloo/gatherv.cc:94:11: [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/gloo-0.0~git20200918.3dc0328/gloo/mpi/context.cc:125: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(in.data() + (i * maxLength), address.data(), address.size()); data/gloo-0.0~git20200918.3dc0328/gloo/mpi/context.cc:143: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(address.data(), out.data() + offset, maxLength); data/gloo-0.0~git20200918.3dc0328/gloo/reduce.cc:54: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(out->ptr, in->ptr, opts.elements * opts.elementSize); data/gloo-0.0~git20200918.3dc0328/gloo/reduce_scatter.h:333: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(ptrs_[i], ptrs_[0], bytes_); data/gloo-0.0~git20200918.3dc0328/gloo/reduce_scatter.h:408: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( data/gloo-0.0~git20200918.3dc0328/gloo/reduce_scatter.h:415:11: [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/gloo-0.0~git20200918.3dc0328/gloo/reduce_scatter.h:426: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(ptrs_[i], ptrs_[0], bytes_); data/gloo-0.0~git20200918.3dc0328/gloo/rendezvous/file_store.cc:118: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). int fd = open(path.c_str(), O_RDONLY); data/gloo-0.0~git20200918.3dc0328/gloo/scatter.cc:48: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(out->ptr, in[context->rank]->ptr, out->size); data/gloo-0.0~git20200918.3dc0328/gloo/transport/ibverbs/address.cc:32: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(bytes.data(), &addr_, sizeof(addr_)); data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/address.cc:26: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(&impl_.ss, addr, addrlen); data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/address.cc:36: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(bytes.data(), &impl_, sizeof(impl_)); data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/address.cc:41: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 str[INET6_ADDRSTRLEN + 128]; data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/device.cc:47: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(&attr.ai_addr, ifa->ifa_addr, attr.ai_addrlen); data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/device.cc:54: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(&attr.ai_addr, ifa->ifa_addr, attr.ai_addrlen); data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/device.cc:69: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(&attr.ai_addr, ifa->ifa_addr, attr.ai_addrlen); data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/device.cc:117: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(&attr.ai_addr, rp->ai_addr, rp->ai_addrlen); data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/address.cc:33: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(bytes.data(), &impl_, sizeof(impl_)); data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/address.cc:38: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 str[INET6_ADDRSTRLEN + 128]; data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/device.cc:89: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(&attr->ai_addr, &address.address4, sizeof(address.address4)); data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/device.cc:96: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(&attr->ai_addr, &address.address6, sizeof(address.address6)); data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/device.cc:142: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(&attr.ai_addr, rp->ai_addr, rp->ai_addrlen); data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/libuv.h:644: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(data.get(), &t, sizeof(T)); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/cuda_main.cc:172:8: [1] (buffer) equal: Function does not check the second iterator for over-read conditions (CWE-126). This function is often discouraged by most C++ coding standards in favor of its safer alternatives provided since C++14. Consider using a form of this function that checks the second iterator before potentially overflowing it. && equal(match.begin(), match.end(), input.begin()); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:174:48: [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). result.redisHost = std::string(optarg, strlen(optarg)); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:182:45: [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). result.prefix = std::string(optarg, strlen(optarg)); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:186:48: [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). result.transport = std::string(optarg, strlen(optarg)); data/gloo-0.0~git20200918.3dc0328/gloo/benchmark/options.cc:282:49: [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). result.sharedPath = std::string(optarg, strlen(optarg)); data/gloo-0.0~git20200918.3dc0328/gloo/rendezvous/file_store.cc:107:7: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ifs.read(result.data(), n); data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/address.cc:57:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(str); data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/pair.cc:504:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool Pair::read() { data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/pair.cc:714:14: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). while (read()) { data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/pair.cc:993:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). auto rv = read(); data/gloo-0.0~git20200918.3dc0328/gloo/transport/tcp/pair.h:254:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). bool read(); data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/address.cc:54:16: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t len = strlen(str); data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/device.cc:478:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). handle->read(std::move(buf), len); data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/libuv.cc:38:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). segment.read(nread); data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/libuv.h:492:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(ssize_t nread) { data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/libuv.h:599:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(char* ptr, size_t length) { data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/libuv.h:611:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). void read(std::unique_ptr<char[]> buf, size_t length) { data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/pair.cc:148:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). handle_->read((char*)&readOp_.preamble, sizeof(readOp_.preamble)); data/gloo-0.0~git20200918.3dc0328/gloo/transport/uv/pair.cc:243:18: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). handle_->read((char*)op.buf->ptr + op.offset, op.length); ANALYSIS SUMMARY: Hits = 119 Lines analyzed = 28195 in approximately 0.70 seconds (40390 lines/second) Physical Source Lines of Code (SLOC) = 19156 Hits@level = [0] 84 [1] 19 [2] 70 [3] 27 [4] 2 [5] 1 Hits@level+ = [0+] 203 [1+] 119 [2+] 100 [3+] 30 [4+] 3 [5+] 1 Hits/KSLOC@level+ = [0+] 10.5972 [1+] 6.21215 [2+] 5.2203 [3+] 1.56609 [4+] 0.156609 [5+] 0.052203 Dot directories skipped = 2 (--followdotdir overrides) Minimum risk level = 1 Not every hit is necessarily a security vulnerability. There may be other security vulnerabilities; review your code! See 'Secure Programming HOWTO' (https://dwheeler.com/secure-programs) for more information.