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/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp
Examining data/pdns-4.3.1/ext/ipcrypt/ipcrypt.c
Examining data/pdns-4.3.1/ext/ipcrypt/ipcrypt.h
Examining data/pdns-4.3.1/ext/lmdb-safe/lmdb-typed.cc
Examining data/pdns-4.3.1/ext/lmdb-safe/lmdb-safe.cc
Examining data/pdns-4.3.1/ext/json11/json11.cpp
Examining data/pdns-4.3.1/ext/json11/json11.hpp
Examining data/pdns-4.3.1/ext/yahttp/yahttp/router.cpp
Examining data/pdns-4.3.1/ext/yahttp/yahttp/reqresp.hpp
Examining data/pdns-4.3.1/ext/yahttp/yahttp/url.hpp
Examining data/pdns-4.3.1/ext/yahttp/yahttp/yahttp-config.h
Examining data/pdns-4.3.1/ext/yahttp/yahttp/cookie.hpp
Examining data/pdns-4.3.1/ext/yahttp/yahttp/yahttp.hpp
Examining data/pdns-4.3.1/ext/yahttp/yahttp/utility.hpp
Examining data/pdns-4.3.1/ext/yahttp/yahttp/exception.hpp
Examining data/pdns-4.3.1/ext/yahttp/yahttp/router.hpp
Examining data/pdns-4.3.1/ext/yahttp/yahttp/reqresp.cpp
Examining data/pdns-4.3.1/pdns/backends/gsql/gsqlbackend.cc
Examining data/pdns-4.3.1/pdns/ixfrdist-stats.cc
Examining data/pdns-4.3.1/pdns/iputils.cc
Examining data/pdns-4.3.1/pdns/test-signers.cc
Examining data/pdns-4.3.1/pdns/secpoll-auth.cc
Examining data/pdns-4.3.1/pdns/mastercommunicator.cc
Examining data/pdns-4.3.1/pdns/test-ipcrypt_cc.cc
Examining data/pdns-4.3.1/pdns/communicator.cc
Examining data/pdns-4.3.1/pdns/common_startup.cc
Examining data/pdns-4.3.1/pdns/test-statbag_cc.cc
Examining data/pdns-4.3.1/pdns/logger.cc
Examining data/pdns-4.3.1/pdns/calidns.cc
Examining data/pdns-4.3.1/pdns/cdb.cc
Examining data/pdns-4.3.1/pdns/slavecommunicator.cc
Examining data/pdns-4.3.1/pdns/tsig-tests.cc
Examining data/pdns-4.3.1/pdns/test-dnsparser_cc.cc
Examining data/pdns-4.3.1/pdns/bindparser.cc
Examining data/pdns-4.3.1/pdns/base32.cc
Examining data/pdns-4.3.1/pdns/responsestats.cc
Examining data/pdns-4.3.1/pdns/nproxy.cc
Examining data/pdns-4.3.1/pdns/pollmplexer.cc
Examining data/pdns-4.3.1/pdns/dumresp.cc
Examining data/pdns-4.3.1/pdns/dnspacket.cc
Examining data/pdns-4.3.1/pdns/sodiumsigners.cc
Examining data/pdns-4.3.1/pdns/dbdnsseckeeper.cc
Examining data/pdns-4.3.1/pdns/mtasker.cc
Examining data/pdns-4.3.1/pdns/bindlexer.c
Examining data/pdns-4.3.1/pdns/dnsscan.cc
Examining data/pdns-4.3.1/pdns/test-dnsrecordcontent.cc
Examining data/pdns-4.3.1/pdns/threadname.cc
Examining data/pdns-4.3.1/pdns/nsec3dig.cc
Examining data/pdns-4.3.1/pdns/fuzz_dnsdistcache.cc
Examining data/pdns-4.3.1/pdns/bind-dnssec.schema.sqlite3.sql.h
Examining data/pdns-4.3.1/pdns/test-digests_hh.cc
Examining data/pdns-4.3.1/pdns/signingpipe.cc
Examining data/pdns-4.3.1/pdns/dnsdist-ecs.cc
Examining data/pdns-4.3.1/pdns/opensslsigners.cc
Examining data/pdns-4.3.1/pdns/lua-auth4.cc
Examining data/pdns-4.3.1/pdns/arguments.cc
Examining data/pdns-4.3.1/pdns/fuzz_zoneparsertng.cc
Examining data/pdns-4.3.1/pdns/sdig.cc
Examining data/pdns-4.3.1/pdns/dnswasher.cc
Examining data/pdns-4.3.1/pdns/dynhandler.cc
Examining data/pdns-4.3.1/pdns/test-lua_auth4_cc.cc
Examining data/pdns-4.3.1/pdns/dnsdist-cache.cc
Examining data/pdns-4.3.1/pdns/ixfrdist-web.cc
Examining data/pdns-4.3.1/pdns/zoneparser-tng.cc
Examining data/pdns-4.3.1/pdns/dnssecinfra.cc
Examining data/pdns-4.3.1/pdns/dns.cc
Examining data/pdns-4.3.1/pdns/test-sha_hh.cc
Examining data/pdns-4.3.1/pdns/test-zoneparser_tng_cc.cc
Examining data/pdns-4.3.1/pdns/tsigverifier.cc
Examining data/pdns-4.3.1/pdns/dnslabeltext.cc
Examining data/pdns-4.3.1/pdns/rcpgenerator.cc
Examining data/pdns-4.3.1/pdns/test-tsig.cc
Examining data/pdns-4.3.1/pdns/dnsparser.cc
Examining data/pdns-4.3.1/pdns/dynlistener.cc
Examining data/pdns-4.3.1/pdns/stubquery.cc
Examining data/pdns-4.3.1/pdns/unix_semaphore.cc
Examining data/pdns-4.3.1/pdns/decafsigners.cc
Examining data/pdns-4.3.1/pdns/ipcipher.cc
Examining data/pdns-4.3.1/pdns/fuzz_moadnsparser.cc
Examining data/pdns-4.3.1/pdns/bindparser.h
Examining data/pdns-4.3.1/pdns/tkey.cc
Examining data/pdns-4.3.1/pdns/test-base64_cc.cc
Examining data/pdns-4.3.1/pdns/dynloader.cc
Examining data/pdns-4.3.1/pdns/test-packetcache_hh.cc
Examining data/pdns-4.3.1/pdns/test-mplexer.cc
Examining data/pdns-4.3.1/pdns/gss_context.cc
Examining data/pdns-4.3.1/pdns/ednssubnet.cc
Examining data/pdns-4.3.1/pdns/secpoll.cc
Examining data/pdns-4.3.1/pdns/ws-api.cc
Examining data/pdns-4.3.1/pdns/resolver.cc
Examining data/pdns-4.3.1/pdns/uuid-utils.cc
Examining data/pdns-4.3.1/pdns/dns_random_urandom.cc
Examining data/pdns-4.3.1/pdns/dnspcap2protobuf.cc
Examining data/pdns-4.3.1/pdns/test-base32_cc.cc
Examining data/pdns-4.3.1/pdns/testrunner.cc
Examining data/pdns-4.3.1/pdns/tsigutils.cc
Examining data/pdns-4.3.1/pdns/kqueuemplexer.cc
Examining data/pdns-4.3.1/pdns/test-rcpgenerator_cc.cc
Examining data/pdns-4.3.1/pdns/dnsreplay.cc
Examining data/pdns-4.3.1/pdns/dnssecsigner.cc
Examining data/pdns-4.3.1/pdns/test-packetcache_cc.cc
Examining data/pdns-4.3.1/pdns/toysdig.cc
Examining data/pdns-4.3.1/pdns/misc.cc
Examining data/pdns-4.3.1/pdns/kvresp.cc
Examining data/pdns-4.3.1/pdns/dnsproxy.cc
Examining data/pdns-4.3.1/pdns/stubresolver.cc
Examining data/pdns-4.3.1/pdns/sillyrecords.cc
Examining data/pdns-4.3.1/pdns/ixfrdist.cc
Examining data/pdns-4.3.1/pdns/ednscookies.cc
Examining data/pdns-4.3.1/pdns/epollmplexer.cc
Examining data/pdns-4.3.1/pdns/notify.cc
Examining data/pdns-4.3.1/pdns/dnsgram.cc
Examining data/pdns-4.3.1/pdns/auth-carbon.cc
Examining data/pdns-4.3.1/pdns/ednsoptions.cc
Examining data/pdns-4.3.1/pdns/saxfr.cc
Examining data/pdns-4.3.1/pdns/unix_utility.cc
Examining data/pdns-4.3.1/pdns/dnsdemog.cc
Examining data/pdns-4.3.1/pdns/minicurl.cc
Examining data/pdns-4.3.1/pdns/nameserver.cc
Examining data/pdns-4.3.1/pdns/devpollmplexer.cc
Examining data/pdns-4.3.1/pdns/test-arguments_cc.cc
Examining data/pdns-4.3.1/pdns/dnsscope.cc
Examining data/pdns-4.3.1/pdns/serialtweaker.cc
Examining data/pdns-4.3.1/pdns/ueberbackend.cc
Examining data/pdns-4.3.1/pdns/base64.cc
Examining data/pdns-4.3.1/pdns/test-dnswriter_cc.cc
Examining data/pdns-4.3.1/pdns/dnsbulktest.cc
Examining data/pdns-4.3.1/pdns/ixfrutils.cc
Examining data/pdns-4.3.1/pdns/test-dnsname_cc.cc
Examining data/pdns-4.3.1/pdns/pkcs11signers.cc
Examining data/pdns-4.3.1/pdns/test-misc_hh.cc
Examining data/pdns-4.3.1/pdns/test-nameserver_cc.cc
Examining data/pdns-4.3.1/pdns/test-dns_random_hh.cc
Examining data/pdns-4.3.1/pdns/portsmplexer.cc
Examining data/pdns-4.3.1/pdns/dnstcpbench.cc
Examining data/pdns-4.3.1/pdns/dnspcap2calidns.cc
Examining data/pdns-4.3.1/pdns/version.cc
Examining data/pdns-4.3.1/pdns/ws-auth.cc
Examining data/pdns-4.3.1/pdns/test-dnsparser_hh.cc
Examining data/pdns-4.3.1/pdns/dnsrecords.cc
Examining data/pdns-4.3.1/pdns/pdnsutil.cc
Examining data/pdns-4.3.1/pdns/dnsbackend.cc
Examining data/pdns-4.3.1/pdns/comfun.cc
Examining data/pdns-4.3.1/pdns/fuzz_packetcache.cc
Examining data/pdns-4.3.1/pdns/responsestats-auth.cc
Examining data/pdns-4.3.1/pdns/webserver.cc
Examining data/pdns-4.3.1/pdns/statnode.cc
Examining data/pdns-4.3.1/pdns/validate.cc
Examining data/pdns-4.3.1/pdns/dynmessenger.cc
Examining data/pdns-4.3.1/pdns/nsecrecords.cc
Examining data/pdns-4.3.1/pdns/test-iputils_hh.cc
Examining data/pdns-4.3.1/pdns/lua-record.cc
Examining data/pdns-4.3.1/pdns/inflighter.cc
Examining data/pdns-4.3.1/pdns/test-lock_hh.cc
Examining data/pdns-4.3.1/pdns/statbag.cc
Examining data/pdns-4.3.1/pdns/zone2sql.cc
Examining data/pdns-4.3.1/pdns/dnspcap.cc
Examining data/pdns-4.3.1/pdns/ixfr.cc
Examining data/pdns-4.3.1/pdns/auth-querycache.cc
Examining data/pdns-4.3.1/pdns/speedtest.cc
Examining data/pdns-4.3.1/pdns/test-dnsrecords_cc.cc
Examining data/pdns-4.3.1/pdns/qtype.cc
Examining data/pdns-4.3.1/pdns/tcpreceiver.cc
Examining data/pdns-4.3.1/pdns/lua-base4.cc
Examining data/pdns-4.3.1/pdns/json.cc
Examining data/pdns-4.3.1/pdns/test-ixfr_cc.cc
Examining data/pdns-4.3.1/pdns/dns_random.cc
Examining data/pdns-4.3.1/pdns/auth-caches.cc
Examining data/pdns-4.3.1/pdns/receiver.cc
Examining data/pdns-4.3.1/pdns/packethandler.cc
Examining data/pdns-4.3.1/pdns/ssqlite3.cc
Examining data/pdns-4.3.1/pdns/protobuf.cc
Examining data/pdns-4.3.1/pdns/ixplore.cc
Examining data/pdns-4.3.1/pdns/auth-packetcache.cc
Examining data/pdns-4.3.1/pdns/rfc2136handler.cc
Examining data/pdns-4.3.1/pdns/dnsname.cc
Examining data/pdns-4.3.1/pdns/test-distributor_hh.cc
Examining data/pdns-4.3.1/pdns/zone2ldap.cc
Examining data/pdns-4.3.1/pdns/dnswriter.cc
Examining data/pdns-4.3.1/pdns/zone2json.cc
Examining data/pdns-4.3.1/pdns/gettime.cc
Examining data/pdns-4.3.1/pdns/test-bindparser_cc.cc
Examining data/pdns-4.3.1/modules/gmysqlbackend/gmysqlbackend.cc
Examining data/pdns-4.3.1/modules/gmysqlbackend/smysql.cc
Examining data/pdns-4.3.1/modules/bindbackend/binddnssec.cc
Examining data/pdns-4.3.1/modules/bindbackend/bindbackend2.cc
Examining data/pdns-4.3.1/modules/ldapbackend/ldapbackend.cc
Examining data/pdns-4.3.1/modules/ldapbackend/native.cc
Examining data/pdns-4.3.1/modules/ldapbackend/ldaputils.cc
Examining data/pdns-4.3.1/modules/ldapbackend/powerldap.cc
Examining data/pdns-4.3.1/modules/ldapbackend/master.cc
Examining data/pdns-4.3.1/modules/ldapbackend/ldapauthenticator.cc
Examining data/pdns-4.3.1/modules/geoipbackend/geoipinterface.cc
Examining data/pdns-4.3.1/modules/geoipbackend/geoipinterface-dat.cc
Examining data/pdns-4.3.1/modules/geoipbackend/geoipbackend.cc
Examining data/pdns-4.3.1/modules/geoipbackend/geoipinterface-mmdb.cc
Examining data/pdns-4.3.1/modules/tinydnsbackend/tinydnsbackend.cc
Examining data/pdns-4.3.1/modules/lmdbbackend/lmdbbackend.cc
Examining data/pdns-4.3.1/modules/gpgsqlbackend/gpgsqlbackend.cc
Examining data/pdns-4.3.1/modules/gpgsqlbackend/spgsql.cc
Examining data/pdns-4.3.1/modules/remotebackend/unixconnector.cc
Examining data/pdns-4.3.1/modules/remotebackend/test-remotebackend-http.cc
Examining data/pdns-4.3.1/modules/remotebackend/test-remotebackend-json.cc
Examining data/pdns-4.3.1/modules/remotebackend/pipeconnector.cc
Examining data/pdns-4.3.1/modules/remotebackend/test-remotebackend.cc
Examining data/pdns-4.3.1/modules/remotebackend/test-remotebackend-pipe.cc
Examining data/pdns-4.3.1/modules/remotebackend/httpconnector.cc
Examining data/pdns-4.3.1/modules/remotebackend/test-remotebackend-unix.cc
Examining data/pdns-4.3.1/modules/remotebackend/zmqconnector.cc
Examining data/pdns-4.3.1/modules/remotebackend/test-remotebackend-post.cc
Examining data/pdns-4.3.1/modules/remotebackend/remotebackend.cc
Examining data/pdns-4.3.1/modules/remotebackend/test-remotebackend-zeromq.cc
Examining data/pdns-4.3.1/modules/gsqlite3backend/gsqlite3backend.cc
Examining data/pdns-4.3.1/modules/godbcbackend/godbcbackend.cc
Examining data/pdns-4.3.1/modules/godbcbackend/sodbc.cc
Examining data/pdns-4.3.1/modules/randombackend/randombackend.cc
Examining data/pdns-4.3.1/modules/pipebackend/coprocess.cc
Examining data/pdns-4.3.1/modules/pipebackend/pipebackend.cc
Examining data/pdns-4.3.1/modules/lua2backend/lua2backend.cc
Examining data/pdns-4.3.1/modules/lua2backend/lua2api2.cc

