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/yrmcds-1.1.9/cybozu/config_parser.cpp
Examining data/yrmcds-1.1.9/cybozu/config_parser.hpp
Examining data/yrmcds-1.1.9/cybozu/dynbuf.hpp
Examining data/yrmcds-1.1.9/cybozu/filesystem.cpp
Examining data/yrmcds-1.1.9/cybozu/filesystem.hpp
Examining data/yrmcds-1.1.9/cybozu/hash_map.cpp
Examining data/yrmcds-1.1.9/cybozu/hash_map.hpp
Examining data/yrmcds-1.1.9/cybozu/ip_address.cpp
Examining data/yrmcds-1.1.9/cybozu/ip_address.hpp
Examining data/yrmcds-1.1.9/cybozu/logger.cpp
Examining data/yrmcds-1.1.9/cybozu/logger.hpp
Examining data/yrmcds-1.1.9/cybozu/reactor.cpp
Examining data/yrmcds-1.1.9/cybozu/reactor.hpp
Examining data/yrmcds-1.1.9/cybozu/signal.cpp
Examining data/yrmcds-1.1.9/cybozu/signal.hpp
Examining data/yrmcds-1.1.9/cybozu/siphash.cpp
Examining data/yrmcds-1.1.9/cybozu/siphash.hpp
Examining data/yrmcds-1.1.9/cybozu/spinlock.hpp
Examining data/yrmcds-1.1.9/cybozu/tcp.cpp
Examining data/yrmcds-1.1.9/cybozu/tcp.hpp
Examining data/yrmcds-1.1.9/cybozu/test.hpp
Examining data/yrmcds-1.1.9/cybozu/thread.hpp
Examining data/yrmcds-1.1.9/cybozu/util.cpp
Examining data/yrmcds-1.1.9/cybozu/util.hpp
Examining data/yrmcds-1.1.9/cybozu/worker.hpp
Examining data/yrmcds-1.1.9/src/config.cpp
Examining data/yrmcds-1.1.9/src/config.hpp
Examining data/yrmcds-1.1.9/src/constants.hpp
Examining data/yrmcds-1.1.9/src/counter/counter.cpp
Examining data/yrmcds-1.1.9/src/counter/counter.hpp
Examining data/yrmcds-1.1.9/src/counter/gc.cpp
Examining data/yrmcds-1.1.9/src/counter/gc.hpp
Examining data/yrmcds-1.1.9/src/counter/handler.cpp
Examining data/yrmcds-1.1.9/src/counter/handler.hpp
Examining data/yrmcds-1.1.9/src/counter/object.hpp
Examining data/yrmcds-1.1.9/src/counter/sockets.cpp
Examining data/yrmcds-1.1.9/src/counter/sockets.hpp
Examining data/yrmcds-1.1.9/src/counter/stats.cpp
Examining data/yrmcds-1.1.9/src/counter/stats.hpp
Examining data/yrmcds-1.1.9/src/global.cpp
Examining data/yrmcds-1.1.9/src/global.hpp
Examining data/yrmcds-1.1.9/src/handler.hpp
Examining data/yrmcds-1.1.9/src/main.cpp
Examining data/yrmcds-1.1.9/src/memcache/gc.cpp
Examining data/yrmcds-1.1.9/src/memcache/gc.hpp
Examining data/yrmcds-1.1.9/src/memcache/handler.cpp
Examining data/yrmcds-1.1.9/src/memcache/handler.hpp
Examining data/yrmcds-1.1.9/src/memcache/memcache.cpp
Examining data/yrmcds-1.1.9/src/memcache/memcache.hpp
Examining data/yrmcds-1.1.9/src/memcache/object.cpp
Examining data/yrmcds-1.1.9/src/memcache/object.hpp
Examining data/yrmcds-1.1.9/src/memcache/replication.cpp
Examining data/yrmcds-1.1.9/src/memcache/replication.hpp
Examining data/yrmcds-1.1.9/src/memcache/sockets.cpp
Examining data/yrmcds-1.1.9/src/memcache/sockets.hpp
Examining data/yrmcds-1.1.9/src/memcache/stats.cpp
Examining data/yrmcds-1.1.9/src/memcache/stats.hpp
Examining data/yrmcds-1.1.9/src/server.cpp
Examining data/yrmcds-1.1.9/src/server.hpp
Examining data/yrmcds-1.1.9/src/sync.hpp
Examining data/yrmcds-1.1.9/src/tempfile.cpp
Examining data/yrmcds-1.1.9/src/tempfile.hpp
Examining data/yrmcds-1.1.9/test/chrono.cpp
Examining data/yrmcds-1.1.9/test/clear_memory.cpp
Examining data/yrmcds-1.1.9/test/config.cpp
Examining data/yrmcds-1.1.9/test/config_parser.cpp
Examining data/yrmcds-1.1.9/test/counter.cpp
Examining data/yrmcds-1.1.9/test/counter_client.hpp
Examining data/yrmcds-1.1.9/test/counter_interactive.cpp
Examining data/yrmcds-1.1.9/test/counter_request.cpp
Examining data/yrmcds-1.1.9/test/dynbuf.cpp
Examining data/yrmcds-1.1.9/test/hash_map.cpp
Examining data/yrmcds-1.1.9/test/ip_address.cpp
Examining data/yrmcds-1.1.9/test/lambda.cpp
Examining data/yrmcds-1.1.9/test/logger.cpp
Examining data/yrmcds-1.1.9/test/memcache_binary.cpp
Examining data/yrmcds-1.1.9/test/memcache_text.cpp
Examining data/yrmcds-1.1.9/test/mutex.cpp
Examining data/yrmcds-1.1.9/test/object.cpp
Examining data/yrmcds-1.1.9/test/prime.cpp
Examining data/yrmcds-1.1.9/test/protocol_binary.cpp
Examining data/yrmcds-1.1.9/test/reference_wrapper.cpp
Examining data/yrmcds-1.1.9/test/signalfd.cpp
Examining data/yrmcds-1.1.9/test/siphash.cpp
Examining data/yrmcds-1.1.9/test/spinlock.cpp
Examining data/yrmcds-1.1.9/test/tempfile.cpp
Examining data/yrmcds-1.1.9/test/tokenize.cpp
Examining data/yrmcds-1.1.9/test/vector_bool.cpp

