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/nanomsg-1.1.5+dfsg/demo/async_demo.c
Examining data/nanomsg-1.1.5+dfsg/demo/device_demo.c
Examining data/nanomsg-1.1.5+dfsg/demo/pthread_demo.c
Examining data/nanomsg-1.1.5+dfsg/demo/pubsub_demo.c
Examining data/nanomsg-1.1.5+dfsg/demo/rpc_demo.c
Examining data/nanomsg-1.1.5+dfsg/perf/inproc_lat.c
Examining data/nanomsg-1.1.5+dfsg/perf/inproc_thr.c
Examining data/nanomsg-1.1.5+dfsg/perf/local_lat.c
Examining data/nanomsg-1.1.5+dfsg/perf/local_thr.c
Examining data/nanomsg-1.1.5+dfsg/perf/remote_lat.c
Examining data/nanomsg-1.1.5+dfsg/perf/remote_thr.c
Examining data/nanomsg-1.1.5+dfsg/src/aio/ctx.c
Examining data/nanomsg-1.1.5+dfsg/src/aio/ctx.h
Examining data/nanomsg-1.1.5+dfsg/src/aio/fsm.c
Examining data/nanomsg-1.1.5+dfsg/src/aio/fsm.h
Examining data/nanomsg-1.1.5+dfsg/src/aio/poller.c
Examining data/nanomsg-1.1.5+dfsg/src/aio/poller.h
Examining data/nanomsg-1.1.5+dfsg/src/aio/poller_epoll.h
Examining data/nanomsg-1.1.5+dfsg/src/aio/poller_kqueue.h
Examining data/nanomsg-1.1.5+dfsg/src/aio/poller_poll.h
Examining data/nanomsg-1.1.5+dfsg/src/aio/pool.c
Examining data/nanomsg-1.1.5+dfsg/src/aio/pool.h
Examining data/nanomsg-1.1.5+dfsg/src/aio/timer.c
Examining data/nanomsg-1.1.5+dfsg/src/aio/timer.h
Examining data/nanomsg-1.1.5+dfsg/src/aio/timerset.c
Examining data/nanomsg-1.1.5+dfsg/src/aio/timerset.h
Examining data/nanomsg-1.1.5+dfsg/src/aio/usock.c
Examining data/nanomsg-1.1.5+dfsg/src/aio/usock.h
Examining data/nanomsg-1.1.5+dfsg/src/aio/usock_posix.h
Examining data/nanomsg-1.1.5+dfsg/src/aio/usock_win.h
Examining data/nanomsg-1.1.5+dfsg/src/aio/worker.c
Examining data/nanomsg-1.1.5+dfsg/src/aio/worker.h
Examining data/nanomsg-1.1.5+dfsg/src/aio/worker_posix.h
Examining data/nanomsg-1.1.5+dfsg/src/aio/worker_win.h
Examining data/nanomsg-1.1.5+dfsg/src/bus.h
Examining data/nanomsg-1.1.5+dfsg/src/core/ep.c
Examining data/nanomsg-1.1.5+dfsg/src/core/ep.h
Examining data/nanomsg-1.1.5+dfsg/src/core/global.c
Examining data/nanomsg-1.1.5+dfsg/src/core/global.h
Examining data/nanomsg-1.1.5+dfsg/src/core/pipe.c
Examining data/nanomsg-1.1.5+dfsg/src/core/poll.c
Examining data/nanomsg-1.1.5+dfsg/src/core/sock.c
Examining data/nanomsg-1.1.5+dfsg/src/core/sock.h
Examining data/nanomsg-1.1.5+dfsg/src/core/sockbase.c
Examining data/nanomsg-1.1.5+dfsg/src/core/symbol.c
Examining data/nanomsg-1.1.5+dfsg/src/devices/device.c
Examining data/nanomsg-1.1.5+dfsg/src/devices/device.h
Examining data/nanomsg-1.1.5+dfsg/src/inproc.h
Examining data/nanomsg-1.1.5+dfsg/src/ipc.h
Examining data/nanomsg-1.1.5+dfsg/src/nn.h
Examining data/nanomsg-1.1.5+dfsg/src/pair.h
Examining data/nanomsg-1.1.5+dfsg/src/pipeline.h
Examining data/nanomsg-1.1.5+dfsg/src/protocol.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/bus/bus.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/bus/xbus.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/bus/xbus.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pair/pair.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pair/xpair.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pair/xpair.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pipeline/pull.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pipeline/push.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pipeline/xpull.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pipeline/xpull.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pipeline/xpush.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pipeline/xpush.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pubsub/pub.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pubsub/sub.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pubsub/trie.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pubsub/trie.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pubsub/xpub.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pubsub/xpub.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pubsub/xsub.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/pubsub/xsub.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/reqrep/rep.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/reqrep/rep.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/reqrep/req.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/reqrep/req.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/reqrep/task.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/reqrep/task.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/reqrep/xrep.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/reqrep/xrep.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/reqrep/xreq.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/reqrep/xreq.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/survey/respondent.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/survey/surveyor.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/survey/xrespondent.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/survey/xrespondent.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/survey/xsurveyor.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/survey/xsurveyor.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/utils/dist.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/utils/dist.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/utils/excl.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/utils/excl.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/utils/fq.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/utils/fq.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/utils/lb.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/utils/lb.h
Examining data/nanomsg-1.1.5+dfsg/src/protocols/utils/priolist.c
Examining data/nanomsg-1.1.5+dfsg/src/protocols/utils/priolist.h
Examining data/nanomsg-1.1.5+dfsg/src/pubsub.h
Examining data/nanomsg-1.1.5+dfsg/src/reqrep.h
Examining data/nanomsg-1.1.5+dfsg/src/survey.h
Examining data/nanomsg-1.1.5+dfsg/src/tcp.h
Examining data/nanomsg-1.1.5+dfsg/src/transport.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/inproc/binproc.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/inproc/binproc.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/inproc/cinproc.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/inproc/cinproc.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/inproc/inproc.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/inproc/ins.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/inproc/ins.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/inproc/msgqueue.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/inproc/msgqueue.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/inproc/sinproc.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/inproc/sinproc.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/ipc/aipc.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/ipc/aipc.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/ipc/bipc.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/ipc/bipc.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/ipc/cipc.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/ipc/cipc.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/ipc/ipc.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/ipc/sipc.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/ipc/sipc.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/tcp/atcp.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/tcp/atcp.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/tcp/btcp.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/tcp/btcp.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/tcp/ctcp.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/tcp/ctcp.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/tcp/stcp.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/tcp/stcp.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/tcp/tcp.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/backoff.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/backoff.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/base64.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/base64.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/dns.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/dns.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/dns_getaddrinfo.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/dns_getaddrinfo_a.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/iface.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/iface.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/literal.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/literal.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/port.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/port.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/streamhdr.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/utils/streamhdr.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/ws/aws.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/ws/aws.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/ws/bws.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/ws/bws.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/ws/cws.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/ws/cws.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/ws/sha1.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/ws/sha1.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/ws/sws.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/ws/sws.h
Examining data/nanomsg-1.1.5+dfsg/src/transports/ws/ws.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c
Examining data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/alloc.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/alloc.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/atomic.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/atomic.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/attr.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/chunk.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/chunk.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/chunkref.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/chunkref.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/clock.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/clock.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/closefd.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/closefd.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/condvar.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/condvar.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/cont.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/efd.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/efd.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/efd_eventfd.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/efd_pipe.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/efd_socketpair.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/efd_win.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/err.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/err.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/fast.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/fd.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/hash.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/hash.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/list.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/list.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/msg.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/msg.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/mutex.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/mutex.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/once.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/once.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/queue.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/queue.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/random.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/random.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/sem.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/sem.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/sleep.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/sleep.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/stopwatch.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/stopwatch.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/strcasecmp.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/strcasecmp.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/strcasestr.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/strcasestr.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/strncasecmp.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/strncasecmp.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/thread.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/thread.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/thread_posix.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/thread_win.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/win.h
Examining data/nanomsg-1.1.5+dfsg/src/utils/wire.c
Examining data/nanomsg-1.1.5+dfsg/src/utils/wire.h
Examining data/nanomsg-1.1.5+dfsg/src/ws.h
Examining data/nanomsg-1.1.5+dfsg/tests/async_shutdown.c
Examining data/nanomsg-1.1.5+dfsg/tests/block.c
Examining data/nanomsg-1.1.5+dfsg/tests/bug328.c
Examining data/nanomsg-1.1.5+dfsg/tests/bug777.c
Examining data/nanomsg-1.1.5+dfsg/tests/bus.c
Examining data/nanomsg-1.1.5+dfsg/tests/cmsg.c
Examining data/nanomsg-1.1.5+dfsg/tests/device.c
Examining data/nanomsg-1.1.5+dfsg/tests/device4.c
Examining data/nanomsg-1.1.5+dfsg/tests/device5.c
Examining data/nanomsg-1.1.5+dfsg/tests/device6.c
Examining data/nanomsg-1.1.5+dfsg/tests/device7.c
Examining data/nanomsg-1.1.5+dfsg/tests/domain.c
Examining data/nanomsg-1.1.5+dfsg/tests/emfile.c
Examining data/nanomsg-1.1.5+dfsg/tests/hash.c
Examining data/nanomsg-1.1.5+dfsg/tests/inproc.c
Examining data/nanomsg-1.1.5+dfsg/tests/inproc_shutdown.c
Examining data/nanomsg-1.1.5+dfsg/tests/iovec.c
Examining data/nanomsg-1.1.5+dfsg/tests/ipc.c
Examining data/nanomsg-1.1.5+dfsg/tests/ipc_shutdown.c
Examining data/nanomsg-1.1.5+dfsg/tests/ipc_stress.c
Examining data/nanomsg-1.1.5+dfsg/tests/list.c
Examining data/nanomsg-1.1.5+dfsg/tests/msg.c
Examining data/nanomsg-1.1.5+dfsg/tests/pair.c
Examining data/nanomsg-1.1.5+dfsg/tests/pipeline.c
Examining data/nanomsg-1.1.5+dfsg/tests/poll.c
Examining data/nanomsg-1.1.5+dfsg/tests/prio.c
Examining data/nanomsg-1.1.5+dfsg/tests/pubsub.c
Examining data/nanomsg-1.1.5+dfsg/tests/reqrep.c
Examining data/nanomsg-1.1.5+dfsg/tests/reqttl.c
Examining data/nanomsg-1.1.5+dfsg/tests/separation.c
Examining data/nanomsg-1.1.5+dfsg/tests/shutdown.c
Examining data/nanomsg-1.1.5+dfsg/tests/stats.c
Examining data/nanomsg-1.1.5+dfsg/tests/survey.c
Examining data/nanomsg-1.1.5+dfsg/tests/surveyttl.c
Examining data/nanomsg-1.1.5+dfsg/tests/symbol.c
Examining data/nanomsg-1.1.5+dfsg/tests/tcp.c
Examining data/nanomsg-1.1.5+dfsg/tests/tcp_shutdown.c
Examining data/nanomsg-1.1.5+dfsg/tests/term.c
Examining data/nanomsg-1.1.5+dfsg/tests/testutil.h
Examining data/nanomsg-1.1.5+dfsg/tests/timeo.c
Examining data/nanomsg-1.1.5+dfsg/tests/trie.c
Examining data/nanomsg-1.1.5+dfsg/tests/win_sec_attr.c
Examining data/nanomsg-1.1.5+dfsg/tests/ws.c
Examining data/nanomsg-1.1.5+dfsg/tests/ws_async_shutdown.c
Examining data/nanomsg-1.1.5+dfsg/tests/zerocopy.c
Examining data/nanomsg-1.1.5+dfsg/tools/nanocat.c
Examining data/nanomsg-1.1.5+dfsg/tools/options.c
Examining data/nanomsg-1.1.5+dfsg/tools/options.h