FINAL RESULTS:

data/pdns-4.3.1/pdns/dynlistener.cc:135:8:  [5] (race) chmod:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchmod( ) instead.
    if(chmod(fname.c_str(),0660)<0)
data/pdns-4.3.1/pdns/dynlistener.cc:137:8:  [5] (race) chown:
  This accepts filename arguments; if an attacker can move those files, a
  race condition results. (CWE-362). Use fchown( ) instead.
    if(chown(fname.c_str(),static_cast<uid_t>(-1), strToGID(arg()["setgid"]))<0)
data/pdns-4.3.1/ext/json11/json11.hpp:65:17:  [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.
        #ifndef snprintf
data/pdns-4.3.1/ext/json11/json11.hpp:66:21:  [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.
            #define snprintf _snprintf_s
data/pdns-4.3.1/modules/pipebackend/coprocess.cc:60:6:  [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.
  if(access(d_argv[0],X_OK)) // check before fork so we can throw
data/pdns-4.3.1/modules/pipebackend/coprocess.cc:96:8:  [4] (shell) execv:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    if(execv(d_argv[0], const_cast<char * const *>(d_argv.data()))<0) // now what
data/pdns-4.3.1/modules/remotebackend/pipeconnector.cc:74:6:  [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.
  if(access(argv[0],X_OK)) // check before fork so we can throw
data/pdns-4.3.1/modules/remotebackend/pipeconnector.cc:109:8:  [4] (shell) execv:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
    if(execv(argv[0], const_cast<char * const *>(argv.data()))<0) // now what
data/pdns-4.3.1/pdns/bindparser.cc:756:21:  [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.
#  define YYFPRINTF fprintf
data/pdns-4.3.1/pdns/dnsname.cc:449:18:  [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.
      auto got = snprintf(buf, sizeof(buf), "%03" PRIu8, p);
data/pdns-4.3.1/pdns/pdnsutil.cc:919:11:  [4] (shell) system:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
  int err=system(cmdline.c_str());
data/pdns-4.3.1/pdns/receiver.cc:270:10:  [4] (shell) execvp:
  This causes a new program to execute and is difficult to use safely
  (CWE-78). try using a library call that implements the same functionality
  if available.
      if(execvp(argv[0], newargv)<0) {
data/pdns-4.3.1/pdns/ssqlite3.cc:190:7:  [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.
  if (access( database.c_str(), F_OK ) == -1){
data/pdns-4.3.1/pdns/common_startup.cc:525:13:  [3] (random) srandom:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
   Utility::srandom();
data/pdns-4.3.1/pdns/common_startup.cc:561:11:  [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.
     ns = getenv("NOTIFY_SOCKET");
data/pdns-4.3.1/pdns/common_startup.cc:571:9:  [3] (misc) chroot:
  chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22).
  Make sure the program immediately chdir("/"), closes file descriptors, and
  drops root privileges, and that all necessary files (and no more!) are in
  the new root.
     if(chroot(::arg()["chroot"].c_str())<0 || chdir("/")<0) {
data/pdns-4.3.1/pdns/misc.cc:387:15:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  advance(it, random() % pollinFDs.size());
data/pdns-4.3.1/pdns/misc.cc:418:16:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    *fd = pfds[random()%2].fd;
data/pdns-4.3.1/pdns/nproxy.cc:308:8:  [3] (misc) chroot:
  chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22).
  Make sure the program immediately chdir("/"), closes file descriptors, and
  drops root privileges, and that all necessary files (and no more!) are in
  the new root.
    if(chroot(g_vm["chroot"].as<string>().c_str()) < 0 || chdir("/") < 0)
data/pdns-4.3.1/pdns/pdnsutil.cc:143:9:  [3] (misc) chroot:
  chroot can be very helpful, but is hard to use correctly (CWE-250, CWE-22).
  Make sure the program immediately chdir("/"), closes file descriptors, and
  drops root privileges, and that all necessary files (and no more!) are in
  the new root.
    if (chroot(::arg()["chroot"].c_str())<0 || chdir("/") < 0) {
data/pdns-4.3.1/pdns/pdnsutil.cc:201:54:  [3] (random) random:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
    B.lookup(QType(QType::A), DNSName(std::to_string(random()))+domain, -1);
data/pdns-4.3.1/pdns/pdnsutil.cc:872:8:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
  char tmpnam[]="/tmp/pdnsutil-XXXXXX";
data/pdns-4.3.1/pdns/pdnsutil.cc:873:21:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
  int tmpfd=mkstemp(tmpnam);
data/pdns-4.3.1/pdns/pdnsutil.cc:875:52:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
    unixDie("Making temporary filename in "+string(tmpnam));
data/pdns-4.3.1/pdns/pdnsutil.cc:880:8:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
  } dm(tmpnam);
data/pdns-4.3.1/pdns/pdnsutil.cc:885:13:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  if(auto e=getenv("EDITOR")) // <3
data/pdns-4.3.1/pdns/pdnsutil.cc:892:33:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
    if(tmpfd < 0 && (tmpfd=open(tmpnam, O_CREAT | O_WRONLY | O_TRUNC, 0600)) < 0)
data/pdns-4.3.1/pdns/pdnsutil.cc:893:56:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
      unixDie("Error reopening temporary file "+string(tmpnam));
data/pdns-4.3.1/pdns/pdnsutil.cc:918:14:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
  cmdline += tmpnam;
data/pdns-4.3.1/pdns/pdnsutil.cc:924:21:  [3] (tmpfile) tmpnam:
  Temporary file race condition (CWE-377).
  ZoneParserTNG zpt(tmpnam, g_rootdnsname);
data/pdns-4.3.1/pdns/sdig.cc:68:27:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  if (dnssec || ednsnm || getenv("SDIGBUFSIZE")) {
data/pdns-4.3.1/pdns/sdig.cc:69:18:  [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.
    char* sbuf = getenv("SDIGBUFSIZE");
data/pdns-4.3.1/pdns/test-bindparser_cc.cc:28:23:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
        srcdir = std::getenv("SRCDIR");
data/pdns-4.3.1/pdns/test-nameserver_cc.cc:46:7:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  if(!getenv("PDNS_TEST_NO_IPV6")) BOOST_CHECK_EQUAL(AddressIsUs(local3), true);
data/pdns-4.3.1/pdns/test-zoneparser_tng_cc.cc:24:24:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  const char* p = std::getenv("SRCDIR");
data/pdns-4.3.1/pdns/test-zoneparser_tng_cc.cc:60:24:  [3] (buffer) getenv:
  Environment variables are untrustable input if they can be set by an
  attacker. They can have any content and length, and the same variable can
  be set more than once (CWE-807, CWE-20). Check environment variables
  carefully before using them.
  const char* p = std::getenv("SRCDIR");
data/pdns-4.3.1/pdns/unix_utility.cc:182:15:  [3] (random) srandom:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
void Utility::srandom(void)
data/pdns-4.3.1/pdns/unix_utility.cc:186:5:  [3] (random) srandom:
  This function is not sufficiently random for security-related functions
  such as key and nonce creation (CWE-327). Use a more secure technique for
  acquiring random values.
  ::srandom(tv.tv_sec ^ tv.tv_usec ^ getpid());
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.c:7:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
arx_fwd(unsigned char state[4])
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.c:26:18:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
arx_bwd(unsigned char state[4])
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.c:54:26:  [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.
ipcrypt_encrypt(unsigned char out[IPCRYPT_BYTES],
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.c:55:32:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                const unsigned char in[IPCRYPT_BYTES],
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.c:56:32:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                const unsigned char key[IPCRYPT_KEYBYTES])
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.c:58: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 state[4];
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.c:72:26:  [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.
ipcrypt_decrypt(unsigned char out[IPCRYPT_BYTES],
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.c:73:32:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                const unsigned char in[IPCRYPT_BYTES],
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.c:74:32:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                const unsigned char key[IPCRYPT_KEYBYTES])
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.c:76: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 state[4];
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.h:12:30:  [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.
int ipcrypt_encrypt(unsigned char out[IPCRYPT_BYTES],
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.h:13:36:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                    const unsigned char in[IPCRYPT_BYTES],
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.h:14:36:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                    const unsigned char key[IPCRYPT_KEYBYTES]);
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.h:16:30:  [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.
int ipcrypt_decrypt(unsigned char out[IPCRYPT_BYTES],
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.h:17:36:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                    const unsigned char in[IPCRYPT_BYTES],
data/pdns-4.3.1/ext/ipcrypt/ipcrypt.h:18:36:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
                    const unsigned char key[IPCRYPT_KEYBYTES]);
data/pdns-4.3.1/ext/json11/json11.cpp:60:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buf[32];
data/pdns-4.3.1/ext/json11/json11.cpp:69: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/pdns-4.3.1/ext/json11/json11.cpp:97: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 buf[8];
data/pdns-4.3.1/ext/json11/json11.cpp:326: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[12];
data/pdns-4.3.1/ext/json11/json11.cpp:596:25:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
            return std::atoi(str.c_str() + start_pos);
data/pdns-4.3.1/ext/yahttp/yahttp/reqresp.cpp:130:36:  [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).
              target->url.port = ::atoi(value.substr(pos1).c_str());
data/pdns-4.3.1/ext/yahttp/yahttp/reqresp.cpp:167: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.
          char buf[100];
data/pdns-4.3.1/ext/yahttp/yahttp/reqresp.cpp:293:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char buf[1024];
data/pdns-4.3.1/ext/yahttp/yahttp/reqresp.cpp:316:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char buf[1024];
data/pdns-4.3.1/ext/yahttp/yahttp/reqresp.hpp:73:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buf[4096];
data/pdns-4.3.1/ext/yahttp/yahttp/utility.hpp:171:26:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
          utc_offset = ::atoi(ptr) * sign;
data/pdns-4.3.1/ext/yahttp/yahttp/utility.hpp:252:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char repl[3];
data/pdns-4.3.1/modules/bindbackend/bindbackend2.cc:212:14:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
    int fd = mkstemp(&d_transaction_tmpname.at(0));
data/pdns-4.3.1/modules/geoipbackend/geoipbackend.cc:751: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 buffer[1024];
data/pdns-4.3.1/modules/ldapbackend/master.cc:128:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char *vals[2];
data/pdns-4.3.1/modules/ldapbackend/powerldap.cc:447:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char tmp[4];
data/pdns-4.3.1/modules/lmdbbackend/lmdbbackend.cc:95: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).
    if(d_shards != atoi(getArg("shards").c_str())) {
data/pdns-4.3.1/modules/lmdbbackend/lmdbbackend.cc:96:77:  [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).
      g_log << Logger::Warning<<"Note: configured number of lmdb shards ("<<atoi(getArg("shards").c_str())<<") is different from on-disk ("<<d_shards<<"). Using on-disk shard number"<<endl;
data/pdns-4.3.1/modules/lmdbbackend/lmdbbackend.cc:100:16:  [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).
    d_shards = atoi(getArg("shards").c_str());
data/pdns-4.3.1/modules/lmdbbackend/lmdbbackend.cc:225:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&len, &str[0], 2);
data/pdns-4.3.1/modules/lmdbbackend/lmdbbackend.cc:227:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&rr.ttl, &str[2] + len, 4);
data/pdns-4.3.1/modules/lmdbbackend/lmdbbackend.cc:851:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(&st, &rr.content[rr.content.size()-sizeof(soatimes)], sizeof(soatimes));
data/pdns-4.3.1/modules/remotebackend/httpconnector.cc:385: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[4096];
data/pdns-4.3.1/modules/remotebackend/unixconnector.cc:74:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&t,&t0,sizeof(t0));
data/pdns-4.3.1/modules/remotebackend/unixconnector.cc:105:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[1500] = {0};
data/pdns-4.3.1/modules/tinydnsbackend/tinydnsbackend.cc:51:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char key[6];
data/pdns-4.3.1/modules/tinydnsbackend/tinydnsbackend.cc: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 recloc[2];
data/pdns-4.3.1/pdns/auth-carbon.cc:44:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char tmp[80];
data/pdns-4.3.1/pdns/base32.cc:133:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char block[5]={0,0,0,0,0};  // we process 5 8-bit chunks at a time
data/pdns-4.3.1/pdns/bindlexer.c:566: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 *include_stack_name[MAX_INCLUDE_DEPTH];
data/pdns-4.3.1/pdns/bindlexer.c:902:2:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
	char filename[1024];
data/pdns-4.3.1/pdns/bindlexer.c:933:13:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
	if (!(yyin=fopen(filename,"r"))) {
data/pdns-4.3.1/pdns/bindparser.cc:117:7:  [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).
	yyin=fopen(fname.c_str(),"r");
data/pdns-4.3.1/pdns/bindparser.cc:1005:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
data/pdns-4.3.1/pdns/bindparser.cc:1194:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char yymsgbuf[128];
data/pdns-4.3.1/pdns/calidns.cc:170:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&packet->at(packetSize - sizeof(addr)), &addr, sizeof(addr));
data/pdns-4.3.1/pdns/calidns.cc:437: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).
    plot.open(g_vm["plot-file"].as<string>());
data/pdns-4.3.1/pdns/cdb.cc:35: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).
  d_fd = open(cdbfile.c_str(), O_RDONLY);
data/pdns-4.3.1/pdns/comfun.cc:109:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char buf[512];
data/pdns-4.3.1/pdns/comfun.cc:240:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char buf[512];
data/pdns-4.3.1/pdns/comfun.cc:415:15:  [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).
      limit = atoi(argv[3]);
data/pdns-4.3.1/pdns/comfun.cc:441: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).
      nscount.count=atoi(parts[1].c_str());
data/pdns-4.3.1/pdns/decafsigners.cc:38:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char d_pubkey[DECAF_EDDSA_25519_PUBLIC_BYTES];
data/pdns-4.3.1/pdns/decafsigners.cc:39:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char d_seckey[DECAF_EDDSA_25519_PRIVATE_BYTES];
data/pdns-4.3.1/pdns/decafsigners.cc:114:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(d_pubkey, input.c_str(), DECAF_EDDSA_25519_PUBLIC_BYTES);
data/pdns-4.3.1/pdns/decafsigners.cc:174:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char d_pubkey[DECAF_EDDSA_448_PUBLIC_BYTES];
data/pdns-4.3.1/pdns/decafsigners.cc:175:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char d_seckey[DECAF_EDDSA_448_PRIVATE_BYTES];
data/pdns-4.3.1/pdns/decafsigners.cc:250:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(d_pubkey, input.c_str(), DECAF_EDDSA_448_PUBLIC_BYTES);
data/pdns-4.3.1/pdns/devpollmplexer.cc:78:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  d_devpollfd=open("/dev/poll", O_RDWR);
data/pdns-4.3.1/pdns/dns_random.cc:151: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[1];
data/pdns-4.3.1/pdns/dns_random.cc:164: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 buf[1];
data/pdns-4.3.1/pdns/dns_random.cc:173:18:  [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).
    urandom_fd = open(rdev.c_str(), O_RDONLY);
data/pdns-4.3.1/pdns/dns_random.cc:180:18:  [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).
    urandom_fd = open(rdev.c_str(), O_RDONLY);
data/pdns-4.3.1/pdns/dnsbulktest.cc:131:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char buf[512];
data/pdns-4.3.1/pdns/dnsdist-cache.cc:256: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(response, &queryId, sizeof(queryId));
data/pdns-4.3.1/pdns/dnsdist-cache.cc:257: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(response + sizeof(queryId), value.value.c_str() + sizeof(queryId), sizeof(dnsheader) - sizeof(queryId));
data/pdns-4.3.1/pdns/dnsdist-cache.cc:271: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(response + sizeof(dnsheader), dnsQName.c_str(), dnsQNameLen);
data/pdns-4.3.1/pdns/dnsdist-cache.cc:273:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(response + sizeof(dnsheader) + dnsQNameLen, value.value.c_str() + sizeof(dnsheader) + dnsQNameLen, value.len - (sizeof(dnsheader) + dnsQNameLen));
data/pdns-4.3.1/pdns/dnsdist-ecs.cc:446:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&dh.d_ttl, &edns0, sizeof edns0);
data/pdns-4.3.1/pdns/dnsdist-ecs.cc:463: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(oldEcsOptionStart, newECSOption.c_str(), oldEcsOptionSize);
data/pdns-4.3.1/pdns/dnsdist-ecs.cc:485: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(oldEcsOptionStart + dataBehindSize, newECSOption.c_str(), newECSOption.size());
data/pdns-4.3.1/pdns/dnsdist-ecs.cc:541:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(packet + *len, newECSOption.c_str(), newECSOptionSize);
data/pdns-4.3.1/pdns/dnsdist-ecs.cc:576:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(packet + realPacketLen, EDNSRR.c_str(), EDNSRR.size());
data/pdns-4.3.1/pdns/dnsdist-ecs.cc:605: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(packet, &newContent.at(0), newContent.size());
data/pdns-4.3.1/pdns/dnsdist-ecs.cc:850:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(optPtr, optRecord.data(), optRecord.size());
data/pdns-4.3.1/pdns/dnsdist-ecs.cc:937:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(reinterpret_cast<char*>(dq.dh) + queryPartSize, soa.c_str(), soa.size());
data/pdns-4.3.1/pdns/dnsdist-ecs.cc:1070:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&edns0, packet + optStart + 5, sizeof edns0);
data/pdns-4.3.1/pdns/dnsgram.cc:58:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char tmp[80];
data/pdns-4.3.1/pdns/dnsgram.cc:77:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char tmp[80];
data/pdns-4.3.1/pdns/dnspacket.cc:422:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy((void *)&d,(const void *)d_rawpacket.c_str(),12);
data/pdns-4.3.1/pdns/dnspacket.cc:555:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy((void *)&d,(const void *)d_rawpacket.c_str(),12);
data/pdns-4.3.1/pdns/dnsparser.cc:76: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 hex[4];
data/pdns-4.3.1/pdns/dnsparser.cc:115:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&packet[0], &dnsheader, sizeof(dnsheader)); pos+=sizeof(dnsheader);
data/pdns-4.3.1/pdns/dnsparser.cc:117:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char tmp[6]="\x0" "\x0\x1" "\x0\x1"; // root question for ns_t_a
data/pdns-4.3.1/pdns/dnsparser.cc:118:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&packet[pos], &tmp, 5); pos+=5;
data/pdns-4.3.1/pdns/dnsparser.cc:120:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&packet[pos], encoded.c_str(), encoded.size()); pos+=(uint16_t)encoded.size();
data/pdns-4.3.1/pdns/dnsparser.cc:128:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&packet[pos], &drh, sizeof(drh)); pos+=sizeof(drh);
data/pdns-4.3.1/pdns/dnsparser.cc:130: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(&packet[pos], serialized.c_str(), serialized.size());
data/pdns-4.3.1/pdns/dnsparser.cc:232:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&d_header, packet.data(), sizeof(dnsheader));
data/pdns-4.3.1/pdns/dnsparser.cc:377:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(dest, &d_content.at(d_pos), len);
data/pdns-4.3.1/pdns/dnsparser.cc:448:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char ebuf[5];
data/pdns-4.3.1/pdns/dnsparser.cc:579:22:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      const unsigned char rootptr[2]={0xc0,0x11};
data/pdns-4.3.1/pdns/dnsparser.cc:598: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((void*)&dh, (const dnsheader*)packet, sizeof(dh));
data/pdns-4.3.1/pdns/dnspcap.cc:33:8:  [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).
  d_fp=fopen(fname.c_str(),"r");
data/pdns-4.3.1/pdns/dnspcap.cc:221:8:  [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).
  d_fp=fopen(fname.c_str(),"w");
data/pdns-4.3.1/pdns/dnspcap2protobuf.cc:67:14:  [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* fp = fopen(argv[2], "w");
data/pdns-4.3.1/pdns/dnspcap2protobuf.cc:75:9:  [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).
    ind=atoi(argv[3]);
data/pdns-4.3.1/pdns/dnsproxy.cc: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 buffer[1500];
data/pdns-4.3.1/pdns/dnsproxy.cc:236:9:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
        memcpy(buffer,&d,sizeof(d));  // commit spoofed id
data/pdns-4.3.1/pdns/dnsrecords.cc:438:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char tmp[18]; 
data/pdns-4.3.1/pdns/dnsrecords.cc:482:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char tmp[24]; 
data/pdns-4.3.1/pdns/dnsrecords.cc:581:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&dr.d_ttl, &stuff, sizeof(stuff));
data/pdns-4.3.1/pdns/dnsreplay.cc:565:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&dh.d_ttl, &edns0, sizeof edns0);
data/pdns-4.3.1/pdns/dnsreplay.cc:596: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(packet + *len, EDNSRR.c_str(), EDNSRR.size());
data/pdns-4.3.1/pdns/dnsscope.cc:248:4:  [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(&header, (struct dnsheader*)pr.d_payload, 12);
data/pdns-4.3.1/pdns/dnssecinfra.cc:55:50:  [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).
  auto fp = std::unique_ptr<FILE, int(*)(FILE*)>(fopen(fname, "r"), fclose);
data/pdns-4.3.1/pdns/dnssecinfra.cc:496:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char hash[20];
data/pdns-4.3.1/pdns/dnssecinfra.cc:597:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char hash[EVP_MAX_MD_SIZE];
data/pdns-4.3.1/pdns/dnstcpbench.cc:260:8:  [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).
    fp=fopen(g_vm["file"].as<string>().c_str(), "r");
data/pdns-4.3.1/pdns/dnswasher.cc:100: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*)&ret)+12, &val, 4);
data/pdns-4.3.1/pdns/dnswriter.cc:60:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(dptr, ptr, sizeof(dnsheader));
data/pdns-4.3.1/pdns/dnswriter.cc:84: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.
    static unsigned char marker[2]={0xc0, 0x0c};