FINAL RESULTS:

data/yrmcds-1.1.9/test/memcache_text.cpp:393:10:  [5] (buffer) gets:
  Does not check for buffer overflows (CWE-120, CWE-20). Use fgets() instead.
AUTOTEST(gets) {
data/yrmcds-1.1.9/cybozu/filesystem.hpp:27: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(path.c_str(), R_OK) == 0;
data/yrmcds-1.1.9/cybozu/filesystem.hpp:31: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(path.c_str(), W_OK) == 0;
data/yrmcds-1.1.9/test/counter.cpp:256:16:  [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.
    g_server = getenv("YRMCDS_SERVER");
data/yrmcds-1.1.9/test/counter.cpp:257: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_port = getenv("YRMCDS_PORT");
data/yrmcds-1.1.9/test/object.cpp:12:26:  [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* p = std::getenv("HEAP_LIMIT");
data/yrmcds-1.1.9/test/protocol_binary.cpp:1261:16:  [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.
    g_server = getenv("YRMCDS_SERVER");
data/yrmcds-1.1.9/test/protocol_binary.cpp:1262: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_port = getenv("YRMCDS_PORT");
data/yrmcds-1.1.9/cybozu/dynbuf.hpp:88: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(m_p+m_used, p, len);
data/yrmcds-1.1.9/cybozu/dynbuf.hpp:108:18:  [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(new_p, m_p+len, remain);
data/yrmcds-1.1.9/cybozu/dynbuf.hpp:176:22:  [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(new_p, m_p, m_used);
data/yrmcds-1.1.9/cybozu/ip_address.cpp:55: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(&addr, res->ai_addr, res->ai_addrlen);
data/yrmcds-1.1.9/cybozu/ip_address.cpp:66: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(&addr, res->ai_addr, res->ai_addrlen);
data/yrmcds-1.1.9/cybozu/ip_address.cpp:82: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(&addr, ifa_addr, sizeof(struct sockaddr_in));
data/yrmcds-1.1.9/cybozu/ip_address.cpp:87: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(&addr, ifa_addr, sizeof(struct sockaddr_in6));
data/yrmcds-1.1.9/cybozu/ip_address.cpp:104: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 host[101];
data/yrmcds-1.1.9/cybozu/logger.cpp:17: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[64];
data/yrmcds-1.1.9/cybozu/logger.cpp:37: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).
    m_fd = ::open(path.c_str(), O_WRONLY|O_APPEND|O_CREAT, 0644);
data/yrmcds-1.1.9/cybozu/logger.hpp:101:10:  [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).
    void open(const std::string& path) {
data/yrmcds-1.1.9/cybozu/siphash.cpp:65:27:  [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.
void siphash24_seed(const char key[16]) {
data/yrmcds-1.1.9/cybozu/siphash.hpp:16:27:  [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.
void siphash24_seed(const char key[16]);
data/yrmcds-1.1.9/cybozu/tcp.cpp:196: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(m_tmpbuf.data(), p, len);
data/yrmcds-1.1.9/cybozu/tcp.cpp:208:18:  [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(t_p + t_len, p, to_write);
data/yrmcds-1.1.9/cybozu/tcp.cpp:220: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(t_p, p, to_write);
data/yrmcds-1.1.9/cybozu/tcp.cpp:293:18:  [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(p, v[i].iov_base, v[i].iov_len);
data/yrmcds-1.1.9/cybozu/tcp.cpp:313:18:  [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(t_p + t_len, v[ind].iov_base, to_write);
data/yrmcds-1.1.9/cybozu/util.cpp:40: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[32];
data/yrmcds-1.1.9/cybozu/util.hpp:87: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(p, &n, 2);
data/yrmcds-1.1.9/cybozu/util.hpp:91: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(p, &n, 4);
data/yrmcds-1.1.9/cybozu/util.hpp:95: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(p, &n, 8);
data/yrmcds-1.1.9/src/counter/counter.cpp:25: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[4];
data/yrmcds-1.1.9/src/counter/counter.cpp:127: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(header + 8, m_request.opaque(), 4);
data/yrmcds-1.1.9/src/counter/counter.cpp:131: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 header[HEADER_SIZE];
data/yrmcds-1.1.9/src/counter/counter.cpp:170: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 header[HEADER_SIZE];
data/yrmcds-1.1.9/src/counter/counter.cpp: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 body[4];
data/yrmcds-1.1.9/src/counter/counter.cpp:188: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 header[HEADER_SIZE];
data/yrmcds-1.1.9/src/counter/counter.cpp:189: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 body[10];
data/yrmcds-1.1.9/src/counter/counter.cpp:221: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 header[HEADER_SIZE];
data/yrmcds-1.1.9/src/counter/counter.cpp:232: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 header[HEADER_SIZE];
data/yrmcds-1.1.9/src/main.cpp:43: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[16];
data/yrmcds-1.1.9/src/main.cpp:154:32:  [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).
            logger::instance().open(yrmcds::g_config.logfile());
data/yrmcds-1.1.9/src/memcache/memcache.cpp:559: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[MAX_KEY_LENGTH + 100];
data/yrmcds-1.1.9/src/memcache/memcache.cpp:577: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[MAX_KEY_LENGTH + 100];
data/yrmcds-1.1.9/src/memcache/memcache.cpp:964: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 header[BINARY_HEADER_SIZE + 100];
data/yrmcds-1.1.9/src/memcache/memcache.cpp:966: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(&header[BINARY_HEADER_SIZE], msg, len);
data/yrmcds-1.1.9/src/memcache/memcache.cpp:1010: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 header[BINARY_HEADER_SIZE];
data/yrmcds-1.1.9/src/memcache/memcache.cpp:1019: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 header[BINARY_HEADER_SIZE];
data/yrmcds-1.1.9/src/memcache/memcache.cpp:1021: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 b_flags[sizeof(flags)];
data/yrmcds-1.1.9/src/memcache/memcache.cpp:1037: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 header[BINARY_HEADER_SIZE];
data/yrmcds-1.1.9/src/memcache/memcache.cpp:1046: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 header[BINARY_HEADER_SIZE];
data/yrmcds-1.1.9/src/memcache/memcache.cpp:1053: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 header[BINARY_HEADER_SIZE + sizeof(value)];
data/yrmcds-1.1.9/src/memcache/memcache.cpp:1061: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 header[BINARY_HEADER_SIZE];
data/yrmcds-1.1.9/src/memcache/memcache.cpp:1068: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 header[BINARY_HEADER_SIZE];
data/yrmcds-1.1.9/src/memcache/memcache.cpp:1264: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 header[BINARY_HEADER_SIZE + sizeof(VERSION) - 1];
data/yrmcds-1.1.9/src/memcache/memcache.cpp:1266: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(&header[BINARY_HEADER_SIZE], VERSION, sizeof(VERSION) - 1);
data/yrmcds-1.1.9/src/memcache/memcache.hpp:408: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(buf+12, m_request.opaque(), 4);
data/yrmcds-1.1.9/src/memcache/object.cpp: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 s_value[24]; // uint64 can be as large as 20 byte decimal string.
data/yrmcds-1.1.9/src/memcache/object.cpp:144: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 s_value[24]; // uint64 can be as large as 20 byte decimal string.
data/yrmcds-1.1.9/src/memcache/object.cpp:164: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 s_value[24]; // uint64 can be as large as 20 byte decimal string.
data/yrmcds-1.1.9/src/memcache/replication.cpp:40: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 header[BINARY_HEADER_SIZE];
data/yrmcds-1.1.9/src/memcache/replication.cpp: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 extras[8];
data/yrmcds-1.1.9/src/memcache/replication.cpp:59: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 header[BINARY_HEADER_SIZE];
data/yrmcds-1.1.9/src/memcache/replication.cpp:61: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 extras[4];
data/yrmcds-1.1.9/src/memcache/replication.cpp:74: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 header[BINARY_HEADER_SIZE];
data/yrmcds-1.1.9/src/memcache/sockets.cpp:766:21:  [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[24];
data/yrmcds-1.1.9/src/memcache/sockets.cpp:794:21:  [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[24];
data/yrmcds-1.1.9/test/counter_client.hpp:38: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(m_header, buf.data(), HEADER_SIZE);
data/yrmcds-1.1.9/test/counter_client.hpp:119: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 m_header[HEADER_SIZE] = {};
data/yrmcds-1.1.9/test/counter_client.hpp:150: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 header[HEADER_SIZE];
data/yrmcds-1.1.9/test/counter_client.hpp:158: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 header[HEADER_SIZE];
data/yrmcds-1.1.9/test/counter_client.hpp:160: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 body[2];
data/yrmcds-1.1.9/test/counter_client.hpp:164: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(m_send_buffer.data(), header, HEADER_SIZE);
data/yrmcds-1.1.9/test/counter_client.hpp:165: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(m_send_buffer.data() + HEADER_SIZE, body, sizeof(body));
data/yrmcds-1.1.9/test/counter_client.hpp:166: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(m_send_buffer.data() + HEADER_SIZE + sizeof(body), name.data(), name.size());
data/yrmcds-1.1.9/test/counter_client.hpp:174: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 header[HEADER_SIZE];
data/yrmcds-1.1.9/test/counter_client.hpp:176: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 body[10];
data/yrmcds-1.1.9/test/counter_client.hpp:182: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(m_send_buffer.data(), header, HEADER_SIZE);
data/yrmcds-1.1.9/test/counter_client.hpp:183: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(m_send_buffer.data() + HEADER_SIZE, body, sizeof(body));
data/yrmcds-1.1.9/test/counter_client.hpp:184: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(m_send_buffer.data() + HEADER_SIZE + sizeof(body), name.data(), name.size());
data/yrmcds-1.1.9/test/counter_client.hpp:192: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 header[HEADER_SIZE];
data/yrmcds-1.1.9/test/counter_client.hpp:194: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 body[6];
data/yrmcds-1.1.9/test/counter_client.hpp:199: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(m_send_buffer.data(), header, HEADER_SIZE);
data/yrmcds-1.1.9/test/counter_client.hpp:200: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(m_send_buffer.data() + HEADER_SIZE, body, sizeof(body));
data/yrmcds-1.1.9/test/counter_client.hpp:201: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(m_send_buffer.data() + HEADER_SIZE + sizeof(body), name.data(), name.size());
data/yrmcds-1.1.9/test/counter_client.hpp:209: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 header[HEADER_SIZE];
data/yrmcds-1.1.9/test/counter_client.hpp:217: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 header[HEADER_SIZE];
data/yrmcds-1.1.9/test/dynbuf.cpp:18: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(p, "aaa", 4);
data/yrmcds-1.1.9/test/logger.cpp:11:36:  [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).
        cybozu::logger::instance().open(argv[1]);
data/yrmcds-1.1.9/test/object.cpp:15: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).
        n = (std::size_t)std::atoi(p);
data/yrmcds-1.1.9/test/protocol_binary.cpp:28: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.
typedef char opaque_t[4];
data/yrmcds-1.1.9/test/protocol_binary.cpp:66:18:  [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(m_p+12, opaque, sizeof(opaque_t));
data/yrmcds-1.1.9/test/protocol_binary.cpp:70: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(p, extras, extras_len);
data/yrmcds-1.1.9/test/protocol_binary.cpp:72: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(p, key, key_len);
data/yrmcds-1.1.9/test/protocol_binary.cpp:74: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(p, data, data_len);
data/yrmcds-1.1.9/test/protocol_binary.cpp:247: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 extra[4];
data/yrmcds-1.1.9/test/protocol_binary.cpp:256: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 extra[4];
data/yrmcds-1.1.9/test/protocol_binary.cpp:265: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 extra[4];
data/yrmcds-1.1.9/test/protocol_binary.cpp:289: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 extra[8];
data/yrmcds-1.1.9/test/protocol_binary.cpp:303: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 extra[8];
data/yrmcds-1.1.9/test/protocol_binary.cpp:316: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 extra[8];
data/yrmcds-1.1.9/test/protocol_binary.cpp:330: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 extra[8];
data/yrmcds-1.1.9/test/protocol_binary.cpp:344: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 extra[20];
data/yrmcds-1.1.9/test/protocol_binary.cpp:357: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 extra[20];
data/yrmcds-1.1.9/test/protocol_binary.cpp:417: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 extra[4];
data/yrmcds-1.1.9/test/siphash.cpp:25: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.
    const char key[16] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf };
data/yrmcds-1.1.9/test/siphash.cpp:27: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 plaintext[64];
data/yrmcds-1.1.9/cybozu/signal.hpp:58:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            ssize_t n = read(m_fd, &si, sizeof(si));
data/yrmcds-1.1.9/cybozu/util.cpp:42:28:  [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).
    std::size_t len = std::strlen(ctime_r(&t, buf));
data/yrmcds-1.1.9/cybozu/worker.hpp:81:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            ssize_t n = ::read(m_event, &i, sizeof(i));
data/yrmcds-1.1.9/test/counter_request.cpp:14: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).
    if (lhs.len != std::strlen(rhs))
data/yrmcds-1.1.9/test/signalfd.cpp:16:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ssize_t n = read(fd, p, len);

ANALYSIS SUMMARY:

Hits = 111
Lines analyzed = 13881 in approximately 0.35 seconds (40230 lines/second)
Physical Source Lines of Code (SLOC) = 11149
Hits@level = [0]  20 [1]   5 [2]  98 [3]   5 [4]   2 [5]   1
Hits@level+ = [0+] 131 [1+] 111 [2+] 106 [3+]   8 [4+]   3 [5+]   1
Hits/KSLOC@level+ = [0+] 11.7499 [1+] 9.95605 [2+] 9.50758 [3+] 0.717553 [4+] 0.269082 [5+] 0.0896941
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.