FINAL RESULTS:

data/nanomsg-1.1.5+dfsg/demo/device_demo.c:127:9:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
        sprintf (greeting, fmt, daytime, username, (int)getpid());
data/nanomsg-1.1.5+dfsg/demo/rpc_demo.c:128:9:  [4] (format) sprintf:
  Potential format string problem (CWE-134). Make format string constant.
        sprintf (greeting, fmt, daytime, username);
data/nanomsg-1.1.5+dfsg/src/core/ep.c:66:5:  [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 (self->addr, addr);
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:1263:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf (self->opening_hs,
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:1307:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf (self->response,
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:1350:9:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
        sprintf (self->response,
data/nanomsg-1.1.5+dfsg/src/utils/err.h:61:13:  [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 (stderr, \
data/nanomsg-1.1.5+dfsg/tests/testutil.h:212:5:  [4] (buffer) sprintf:
  Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or
  vsnprintf.
    sprintf(out, "%s://%s:%d", proto, ip, port);
data/nanomsg-1.1.5+dfsg/tools/options.c:461:24:  [4] (format) snprintf:
  If format strings can be influenced by an attacker, they can be exploited,
  and note that sprintf variations do not always \0-terminate (CWE-134). Use
  a constant for the format specification.
            data_len = snprintf (data, data_buf, opt->pointer, argument);
data/nanomsg-1.1.5+dfsg/src/core/global.c:247:14:  [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.
    envvar = getenv("NN_PRINT_ERRORS");
data/nanomsg-1.1.5+dfsg/src/core/sock.c:406:39:  [3] (buffer) getopt:
  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.
        return self->sockbase->vfptr->getopt (self->sockbase,
data/nanomsg-1.1.5+dfsg/src/core/sock.c:415:31:  [3] (buffer) getopt:
  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.
        return optset->vfptr->getopt (optset, option, optval, optvallen);
data/nanomsg-1.1.5+dfsg/src/protocol.h:125:11:  [3] (buffer) getopt:
  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.
    int (*getopt) (struct nn_sockbase *self, int level, int option,
data/nanomsg-1.1.5+dfsg/src/transport.h:51:11:  [3] (buffer) getopt:
  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.
    int (*getopt) (struct nn_optset *self, int option, void *optval,
data/nanomsg-1.1.5+dfsg/src/utils/mutex.c:33:5:  [3] (misc) InitializeCriticalSection:
  Exceptions can be thrown in low-memory situations. Use
  InitializeCriticalSectionAndSpinCount instead.
    InitializeCriticalSection (&self->cs);
data/nanomsg-1.1.5+dfsg/src/utils/mutex.c:46:5:  [3] (misc) EnterCriticalSection:
  On some versions of Windows, exceptions can be thrown in low-memory
  situations. Use InitializeCriticalSectionAndSpinCount instead.
    EnterCriticalSection (&self->cs);
data/nanomsg-1.1.5+dfsg/demo/async_demo.c:231:12:  [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).
    msec = atoi(msecstr);
data/nanomsg-1.1.5+dfsg/demo/async_demo.c:246: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 (msg, &msec, sizeof (msec));
data/nanomsg-1.1.5+dfsg/demo/device_demo.c:80: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 username[128];
data/nanomsg-1.1.5+dfsg/demo/device_demo.c:81: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 greeting[128];
data/nanomsg-1.1.5+dfsg/demo/device_demo.c:188: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(greeting, msg, rc);
data/nanomsg-1.1.5+dfsg/demo/pthread_demo.c:191:12:  [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).
    msec = atoi(msecstr);
data/nanomsg-1.1.5+dfsg/demo/pthread_demo.c:206: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 (msg, &msec, sizeof (msec));
data/nanomsg-1.1.5+dfsg/demo/pubsub_demo.c: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 (msg, &secs, sizeof (secs));
data/nanomsg-1.1.5+dfsg/demo/pubsub_demo.c:93: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 (msg + sizeof (secs), &subs, sizeof (subs));
data/nanomsg-1.1.5+dfsg/demo/pubsub_demo.c:138: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 hhmmss[9];  /* HH:MM:SS\0 */
data/nanomsg-1.1.5+dfsg/demo/rpc_demo.c:81: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 username[128];
data/nanomsg-1.1.5+dfsg/demo/rpc_demo.c:82: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 greeting[128];
data/nanomsg-1.1.5+dfsg/demo/rpc_demo.c:187: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(greeting, msg, rc);
data/nanomsg-1.1.5+dfsg/perf/inproc_lat.c:81: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).
    message_size = atoi (argv [1]);
data/nanomsg-1.1.5+dfsg/perf/inproc_lat.c:82: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).
    roundtrip_count = atoi (argv [2]);
data/nanomsg-1.1.5+dfsg/perf/inproc_thr.c:83: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).
    message_size = atoi (argv [1]);
data/nanomsg-1.1.5+dfsg/perf/inproc_thr.c:84:21:  [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).
    message_count = atoi (argv [2]);
data/nanomsg-1.1.5+dfsg/perf/local_lat.c:52:10:  [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).
    sz = atoi (argv [2]);
data/nanomsg-1.1.5+dfsg/perf/local_lat.c:53: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).
    rts = atoi (argv [3]);
data/nanomsg-1.1.5+dfsg/perf/local_thr.c:54:10:  [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).
    sz = atoi (argv [2]);
data/nanomsg-1.1.5+dfsg/perf/local_thr.c:55:13:  [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).
    count = atoi (argv [3]);
data/nanomsg-1.1.5+dfsg/perf/remote_lat.c:56:10:  [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).
    sz = atoi (argv [2]);
data/nanomsg-1.1.5+dfsg/perf/remote_lat.c:57: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).
    rts = atoi (argv [3]);
data/nanomsg-1.1.5+dfsg/perf/remote_thr.c:51:10:  [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).
    sz = atoi (argv [2]);
data/nanomsg-1.1.5+dfsg/perf/remote_thr.c:52:13:  [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).
    count = atoi (argv [3]);
data/nanomsg-1.1.5+dfsg/src/core/ep.c:62: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 (&self->options, &sock->ep_template, sizeof(struct nn_ep_options));
data/nanomsg-1.1.5+dfsg/src/core/ep.h:43: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 addr [NN_SOCKADDR_MAX + 1];
data/nanomsg-1.1.5+dfsg/src/core/global.c:779: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 (((uint8_t*) nn_chunkref_data (&msg.body)) + sz,
data/nanomsg-1.1.5+dfsg/src/core/global.c:800: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 (nn_chunkref_data (&msg.hdrs),
data/nanomsg-1.1.5+dfsg/src/core/global.c:816:26:  [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 (nn_chunkref_data (&msg.sphdr),
data/nanomsg-1.1.5+dfsg/src/core/global.c:911: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 (iov->iov_base, data, sz);
data/nanomsg-1.1.5+dfsg/src/core/global.c:914: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 (iov->iov_base, data, iov->iov_len);
data/nanomsg-1.1.5+dfsg/src/core/global.c:958: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, nn_chunkref_data (&msg.sphdr), spsz);
data/nanomsg-1.1.5+dfsg/src/core/global.c:965: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 (((char*) ctrl) + sptotalsz,
data/nanomsg-1.1.5+dfsg/src/core/pipe.c:61: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 (&self->options, &ep->options, sizeof (struct nn_ep_options));
data/nanomsg-1.1.5+dfsg/src/core/pipe.c:151: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 (optval, &intval,
data/nanomsg-1.1.5+dfsg/src/core/sock.c:143:5:  [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(self->socket_name, "%d", fd);
data/nanomsg-1.1.5+dfsg/src/core/sock.c:311: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 (self->socket_name, optval, optvallen);
data/nanomsg-1.1.5+dfsg/src/core/sock.c:468: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 (optval, &fd,
data/nanomsg-1.1.5+dfsg/src/core/sock.c:476: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 (optval, &fd,
data/nanomsg-1.1.5+dfsg/src/core/sock.c:488: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 (optval, &intval,
data/nanomsg-1.1.5+dfsg/src/core/sock.h:132: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 socket_name[64];
data/nanomsg-1.1.5+dfsg/src/core/symbol.c:209:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy(buf, &sym_value_names [i], buflen);
data/nanomsg-1.1.5+dfsg/src/protocols/bus/xbus.c:194: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 (nn_chunkref_data (&msg->sphdr), &pipe, sizeof (pipe));
data/nanomsg-1.1.5+dfsg/src/protocols/pubsub/trie.c:225: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 (ch->prefix, self->prefix, self->prefix_len);
data/nanomsg-1.1.5+dfsg/src/protocols/pubsub/trie.c:295: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 ((*node)->prefix, ch->prefix, pos);
data/nanomsg-1.1.5+dfsg/src/protocols/pubsub/trie.c:385: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 ((*node)->prefix, old_node->prefix, old_node->prefix_len);
data/nanomsg-1.1.5+dfsg/src/protocols/pubsub/trie.c:419: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 ((*node)->prefix, data, (*node)->prefix_len);
data/nanomsg-1.1.5+dfsg/src/protocols/pubsub/trie.c:609: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 (new_node->prefix, (*self)->prefix, new_node->prefix_len);
data/nanomsg-1.1.5+dfsg/src/protocols/reqrep/xrep.c:245: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 (nn_chunkref_data (&msg->sphdr), data, i * sizeof (uint32_t));
data/nanomsg-1.1.5+dfsg/src/protocols/reqrep/xrep.c:254: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 (((uint8_t*) nn_chunkref_data (&ref)) + sizeof (uint32_t),
data/nanomsg-1.1.5+dfsg/src/protocols/reqrep/xreq.c:199: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 (nn_chunkref_data (&msg->sphdr), nn_chunkref_data (&msg->body),
data/nanomsg-1.1.5+dfsg/src/protocols/survey/xrespondent.c:244: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 (nn_chunkref_data (&msg->sphdr), data, i * sizeof (uint32_t));
data/nanomsg-1.1.5+dfsg/src/protocols/survey/xrespondent.c:252: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 (((uint8_t *) nn_chunkref_data (&ref)) + sizeof (uint32_t),
data/nanomsg-1.1.5+dfsg/src/protocols/survey/xsurveyor.c: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 (nn_chunkref_data (&msg->sphdr), nn_chunkref_data (&msg->body),
data/nanomsg-1.1.5+dfsg/src/transports/inproc/sinproc.c:156: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 (nn_chunkref_data (&nmsg.body),
data/nanomsg-1.1.5+dfsg/src/transports/inproc/sinproc.c:159: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 ((char *)nn_chunkref_data (&nmsg.body) +
data/nanomsg-1.1.5+dfsg/src/transports/ipc/ipc.c:149: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(optval, &optset->sec_attr, sizeof(optset->sec_attr));
data/nanomsg-1.1.5+dfsg/src/transports/tcp/tcp.c:150: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 (optval, &intval,
data/nanomsg-1.1.5+dfsg/src/transports/utils/dns_getaddrinfo_a.h:37: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 hostname [NN_SOCKADDR_MAX];
data/nanomsg-1.1.5+dfsg/src/transports/utils/iface.c:77: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 (&((struct sockaddr_in6*) result)->sin6_addr,
data/nanomsg-1.1.5+dfsg/src/transports/utils/literal.c:39: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 addrz [INET6_ADDRSTRLEN > INET_ADDRSTRLEN ?
data/nanomsg-1.1.5+dfsg/src/transports/utils/literal.c: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 (addrz, addr + 1, addrlen - 2);
data/nanomsg-1.1.5+dfsg/src/transports/utils/literal.c:58: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 (addrz, addr, addrlen);
data/nanomsg-1.1.5+dfsg/src/transports/utils/streamhdr.c:103: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 (self->protohdr, "\0SP\0\0\0\0\0", 8);
data/nanomsg-1.1.5+dfsg/src/transports/ws/cws.c:209: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 (nn_chunkref_data (&self->remote_host), hostname, hostlen);
data/nanomsg-1.1.5+dfsg/src/transports/ws/cws.c:214: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 (nn_chunkref_data (&self->nic),
data/nanomsg-1.1.5+dfsg/src/transports/ws/cws.c:219: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 (nn_chunkref_data (&self->nic), "*", 1);
data/nanomsg-1.1.5+dfsg/src/transports/ws/sha1.c:32: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 c[4];
data/nanomsg-1.1.5+dfsg/src/transports/ws/sws.c:442: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 (&sws->outhdr [hdr_len], rand_mask, NN_SWS_FRAME_SIZE_MASK);
data/nanomsg-1.1.5+dfsg/src/transports/ws/sws.c:520: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 (((uint8_t*) nn_chunkref_data (&msg->body)) + pos,
data/nanomsg-1.1.5+dfsg/src/transports/ws/sws.c:556: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 (((uint8_t*) nn_chunkref_data (&msg->body)),
data/nanomsg-1.1.5+dfsg/src/transports/ws/sws.c:576: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 (NN_CMSG_DATA (cmsg), &opcode_hdr, sizeof (opcode_hdr));
data/nanomsg-1.1.5+dfsg/src/transports/ws/sws.c:657: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 (self->utf8_code_pt_fragment, pos, len);
data/nanomsg-1.1.5+dfsg/src/transports/ws/sws.c:799: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 (&self->fail_msg [NN_SWS_FRAME_SIZE_INITIAL],
data/nanomsg-1.1.5+dfsg/src/transports/ws/sws.c:816: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 (payload_pos + NN_SWS_CLOSE_CODE_LEN, reason, reason_len);
data/nanomsg-1.1.5+dfsg/src/transports/ws/sws.h:159: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 fail_msg [NN_SWS_PAYLOAD_MAX_LENGTH];
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws.c:148: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 (optval, &optset->msg_type,
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:1233: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 encoded_key [24 + 1];
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:1289: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 accept_key [NN_WS_HANDSHAKE_ACCEPT_KEY_LEN + 1];
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.h:89: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 opening_hs [NN_WS_HANDSHAKE_MAX_SIZE];
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.h:127: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 expected_accept_key [NN_WS_HANDSHAKE_ACCEPT_KEY_LEN + 1];
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.h:145: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 response [512];
data/nanomsg-1.1.5+dfsg/src/utils/chunk.c:159: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 (new_ptr, nn_chunk_getdata (self), self->size);
data/nanomsg-1.1.5+dfsg/src/utils/chunkref.c:91: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 (chunk, &self->u.ref [1], self->u.ref [0]);
data/nanomsg-1.1.5+dfsg/src/utils/chunkref.c:98:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy (dst, src, src->u.ref [0] == 0xff ?
data/nanomsg-1.1.5+dfsg/src/utils/chunkref.c:110:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy (dst, src, sizeof (struct nn_chunkref));
data/nanomsg-1.1.5+dfsg/src/utils/chunkref.c:154:5:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
    memcpy (dst, src, sizeof (struct nn_chunkref));
data/nanomsg-1.1.5+dfsg/src/utils/err.h:110:13:  [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 errstr [256];\
data/nanomsg-1.1.5+dfsg/src/utils/err.h:125:13:  [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 errstr [256];\
data/nanomsg-1.1.5+dfsg/src/utils/random.c: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 (&nn_random_state, "\xfa\x9b\x23\xe3\x07\xcc\x61\x1f", 8);
data/nanomsg-1.1.5+dfsg/src/utils/random.c:66: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 (pos, &nn_random_state, len > 8 ? 8 : len);
data/nanomsg-1.1.5+dfsg/src/utils/win.h:39: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 sun_path [sizeof (struct sockaddr_storage) -
data/nanomsg-1.1.5+dfsg/tests/async_shutdown.c:64: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 socket_address[128];
data/nanomsg-1.1.5+dfsg/tests/bug328.c:34: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 socket_address[128];
data/nanomsg-1.1.5+dfsg/tests/bus.c:36: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 [3];
data/nanomsg-1.1.5+dfsg/tests/cmsg.c:38:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char body [3];
data/nanomsg-1.1.5+dfsg/tests/cmsg.c:39:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char ctrl [256];
data/nanomsg-1.1.5+dfsg/tests/cmsg.c:43: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 socket_address[128];
data/nanomsg-1.1.5+dfsg/tests/device4.c:34:8:  [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 char socket_address_f[128], socket_address_g[128];
data/nanomsg-1.1.5+dfsg/tests/device5.c:34:8:  [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 char socket_address_h[128], socket_address_i[128], socket_address_j[128];
data/nanomsg-1.1.5+dfsg/tests/device6.c:34:8:  [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 char socket_address_h[128], socket_address_i[128], socket_address_j[128];
data/nanomsg-1.1.5+dfsg/tests/device7.c:37:8:  [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 char socket_address_h[128], socket_address_j[128];
data/nanomsg-1.1.5+dfsg/tests/inproc.c: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 buf [256];
data/nanomsg-1.1.5+dfsg/tests/inproc.c:46:14:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    unsigned char body [3];
data/nanomsg-1.1.5+dfsg/tests/iovec.c:39: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 [6];
data/nanomsg-1.1.5+dfsg/tests/ipc_stress.c:78:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char msg[3];
data/nanomsg-1.1.5+dfsg/tests/msg.c:34:1:  [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 longdata[1 << 20];
data/nanomsg-1.1.5+dfsg/tests/msg.c:45: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 socket_address_tcp[128];
data/nanomsg-1.1.5+dfsg/tests/poll.c:126: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 [3];
data/nanomsg-1.1.5+dfsg/tests/pubsub.c:37: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 [8];
data/nanomsg-1.1.5+dfsg/tests/reqrep.c:38: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 [7];
data/nanomsg-1.1.5+dfsg/tests/reqttl.c:34:8:  [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 char socket_address_a[128];
data/nanomsg-1.1.5+dfsg/tests/reqttl.c:35:8:  [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 char socket_address_b[128];
data/nanomsg-1.1.5+dfsg/tests/separation.c:46: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 socket_address_tcp[128];
data/nanomsg-1.1.5+dfsg/tests/shutdown.c:35: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 socket_address[128];
data/nanomsg-1.1.5+dfsg/tests/stats.c:33: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 socket_address[128];
data/nanomsg-1.1.5+dfsg/tests/survey.c:39: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 [7];
data/nanomsg-1.1.5+dfsg/tests/surveyttl.c:34:8:  [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 char socket_address_a[128];
data/nanomsg-1.1.5+dfsg/tests/surveyttl.c:35:8:  [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 char socket_address_b[128];
data/nanomsg-1.1.5+dfsg/tests/tcp.c:45: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 addr[128];
data/nanomsg-1.1.5+dfsg/tests/tcp.c:46: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 socket_address[128];
data/nanomsg-1.1.5+dfsg/tests/tcp_shutdown.c:50:8:  [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 char socket_address[128];
data/nanomsg-1.1.5+dfsg/tests/term.c:33: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 [3];
data/nanomsg-1.1.5+dfsg/tests/testutil.h: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 buf[1024];
data/nanomsg-1.1.5+dfsg/tests/testutil.h:206:12:  [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).
    return atoi(argc < 2 ? "5555" : argv[1]);
data/nanomsg-1.1.5+dfsg/tests/timeo.c:34: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 [3];
data/nanomsg-1.1.5+dfsg/tests/ws.c:32:8:  [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 char socket_address[128];
data/nanomsg-1.1.5+dfsg/tests/ws.c:63:5:  [2] (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). Risk is low because the source is a constant string.
    strcpy ((char *)bad, "BAD.");
data/nanomsg-1.1.5+dfsg/tests/ws.c:85: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 any_address[128];
data/nanomsg-1.1.5+dfsg/tests/ws_async_shutdown.c:30:8:  [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 char socket_address [128];
data/nanomsg-1.1.5+dfsg/tests/ws_async_shutdown.c:41:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char msg[1];
data/nanomsg-1.1.5+dfsg/tests/zerocopy.c: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 (p, "Hello World!", 12);
data/nanomsg-1.1.5+dfsg/tests/zerocopy.c:170: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 (p, "Hello World!", 12);
data/nanomsg-1.1.5+dfsg/tests/zerocopy.c:190: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 (((char*) p1) + 12, " 42", 3);
data/nanomsg-1.1.5+dfsg/tools/options.c:471:24:  [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 = fopen (argument, "r");
data/nanomsg-1.1.5+dfsg/demo/device_demo.c:120:14:  [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 ((strlen (username) + strlen (daytime) + strlen (fmt)) >=
data/nanomsg-1.1.5+dfsg/demo/device_demo.c:120:34:  [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 ((strlen (username) + strlen (daytime) + strlen (fmt)) >=
data/nanomsg-1.1.5+dfsg/demo/device_demo.c:120:53:  [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 ((strlen (username) + strlen (daytime) + strlen (fmt)) >=
data/nanomsg-1.1.5+dfsg/demo/device_demo.c:129:37:  [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).
        rc = nn_send (fd, greeting, strlen (greeting), 0);
data/nanomsg-1.1.5+dfsg/demo/device_demo.c:164:5:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
    usleep(1000);
data/nanomsg-1.1.5+dfsg/demo/device_demo.c:166:32:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (nn_send (fd, username, strlen (username), 0) < 0) {
data/nanomsg-1.1.5+dfsg/demo/rpc_demo.c:121:14:  [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 ((strlen (username) + strlen (daytime) + strlen (fmt)) >=
data/nanomsg-1.1.5+dfsg/demo/rpc_demo.c:121:34:  [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 ((strlen (username) + strlen (daytime) + strlen (fmt)) >=
data/nanomsg-1.1.5+dfsg/demo/rpc_demo.c:121:53:  [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 ((strlen (username) + strlen (daytime) + strlen (fmt)) >=
data/nanomsg-1.1.5+dfsg/demo/rpc_demo.c:130:37:  [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).
        rc = nn_send (fd, greeting, strlen (greeting), 0);
data/nanomsg-1.1.5+dfsg/demo/rpc_demo.c:165:32:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    if (nn_send (fd, username, strlen (username), 0) < 0) {
data/nanomsg-1.1.5+dfsg/src/core/ep.c:65: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).
    nn_assert (strlen (addr) <= NN_SOCKADDR_MAX);
data/nanomsg-1.1.5+dfsg/src/core/global.c:1068:9:  [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 (strlen (addr) >= NN_SOCKADDR_MAX)
data/nanomsg-1.1.5+dfsg/src/core/global.c:1084:13:  [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 (strlen (tp->name) == protosz &&
data/nanomsg-1.1.5+dfsg/src/core/sock.c:481:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy (optval, self->socket_name, *optvallen);
data/nanomsg-1.1.5+dfsg/src/core/sock.c:482:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        *optvallen = strlen(self->socket_name);
data/nanomsg-1.1.5+dfsg/src/transports/ipc/bipc.c:292: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).
    nn_assert (strlen (addr) < sizeof (un->sun_path));
data/nanomsg-1.1.5+dfsg/src/transports/ipc/bipc.c:294:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy (un->sun_path, addr, sizeof (un->sun_path));
data/nanomsg-1.1.5+dfsg/src/transports/ipc/cipc.c:402: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).
    nn_assert (strlen (addr) < sizeof (un->sun_path));
data/nanomsg-1.1.5+dfsg/src/transports/ipc/cipc.c:404:5:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
    strncpy (un->sun_path, addr, sizeof (un->sun_path));
data/nanomsg-1.1.5+dfsg/src/transports/tcp/btcp.c:123:18:  [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).
    end = addr + strlen (addr);
data/nanomsg-1.1.5+dfsg/src/transports/tcp/btcp.c:337:18:  [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).
    end = addr + strlen (addr);
data/nanomsg-1.1.5+dfsg/src/transports/tcp/ctcp.c:145: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).
    addrlen = strlen (addr);
data/nanomsg-1.1.5+dfsg/src/transports/tcp/ctcp.c:546:18:  [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).
    end = addr + strlen (addr);
data/nanomsg-1.1.5+dfsg/src/transports/ws/bws.c:117:18:  [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).
    end = addr + strlen (addr);
data/nanomsg-1.1.5+dfsg/src/transports/ws/bws.c:324:18:  [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).
    end = addr + strlen (addr);
data/nanomsg-1.1.5+dfsg/src/transports/ws/cws.c:165: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).
    addrlen = strlen (addr);
data/nanomsg-1.1.5+dfsg/src/transports/ws/cws.c:223: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).
    resourcelen = strlen (resource);
data/nanomsg-1.1.5+dfsg/src/transports/ws/cws.c:226:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy (nn_chunkref_data (&self->resource),
data/nanomsg-1.1.5+dfsg/src/transports/ws/cws.c:232:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120). Risk is low because the source is a
  constant character.
        strncpy (nn_chunkref_data (&self->resource), "/", 2);
data/nanomsg-1.1.5+dfsg/src/transports/ws/cws.c:586: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).
    nn_assert (strlen (host) > 0);
data/nanomsg-1.1.5+dfsg/src/transports/ws/sws.c:774:18:  [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).
    reason_len = strlen (reason);
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:195:20:  [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).
        nn_assert (strlen (resource) >= 1);
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:219:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        self->recv_len = strlen (
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:230:26:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        self->recv_len = strlen ("HTTP/1.1 xxx\r\n\r\n");
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:334: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).
        *subj = end + strlen (termseq);
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:369:9:  [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 (strlen (expected) != subj_len)
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:866: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).
    nn_assert (strlen (self->opening_hs) < sizeof (self->opening_hs));
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:919:12:  [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).
    while (strlen (pos))
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:955:34:  [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).
                self->conn_len = strlen ("upgrade");
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:992: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).
    nn_assert (strlen (pos) == 0);
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:1087: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).
    nn_assert (strlen (self->response) < sizeof (self->response));
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:1129:12:  [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).
    while (strlen (pos))
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:1184: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).
    nn_assert (strlen (pos) == 0);
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:1241: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).
    encoded_key_len = strlen (encoded_key);
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:1274: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).
    open_request.iov_len = strlen (self->opening_hs);
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:1300:20:  [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).
        nn_assert (strlen (accept_key) == NN_WS_HANDSHAKE_ACCEPT_KEY_LEN);
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:1304:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy (protocol, self->protocol, self->protocol_len);
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:1346:9:  [1] (buffer) strncpy:
  Easily used incorrectly; doesn't always \0-terminate or check for invalid
  pointers [MS-banned] (CWE-120).
        strncpy (version, self->version, self->version_len);
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:1358:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
    response.iov_len = strlen (self->response);
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.c:1378:21:  [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).
    for (i = 0; i < strlen (NN_WS_HANDSHAKE_MAGIC_GUID); i++)
data/nanomsg-1.1.5+dfsg/src/transports/ws/ws_handshake.h:54:37:  [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).
#define NN_WS_HANDSHAKE_TERMSEQ_LEN strlen (NN_WS_HANDSHAKE_TERMSEQ)
data/nanomsg-1.1.5+dfsg/src/utils/strcasestr.c:31: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).
	size_t len = strlen(key);
data/nanomsg-1.1.5+dfsg/tests/ipc_stress.c:86:14:  [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).
    sz_msg = strlen (msg) + 1;
data/nanomsg-1.1.5+dfsg/tests/testutil.h:135: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).
    data_len = strlen (data);
data/nanomsg-1.1.5+dfsg/tests/testutil.h:158: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).
    data_len = strlen (data);
data/nanomsg-1.1.5+dfsg/tests/win_sec_attr.c:133:16:  [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.
    nn_assert (equal);
data/nanomsg-1.1.5+dfsg/tools/nanocat.c:332: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 (options->subscriptions.items[i]));
data/nanomsg-1.1.5+dfsg/tools/nanocat.c:370:50:  [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).
                           options->socket_name, strlen(options->socket_name));
data/nanomsg-1.1.5+dfsg/tools/options.c:137:9:  [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 (strlen (str) < width) {
data/nanomsg-1.1.5+dfsg/tools/options.c:176:22:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
        optlen = 3 + strlen (opt->longname);
data/nanomsg-1.1.5+dfsg/tools/options.c:184:27:  [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).
                optlen += strlen (opt->metavar) + 1;
data/nanomsg-1.1.5+dfsg/tools/options.c:217:20:  [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).
            olen = strlen (ousage);
data/nanomsg-1.1.5+dfsg/tools/options.c:221:21:  [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 (olen != strlen (opt->longname)+2) {
data/nanomsg-1.1.5+dfsg/tools/options.c:435: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).
            blob->length = strlen (argument);
data/nanomsg-1.1.5+dfsg/tools/options.c:455:24:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
            data_buf = strlen (argument) + strlen (opt->pointer);
data/nanomsg-1.1.5+dfsg/tools/options.c:455: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).
            data_buf = strlen (argument) + strlen (opt->pointer);

ANALYSIS SUMMARY:

Hits = 219
Lines analyzed = 38807 in approximately 1.09 seconds (35476 lines/second)
Physical Source Lines of Code (SLOC) = 23303
Hits@level = [0] 190 [1]  67 [2] 136 [3]   7 [4]   9 [5]   0
Hits@level+ = [0+] 409 [1+] 219 [2+] 152 [3+]  16 [4+]   9 [5+]   0
Hits/KSLOC@level+ = [0+] 17.5514 [1+] 9.39793 [2+] 6.52277 [3+] 0.686607 [4+] 0.386216 [5+]   0
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.