data/pdns-4.3.1/pdns/dnswriter.cc:120:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&ttl, &stuff, sizeof(stuff));
data/pdns-4.3.1/pdns/dnswriter.cc:134:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char bytes[6];
data/pdns-4.3.1/pdns/dnswriter.cc:137:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(bytes, (void*)&theLeft, sizeof(theLeft));
data/pdns-4.3.1/pdns/dnswriter.cc:138:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(bytes+2, (void*)&theRight, sizeof(theRight));
data/pdns-4.3.1/pdns/dumresp.cc:60:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[1500];
data/pdns-4.3.1/pdns/dumresp.cc:167:27:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
  int numberOfListeners = atoi(argv[3]);
data/pdns-4.3.1/pdns/dumresp.cc:168: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).
  ComboAddress local(argv[1], atoi(argv[2]));
data/pdns-4.3.1/pdns/dumresp.cc:201:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[1500];
data/pdns-4.3.1/pdns/dynmessenger.cc:133:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[1500];
data/pdns-4.3.1/pdns/ednssubnet.cc:63:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(&address.sin4.sin_addr.s_addr, options+sizeof(esow), octetsin);
data/pdns-4.3.1/pdns/ednssubnet.cc:73:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(&address.sin6.sin6_addr.s6_addr, options+sizeof(esow), octetsin);
data/pdns-4.3.1/pdns/inflighter.cc:205:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char buf[512];
data/pdns-4.3.1/pdns/inflighter.cc:231:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char buf[512];
data/pdns-4.3.1/pdns/ipcipher.cc:14:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char out[16];
data/pdns-4.3.1/pdns/iputils.cc:168:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(tv, CMSG_DATA(cmsg), sizeof(*tv));
data/pdns-4.3.1/pdns/ixfrdist.cc:565:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char sendBuf[2];
data/pdns-4.3.1/pdns/ixfrdist.cc:769:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[4096];
data/pdns-4.3.1/pdns/ixfrdist.cc:875: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[4096];
data/pdns-4.3.1/pdns/ixfrdist.cc:1055:5:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
    char tmp[512];
data/pdns-4.3.1/pdns/ixfrdist.cc:1267: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).
    if (!(newgid = atoi(gid.c_str()))) {
data/pdns-4.3.1/pdns/ixfrdist.cc:1313: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).
    if (!(newuid = atoi(uid.c_str()))) {
data/pdns-4.3.1/pdns/ixfrutils.cc:85: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).
    uint32_t num = atoi(entry->d_name);
data/pdns-4.3.1/pdns/ixfrutils.cc:127:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE* fp=fopen((fname+".partial").c_str(), "w");
data/pdns-4.3.1/pdns/ixplore.cc:112:34:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
    ComboAddress master(argv[2], atoi(argv[3]));
data/pdns-4.3.1/pdns/kvresp.cc:43: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).
  ComboAddress local(argv[1], atoi(argv[2]));
data/pdns-4.3.1/pdns/kvresp.cc:49:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[1500];
data/pdns-4.3.1/pdns/logger.cc:57: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[50] = "";
data/pdns-4.3.1/pdns/logger.cc:130: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).
void Logger::open()
data/pdns-4.3.1/pdns/logger.cc:141:3:  [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).
  open();
data/pdns-4.3.1/pdns/logger.cc:148:3:  [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).
  open();
data/pdns-4.3.1/pdns/lua-record.cc:94:24:  [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).
        timeout = std::atoi(cd.opts.at("timeout").c_str());
data/pdns-4.3.1/pdns/lua-record.cc:128:24:  [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).
        timeout = std::atoi(cd.opts.at("timeout").c_str());
data/pdns-4.3.1/pdns/lua-record.cc:511:22:  [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).
    ret.emplace_back(atoi(i.second.at(1).c_str()), ComboAddress(i.second.at(2)));
data/pdns-4.3.1/pdns/lua-record.cc:595:18:  [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).
          fmt2 % atoi(labels[i].c_str());
data/pdns-4.3.1/pdns/lua-record.cc:809:27:  [2] (integer) atoi:
  Unless checked, the resulting number can exceed the expected range
  (CWE-190). If source untrusted, check both minimum and maximum, even if the
  input had no minus sign (large numbers can roll over into negative number;
  consider saving to an unsigned value if that is intended).
        conv.emplace_back(atoi(i.second[1].c_str()), ComboAddress(i.second[2]));
data/pdns-4.3.1/pdns/mastercommunicator.cc:174:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[1500];
data/pdns-4.3.1/pdns/misc.cc:202:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[30];
data/pdns-4.3.1/pdns/misc.cc:494:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char tmp[MAXHOSTNAMELEN];
data/pdns-4.3.1/pdns/misc.cc:565:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char tmp[17];
data/pdns-4.3.1/pdns/misc.cc:577:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char tmp[5];
data/pdns-4.3.1/pdns/misc.cc:786: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(ret, res->ai_addr, res->ai_addrlen);
data/pdns-4.3.1/pdns/misc.cc:851:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[1024];
data/pdns-4.3.1/pdns/misc.cc:866:50:  [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).
  auto fp = std::unique_ptr<FILE, int(*)(FILE*)>(fopen(fname, "r"), fclose);
data/pdns-4.3.1/pdns/notify.cc:125: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[1500];
data/pdns-4.3.1/pdns/nproxy.cc:79:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[1500];
data/pdns-4.3.1/pdns/nproxy.cc:151:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buffer[1500];
data/pdns-4.3.1/pdns/nproxy.cc:303:15:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  int null_fd=open("/dev/null",O_RDWR); /* open stdin */
data/pdns-4.3.1/pdns/nsec3dig.cc:131:48:  [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).
  ComboAddress dest(argv[1] + (*argv[1]=='@'), atoi(argv[2]));
data/pdns-4.3.1/pdns/opensslsigners.cc:313: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 l_hash[SHA_DIGEST_LENGTH];
data/pdns-4.3.1/pdns/opensslsigners.cc:318: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 l_hash[SHA256_DIGEST_LENGTH];
data/pdns-4.3.1/pdns/opensslsigners.cc:323: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 l_hash[SHA512_DIGEST_LENGTH];
data/pdns-4.3.1/pdns/opensslsigners.cc:382:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char l_hash[SHA_DIGEST_LENGTH];
data/pdns-4.3.1/pdns/opensslsigners.cc:712: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 l_hash[SHA256_DIGEST_LENGTH];
data/pdns-4.3.1/pdns/opensslsigners.cc:717: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 l_hash[SHA384_DIGEST_LENGTH];
data/pdns-4.3.1/pdns/opensslsigners.cc:788:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char l_hash[SHA_DIGEST_LENGTH];
data/pdns-4.3.1/pdns/opensslsigners.cc:814: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).
  drc.d_algorithm = atoi(stormap["algorithm"].c_str());
data/pdns-4.3.1/pdns/opensslsigners.cc:1064: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).
  drc.d_algorithm = atoi(stormap["algorithm"].c_str());
data/pdns-4.3.1/pdns/pdnsutil.cc:873:13:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
  int tmpfd=mkstemp(tmpnam);
data/pdns-4.3.1/pdns/pdnsutil.cc:892:28:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
    if(tmpfd < 0 && (tmpfd=open(tmpnam, O_CREAT | O_WRONLY | O_TRUNC, 0600)) < 0)
data/pdns-4.3.1/pdns/pdnsutil.cc:1250: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).
    rr.ttl=atoi(cmds[4].c_str());
data/pdns-4.3.1/pdns/pdnsutil.cc:1398:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char tmp[25];
data/pdns-4.3.1/pdns/pdnsutil.cc:1544:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char buf[80];
data/pdns-4.3.1/pdns/pdnsutil.cc:2285: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).
    unsigned int id=atoi(cmds[2].c_str()); // if you make this pdns_stou, the error gets worse
data/pdns-4.3.1/pdns/pdnsutil.cc:2321: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).
    unsigned int id=atoi(cmds[2].c_str()); // if you make this pdns_stou, the error gets worse
data/pdns-4.3.1/pdns/pdnsutil.cc:2339: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).
    unsigned int id=atoi(cmds[2].c_str()); // if you make this pdns_stou, the error gets worse
data/pdns-4.3.1/pdns/pkcs11signers.cc:245:7:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
      memcpy(uPin.get(), pin.c_str(), pin.size());
data/pdns-4.3.1/pdns/qtype.cc:91: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(p+1);
data/pdns-4.3.1/pdns/qtype.cc:95: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(p+4);
data/pdns-4.3.1/pdns/rcpgenerator.cc:482:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char tmp[17];
data/pdns-4.3.1/pdns/rcpgenerator.cc:486:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(&vals[0], &ip, sizeof(ip));
data/pdns-4.3.1/pdns/rcpgenerator.cc:511:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char tmpbuf[16];
data/pdns-4.3.1/pdns/rcpgenerator.cc:512:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char addrbuf[40];
data/pdns-4.3.1/pdns/rcpgenerator.cc:603:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char tmp[5];
data/pdns-4.3.1/pdns/receiver.cc:111:9:  [2] (misc) open:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  int i=open("/dev/null",O_RDWR); /* open stdin */
data/pdns-4.3.1/pdns/receiver.cc:187:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char mesg[512];
data/pdns-4.3.1/pdns/receiver.cc:605:7:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
      char tmp[128];
data/pdns-4.3.1/pdns/resolver.cc:253:3:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  char buf[3000];
data/pdns-4.3.1/pdns/resolver.cc:316: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[3000];
data/pdns-4.3.1/pdns/rfc2136handler.cc:664: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 lenBuf[2];
data/pdns-4.3.1/pdns/saxfr.cc:89:48:  [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).
  ComboAddress dest(argv[1] + (*argv[1]=='@'), atoi(argv[2]));
data/pdns-4.3.1/pdns/sdig.cc:72:17:  [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).
      bufsize = atoi(sbuf);
data/pdns-4.3.1/pdns/sdig.cc:253:19:  [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).
        xpfcode = atoi(argv[++i]);
data/pdns-4.3.1/pdns/sdig.cc:254:22:  [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).
        xpfversion = atoi(argv[++i]);
data/pdns-4.3.1/pdns/sdig.cc:255: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).
        xpfproto = atoi(argv[++i]);
data/pdns-4.3.1/pdns/sdig.cc:264:18:  [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).
        qclass = atoi(argv[++i]);
data/pdns-4.3.1/pdns/sdig.cc:276:54:  [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).
    dest = ComboAddress(argv[1] + (*argv[1] == '@'), atoi(argv[2]));
data/pdns-4.3.1/pdns/sodiumsigners.cc:33:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char d_pubkey[crypto_sign_ed25519_PUBLICKEYBYTES];
data/pdns-4.3.1/pdns/sodiumsigners.cc:34:12:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
  unsigned char d_seckey[crypto_sign_ed25519_SECRETKEYBYTES];
data/pdns-4.3.1/pdns/sodiumsigners.cc:84:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(seed.get(), privateKey.c_str(), crypto_sign_ed25519_SEEDBYTES);
data/pdns-4.3.1/pdns/sodiumsigners.cc:103:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(d_pubkey, input.c_str(), crypto_sign_ed25519_PUBLICKEYBYTES);
data/pdns-4.3.1/pdns/sodiumsigners.cc:124:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(sm.get(), signature.c_str(), crypto_sign_ed25519_BYTES);
data/pdns-4.3.1/pdns/sodiumsigners.cc:125:3:  [2] (buffer) memcpy:
  Does not check for buffer overflows when copying to destination (CWE-120).
  Make sure destination can always hold the source data.
  memcpy(sm.get() + crypto_sign_ed25519_BYTES, msg.c_str(), msg.length());
data/pdns-4.3.1/pdns/speedtest.cc:670: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(&d_record[len], out.c_str(), out.length());
data/pdns-4.3.1/pdns/test-arguments_cc.cc:16:10:  [2] (tmpfile) mkstemp:
  Potential for temporary file vulnerability in some circumstances. Some
  older Unix-like systems create temp files with permission to write by all
  by default, so be sure to set the umask to override this. Also, some older
  Unix systems might fail to use O_EXCL when opening the file, so make sure
  that O_EXCL is used by the library (CWE-377).
  int fd=mkstemp(path);
data/pdns-4.3.1/pdns/test-iputils_hh.cc:93: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, (char*)&ca4.sin4.sin_addr.s_addr, 4);
data/pdns-4.3.1/pdns/test-iputils_hh.cc:96: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, (char*)&orig.sin4.sin_addr.s_addr, 4);
data/pdns-4.3.1/pdns/test-mplexer.cc:146: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[1];
data/pdns-4.3.1/pdns/toysdig.cc:124:48:  [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).
  ComboAddress dest(argv[1] + (*argv[1]=='@'), atoi(argv[2]));
data/pdns-4.3.1/pdns/tsig-tests.cc:61:48:  [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).
  ComboAddress dest(argv[1] + (*argv[1]=='@'), atoi(argv[2]));
data/pdns-4.3.1/pdns/tsigutils.cc:54: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(&tmpkey.at(i), &t, sizeof(uint32_t));
data/pdns-4.3.1/pdns/webserver.cc:380:9:  [2] (buffer) char:
  Statically-sized arrays can be improperly restricted, leading to potential
  overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use
  functions that limit length, or ensure that the size is larger than the
  maximum possible length.
        char buf[16000];
data/pdns-4.3.1/pdns/ws-auth.cc:1904: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/pdns-4.3.1/pdns/zoneparser-tng.cc:58:12:  [2] (misc) fopen:
  Check when opening files - can an attacker redirect it (via symlinks),
  force the opening of special file type (e.g., device files), move things
  around to create a race condition, control its ancestors, or change its
  contents? (CWE-362).
  FILE *fp=fopen(fname.c_str(), "r");
data/pdns-4.3.1/pdns/zoneparser-tng.cc:196: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 tmp[80];
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:1086:68:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        auto val = Reader<typename std::decay<TReturnType>::type>::read(state, -object.getNum());
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:1344:32:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            static const char* read(lua_State* /*l*/, void* data, size_t* size) {
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:1350:27:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                me.stream.read(me.buffer.data(), me.buffer.size());
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:1358:63:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        const auto loadReturnValue = lua_load(state, &Reader::read, &reader, "chunk"
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:1695:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:1745:80:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        const auto& firstElem = Reader<typename std::decay<TFirstType>::type>::read(state, index);
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:1759:80:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        const auto& firstElem = Reader<typename std::decay<TFirstType>::type>::read(state, index);
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2553:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2565:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2581:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2609:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2634:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2649:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2667:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2683:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2696:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2699:85:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
		if (auto val = Reader<LuaContext::LuaFunctionCaller<TRetValue (TParameters...)>>::read(state, index))
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2713:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2726:45:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                auto val1 = Reader<TType1>::read(state, -2);
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2727:45:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                auto val2 = Reader<TType2>::read(state, -1);
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2751:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2764:42:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                auto key = Reader<TKey>::read(state, -2);
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2765:46:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                auto value = Reader<TValue>::read(state, -1);
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2789:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2802:42:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                auto key = Reader<TKey>::read(state, -2);
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2803:46:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
                auto value = Reader<TValue>::read(state, -1);
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2831:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2836:43:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        if (auto&& other = Reader<TType>::read(state, index))
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2856:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2860:45:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            if (const auto val = SubReader::read(state, index))
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2862:90:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
            return VariantReader<typename boost::mpl::next<TIterBegin>::type, TIterEnd>::read(state, index);
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2870:21:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        static auto read(lua_State* /*state*/, int /*index*/)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2882:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2885:35:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        return MainVariantReader::read(state, index);
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2895:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* /*state*/, int /*index*/, int /*maxSize*/ = 0)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2912:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index, int maxSize = std::tuple_size<ReturnType>::value)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2918:41:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        auto firstVal = Reader<TFirst>::read(state, index);
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2919:58:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        auto othersVal = Reader<std::tuple<TOthers...>>::read(state, index + 1, maxSize - 1);
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2938:17:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    static auto read(lua_State* state, int index, int maxSize = std::tuple_size<ReturnType>::value)
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2941:58:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        auto othersVal = Reader<std::tuple<TOthers...>>::read(state, index + 1, maxSize - 1);
data/pdns-4.3.1/ext/luawrapper/include/LuaContext.hpp:2948:41:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        auto firstVal = Reader<TFirst>::read(state, index);
data/pdns-4.3.1/ext/yahttp/yahttp/reqresp.cpp:294:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      is.read(buf, 1024);
data/pdns-4.3.1/ext/yahttp/yahttp/reqresp.cpp:317:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      is.read(buf, 1024);
data/pdns-4.3.1/ext/yahttp/yahttp/reqresp.hpp:83:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
          ifs.read(buf, sizeof buf);
data/pdns-4.3.1/modules/geoipbackend/geoipbackend.cc:753:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
              ifs.read(buffer, sizeof buffer);
data/pdns-4.3.1/modules/gpgsqlbackend/spgsql.cc:119:55:  [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).
      char *portal =  PQescapeIdentifier(d_db(), val, strlen(val));
data/pdns-4.3.1/modules/ldapbackend/ldapauthenticator.cc:44: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).
  passwd.bv_len = strlen( passwd.bv_val );
data/pdns-4.3.1/modules/ldapbackend/ldapbackend.cc:134:16:  [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.
      Utility::usleep( 250 );
data/pdns-4.3.1/modules/ldapbackend/powerldap.cc:254: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).
  passwd.bv_len = strlen( passwd.bv_val );
data/pdns-4.3.1/modules/pipebackend/coprocess.cc:176:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t got = read(d_fd2[0], &received.at(existingSize), 4096);
data/pdns-4.3.1/modules/remotebackend/unixconnector.cc:86:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    rv = this->read(s_output);
data/pdns-4.3.1/modules/remotebackend/unixconnector.cc:103:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
ssize_t UnixsocketConnector::read(std::string &data) {
data/pdns-4.3.1/modules/remotebackend/unixconnector.cc:109:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  nread = ::read(this->fd, buf, sizeof buf);
data/pdns-4.3.1/pdns/auth-carbon.cc:68:82:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      str<<namespace_name<<'.'<<hostname<<'.'<<instance_name<<'.'<<entry<<' '<<S.read(entry)<<' '<<now<<"\r\n";
data/pdns-4.3.1/pdns/bindlexer.c:694:14:  [1] (buffer) getc:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
data/pdns-4.3.1/pdns/bindlexer.c:909: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(yytext) <= 2) {
data/pdns-4.3.1/pdns/bindlexer.c:914: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).
        yytext[strlen(yytext)-2]=0;
data/pdns-4.3.1/pdns/bindlexer.c:1800: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).
	return yy_scan_bytes( yystr, (int) strlen(yystr) );
data/pdns-4.3.1/pdns/bindparser.cc:902: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).
#   define yystrlen strlen
data/pdns-4.3.1/pdns/calidns.cc:490: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(50000);
data/pdns-4.3.1/pdns/dns_random.cc:183:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if (read(urandom_fd, &seed, sizeof(seed)) < 0) {
data/pdns-4.3.1/pdns/dns_random.cc:291:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        ssize_t got = read(urandom_fd, &num, sizeof(num));
data/pdns-4.3.1/pdns/dnsbackend.cc:110:8:  [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(entry->d_name)>13 &&
data/pdns-4.3.1/pdns/dnsbackend.cc:111:30:  [1] (buffer) strlen:
  Does not handle strings that are not \0-terminated; if given one it may
  perform an over-read (it could cause a crash if unprotected) (CWE-126).
       !strcmp(entry->d_name+strlen(entry->d_name)-10,"backend.so"))
data/pdns-4.3.1/pdns/dnstcpbench.cc:131:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if(sock.read((char *) &len, 2) != 2)
data/pdns-4.3.1/pdns/dnstcpbench.cc:139:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    numread=sock.read(creply.get()+n, len-n);
data/pdns-4.3.1/pdns/dumresp.cc:65:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t got = read(sock, &len, sizeof(len));
data/pdns-4.3.1/pdns/dumresp.cc:82:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    got = read(sock, buffer, len);
data/pdns-4.3.1/pdns/dynlistener.cc:269:10:  [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(&mesg[0]) == mesg.size()) {
data/pdns-4.3.1/pdns/dynlistener.cc:281:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if((len=read(0, &mesg[0], mesg.size())) < 0) 
data/pdns-4.3.1/pdns/ixfr.cc:185:10:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if(s.read((char*)&len, sizeof(len)) != sizeof(len))
data/pdns-4.3.1/pdns/misc.cc:98:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    res = read(fd, (char*)buffer + pos, len - pos);
data/pdns-4.3.1/pdns/misc.cc:125:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t got = read(fd, (char *)buffer + pos, len - pos);
data/pdns-4.3.1/pdns/nsec3dig.cc:141:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  if(sock.read((char *) &len, 2) != 2)
data/pdns-4.3.1/pdns/nsec3dig.cc:149:18:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    numread=sock.read(creply.get()+n, len-n);
data/pdns-4.3.1/pdns/pdnsutil.cc:209:37:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  cout<<"Packet cache reports: "<<S.read("query-cache-hit")<<" hits (should be 0) and "<<S.read("query-cache-miss") <<" misses"<<endl;
data/pdns-4.3.1/pdns/pdnsutil.cc:209:92:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  cout<<"Packet cache reports: "<<S.read("query-cache-hit")<<" hits (should be 0) and "<<S.read("query-cache-miss") <<" misses"<<endl;
data/pdns-4.3.1/pdns/pdnsutil.cc:838:7:  [1] (buffer) getchar:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    c=getchar();
data/pdns-4.3.1/pdns/pdnsutil.cc:1548: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 string.
        strncpy(buf, "Never", sizeof(buf)-1);
data/pdns-4.3.1/pdns/saxfr.cc:127:15:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if(sock.read((char *) &len, 2) != 2)
data/pdns-4.3.1/pdns/saxfr.cc:135:22:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        numread=sock.read(creply.get()+n, len-n);
data/pdns-4.3.1/pdns/saxfr.cc:192:13:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    if(sock.read((char *) &len, 2) != 2)
data/pdns-4.3.1/pdns/saxfr.cc:200:20:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      numread=sock.read(creply.get()+n, len-n);
data/pdns-4.3.1/pdns/sdig.cc:336:16:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      if (sock.read((char *)&len, 2) != 2)
data/pdns-4.3.1/pdns/sdig.cc:344:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
        numread = sock.read(creply + n, len - n);
data/pdns-4.3.1/pdns/signingpipe.cc:20:11:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    res = read(fd, (char*)buffer + pos, len - pos);
data/pdns-4.3.1/pdns/sillyrecords.cc:211: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).
  maxcp = cp + strlen(content.c_str());
data/pdns-4.3.1/pdns/ssqlite3.cc:174: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).
    if (pTail && strlen(pTail)>0)
data/pdns-4.3.1/pdns/ssqlite3.cc:253:12:  [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.
  Utility::usleep(1000);
data/pdns-4.3.1/pdns/statbag.cc:121:24:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
unsigned long StatBag::read(const string &key)
data/pdns-4.3.1/pdns/statbag.cc:142:6:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  o<<read(key);
data/pdns-4.3.1/pdns/stubresolver.cc:144:12:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      sock.read(reply); // this calls recv
data/pdns-4.3.1/pdns/tcpreceiver.cc:112:9:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ret=read(fd, ptr, bytes);
data/pdns-4.3.1/pdns/test-mplexer.cc:147:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ssize_t got = read(pipes[0], &buffer[0], sizeof(buffer));
data/pdns-4.3.1/pdns/test-packetcache_cc.cc:117:37:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK_EQUAL(QC.size() + S.read("deferred-cache-inserts"), 400000U);
data/pdns-4.3.1/pdns/test-packetcache_cc.cc:118:29:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK_SMALL(1.0*S.read("deferred-cache-inserts"), 10000.0);
data/pdns-4.3.1/pdns/test-packetcache_cc.cc:125:19:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK(S.read("deferred-cache-inserts") + S.read("deferred-cache-lookup") >= g_QCmissing);
data/pdns-4.3.1/pdns/test-packetcache_cc.cc:125:54:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK(S.read("deferred-cache-inserts") + S.read("deferred-cache-lookup") >= g_QCmissing);
data/pdns-4.3.1/pdns/test-packetcache_cc.cc:217:37:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK_EQUAL(PC.size() + S.read("deferred-packetcache-inserts"), 400000UL);
data/pdns-4.3.1/pdns/test-packetcache_cc.cc:218:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK_EQUAL(S.read("deferred-packetcache-lookup"), 0UL);
data/pdns-4.3.1/pdns/test-packetcache_cc.cc:219:29:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK_SMALL(1.0*S.read("deferred-packetcache-inserts"), 10000.0);
data/pdns-4.3.1/pdns/test-packetcache_cc.cc:235:39:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK_EQUAL(g_PCmissing + S.read("packetcache-hit"), 400000UL);
data/pdns-4.3.1/pdns/test-packetcache_cc.cc:236:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK_EQUAL(S.read("deferred-packetcache-inserts") + S.read("deferred-packetcache-lookup"), g_PCmissing);
data/pdns-4.3.1/pdns/test-packetcache_cc.cc:236:66:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK_EQUAL(S.read("deferred-packetcache-inserts") + S.read("deferred-packetcache-lookup"), g_PCmissing);
data/pdns-4.3.1/pdns/test-statbag_cc.cc:44:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  BOOST_CHECK_EQUAL(s.read("a"), 1UL);
data/pdns-4.3.1/pdns/test-statbag_cc.cc:50:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  BOOST_CHECK_EQUAL(s.read("b"), n);
data/pdns-4.3.1/pdns/test-statbag_cc.cc:56:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  BOOST_CHECK_EQUAL(s.read("a"), n+1);
data/pdns-4.3.1/pdns/test-statbag_cc.cc:66:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  BOOST_CHECK_EQUAL(s.read("c"), 4000000U);
data/pdns-4.3.1/pdns/test-statbag_cc.cc:76:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  BOOST_CHECK_EQUAL(s.read("c"), 4000000U);
data/pdns-4.3.1/pdns/test-statbag_cc.cc:80:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  BOOST_CHECK_EQUAL(s.read("c"), (1ULL<<31) );
data/pdns-4.3.1/pdns/test-statbag_cc.cc:82:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  BOOST_CHECK_EQUAL(s.read("c"), (1ULL<<31) +1 );
data/pdns-4.3.1/pdns/test-statbag_cc.cc:88:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK_EQUAL(s.read("c"), (1ULL<<33) );
data/pdns-4.3.1/pdns/test-statbag_cc.cc:90:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK_EQUAL(s.read("c"), (1ULL<<33) +1 );
data/pdns-4.3.1/pdns/test-statbag_cc.cc:93:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK_EQUAL(s.read("c"), 0xffffffffffffffffULL );
data/pdns-4.3.1/pdns/test-statbag_cc.cc:95:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK_EQUAL(s.read("c"), 0UL );
data/pdns-4.3.1/pdns/test-statbag_cc.cc:100:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK_EQUAL(s.read("c"), 0xffffffffUL );
data/pdns-4.3.1/pdns/test-statbag_cc.cc:102:25:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    BOOST_CHECK_EQUAL(s.read("c"), 0UL );
data/pdns-4.3.1/pdns/toysdig.cc:52:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    int bread=d_rsock.read((char *) &len, 2);
data/pdns-4.3.1/pdns/toysdig.cc:63:23:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      numread=d_rsock.read(creply.get()+n, len-n);
data/pdns-4.3.1/pdns/unix_utility.cc:116:15:  [1] (obsolete) usleep:
  This C routine is considered obsolete (as opposed to the shell command by
  the same name). The interaction of this function with SIGALRM and other
  timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is
  unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead.
void Utility::usleep(unsigned long usec)
data/pdns-4.3.1/pdns/ws-auth.cc:99:26:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      d_queries.submit(S.read("udp-queries"));
data/pdns-4.3.1/pdns/ws-auth.cc:100:28:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      d_cachehits.submit(S.read("packetcache-hit"));
data/pdns-4.3.1/pdns/ws-auth.cc:101:30:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      d_cachemisses.submit(S.read("packetcache-miss"));
data/pdns-4.3.1/pdns/ws-auth.cc:102:29:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      d_qcachehits.submit(S.read("query-cache-hit"));
data/pdns-4.3.1/pdns/ws-auth.cc:103:31:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
      d_qcachemisses.submit(S.read("query-cache-miss"));
data/pdns-4.3.1/pdns/ws-auth.cc:197:41:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    ret<<"<tr><td>"<<*i<<"</td><td>"<<S.read(*i)<<"</td><td>"<<S.getDescrip(*i)<<"</td>"<<endl;
data/pdns-4.3.1/pdns/ws-auth.cc:286:29:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ret<<"Total queries: "<<S.read("udp-queries")<<". Question/answer latency: "<<S.read("latency")/1000.0<<"ms</p><br>"<<endl;
data/pdns-4.3.1/pdns/ws-auth.cc:286:83:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
  ret<<"Total queries: "<<S.read("udp-queries")<<". Question/answer latency: "<<S.read("latency")/1000.0<<"ms</p><br>"<<endl;
data/pdns-4.3.1/pdns/ws-auth.cc:509:34:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    out[item] = std::to_string(S.read(item));
data/pdns-4.3.1/pdns/ws-auth.cc:520:14:  [1] (buffer) read:
  Check buffer boundaries if used in a loop including recursive loops
  (CWE-120, CWE-20).
    return S.read(name);

ANALYSIS SUMMARY:

Hits = 390
Lines analyzed = 84565 in approximately 2.37 seconds (35692 lines/second)
Physical Source Lines of Code (SLOC) = 65046
Hits@level = [0] 112 [1] 130 [2] 222 [3]  25 [4]  11 [5]   2
Hits@level+ = [0+] 502 [1+] 390 [2+] 260 [3+]  38 [4+]  13 [5+]   2
Hits/KSLOC@level+ = [0+] 7.71762 [1+] 5.99576 [2+] 3.99717 [3+] 0.584202 [4+] 0.199859 [5+] 0.0307475
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.