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-recursor-4.4.1/axfr-retriever.cc Examining data/pdns-recursor-4.4.1/ext/luawrapper/include/LuaContext.hpp Examining data/pdns-recursor-4.4.1/ext/probds/murmur3.h Examining data/pdns-recursor-4.4.1/ext/probds/murmur3.cc Examining data/pdns-recursor-4.4.1/ext/incbin/incbin.h Examining data/pdns-recursor-4.4.1/ext/json11/json11.cpp Examining data/pdns-recursor-4.4.1/ext/json11/json11.hpp Examining data/pdns-recursor-4.4.1/ext/yahttp/yahttp/router.cpp Examining data/pdns-recursor-4.4.1/ext/yahttp/yahttp/reqresp.hpp Examining data/pdns-recursor-4.4.1/ext/yahttp/yahttp/url.hpp Examining data/pdns-recursor-4.4.1/ext/yahttp/yahttp/yahttp-config.h Examining data/pdns-recursor-4.4.1/ext/yahttp/yahttp/cookie.hpp Examining data/pdns-recursor-4.4.1/ext/yahttp/yahttp/yahttp.hpp Examining data/pdns-recursor-4.4.1/ext/yahttp/yahttp/utility.hpp Examining data/pdns-recursor-4.4.1/ext/yahttp/yahttp/exception.hpp Examining data/pdns-recursor-4.4.1/ext/yahttp/yahttp/router.hpp Examining data/pdns-recursor-4.4.1/ext/yahttp/yahttp/reqresp.cpp Examining data/pdns-recursor-4.4.1/iputils.cc Examining data/pdns-recursor-4.4.1/test-signers.cc Examining data/pdns-recursor-4.4.1/test-syncres_cc3.cc Examining data/pdns-recursor-4.4.1/test-syncres_cc2.cc Examining data/pdns-recursor-4.4.1/ws-recursor.cc Examining data/pdns-recursor-4.4.1/pdns_recursor.cc Examining data/pdns-recursor-4.4.1/logger.cc Examining data/pdns-recursor-4.4.1/query-local-address.cc Examining data/pdns-recursor-4.4.1/base32.cc Examining data/pdns-recursor-4.4.1/shuffle.cc Examining data/pdns-recursor-4.4.1/responsestats.cc Examining data/pdns-recursor-4.4.1/test-syncres_cc4.cc Examining data/pdns-recursor-4.4.1/pollmplexer.cc Examining data/pdns-recursor-4.4.1/rec-protobuf.cc Examining data/pdns-recursor-4.4.1/malloctrace.cc Examining data/pdns-recursor-4.4.1/sodiumsigners.cc Examining data/pdns-recursor-4.4.1/capabilities.cc Examining data/pdns-recursor-4.4.1/mtasker.cc Examining data/pdns-recursor-4.4.1/rec_channel.cc Examining data/pdns-recursor-4.4.1/test-dnsrecordcontent.cc Examining data/pdns-recursor-4.4.1/rec-carbon.cc Examining data/pdns-recursor-4.4.1/threadname.cc Examining data/pdns-recursor-4.4.1/proxy-protocol.cc Examining data/pdns-recursor-4.4.1/rec_channel_rec.cc Examining data/pdns-recursor-4.4.1/test-syncres_cc9.cc Examining data/pdns-recursor-4.4.1/rec-lua-conf.cc Examining data/pdns-recursor-4.4.1/sortlist.cc Examining data/pdns-recursor-4.4.1/opensslsigners.cc Examining data/pdns-recursor-4.4.1/pubsuffixloader.cc Examining data/pdns-recursor-4.4.1/arguments.cc Examining data/pdns-recursor-4.4.1/zoneparser-tng.cc Examining data/pdns-recursor-4.4.1/dnssecinfra.cc Examining data/pdns-recursor-4.4.1/dns.cc Examining data/pdns-recursor-4.4.1/tsigverifier.cc Examining data/pdns-recursor-4.4.1/dnslabeltext.cc Examining data/pdns-recursor-4.4.1/rcpgenerator.cc Examining data/pdns-recursor-4.4.1/test-tsig.cc Examining data/pdns-recursor-4.4.1/dnsparser.cc Examining data/pdns-recursor-4.4.1/decafsigners.cc Examining data/pdns-recursor-4.4.1/rpzloader.cc Examining data/pdns-recursor-4.4.1/fstrm_logger.cc Examining data/pdns-recursor-4.4.1/recursor_cache.cc Examining data/pdns-recursor-4.4.1/test-base64_cc.cc Examining data/pdns-recursor-4.4.1/nod.cc Examining data/pdns-recursor-4.4.1/test-packetcache_hh.cc Examining data/pdns-recursor-4.4.1/test-mplexer.cc Examining data/pdns-recursor-4.4.1/gss_context.cc Examining data/pdns-recursor-4.4.1/ednssubnet.cc Examining data/pdns-recursor-4.4.1/secpoll.cc Examining data/pdns-recursor-4.4.1/ws-api.cc Examining data/pdns-recursor-4.4.1/resolver.cc Examining data/pdns-recursor-4.4.1/uuid-utils.cc Examining data/pdns-recursor-4.4.1/test-mtasker.cc Examining data/pdns-recursor-4.4.1/test-base32_cc.cc Examining data/pdns-recursor-4.4.1/testrunner.cc Examining data/pdns-recursor-4.4.1/test-negcache_cc.cc Examining data/pdns-recursor-4.4.1/lwres.cc Examining data/pdns-recursor-4.4.1/kqueuemplexer.cc Examining data/pdns-recursor-4.4.1/test-syncres_cc1.cc Examining data/pdns-recursor-4.4.1/syncres.cc Examining data/pdns-recursor-4.4.1/test-rcpgenerator_cc.cc Examining data/pdns-recursor-4.4.1/test-nod_cc.cc Examining data/pdns-recursor-4.4.1/misc.cc Examining data/pdns-recursor-4.4.1/test-filterpo_cc.cc Examining data/pdns-recursor-4.4.1/dnstap.cc Examining data/pdns-recursor-4.4.1/remote_logger.cc Examining data/pdns-recursor-4.4.1/mtasker_ucontext.cc Examining data/pdns-recursor-4.4.1/sillyrecords.cc Examining data/pdns-recursor-4.4.1/test-xpf_cc.cc Examining data/pdns-recursor-4.4.1/ednscookies.cc Examining data/pdns-recursor-4.4.1/epollmplexer.cc Examining data/pdns-recursor-4.4.1/test-syncres_cc10.cc Examining data/pdns-recursor-4.4.1/ednsoptions.cc Examining data/pdns-recursor-4.4.1/recpacketcache.cc Examining data/pdns-recursor-4.4.1/validate-recursor.cc Examining data/pdns-recursor-4.4.1/unix_utility.cc Examining data/pdns-recursor-4.4.1/negcache.cc Examining data/pdns-recursor-4.4.1/test-recpacketcache_cc.cc Examining data/pdns-recursor-4.4.1/devpollmplexer.cc Examining data/pdns-recursor-4.4.1/test-arguments_cc.cc Examining data/pdns-recursor-4.4.1/rec-snmp.cc Examining data/pdns-recursor-4.4.1/test-ednsoptions_cc.cc Examining data/pdns-recursor-4.4.1/reczones.cc Examining data/pdns-recursor-4.4.1/test-secpoll_cc.cc Examining data/pdns-recursor-4.4.1/base64.cc Examining data/pdns-recursor-4.4.1/mtasker_fcontext.cc Examining data/pdns-recursor-4.4.1/pubsuffix.cc Examining data/pdns-recursor-4.4.1/test-dnsname_cc.cc Examining data/pdns-recursor-4.4.1/test-rpzloader_cc.cc Examining data/pdns-recursor-4.4.1/test-misc_hh.cc Examining data/pdns-recursor-4.4.1/test-syncres_cc.cc Examining data/pdns-recursor-4.4.1/test-syncres_cc5.cc Examining data/pdns-recursor-4.4.1/test-dns_random_hh.cc Examining data/pdns-recursor-4.4.1/portsmplexer.cc Examining data/pdns-recursor-4.4.1/filterpo.cc Examining data/pdns-recursor-4.4.1/version.cc Examining data/pdns-recursor-4.4.1/mtasker_context.cc Examining data/pdns-recursor-4.4.1/test-dnsparser_hh.cc Examining data/pdns-recursor-4.4.1/test-syncres_cc7.cc Examining data/pdns-recursor-4.4.1/secpoll-recursor.cc Examining data/pdns-recursor-4.4.1/lua-recursor4.cc Examining data/pdns-recursor-4.4.1/webserver.cc Examining data/pdns-recursor-4.4.1/validate.cc Examining data/pdns-recursor-4.4.1/nsecrecords.cc Examining data/pdns-recursor-4.4.1/test-syncres_cc8.cc Examining data/pdns-recursor-4.4.1/test-iputils_hh.cc Examining data/pdns-recursor-4.4.1/ixfr.cc Examining data/pdns-recursor-4.4.1/test-syncres_cc6.cc Examining data/pdns-recursor-4.4.1/test-dnsrecords_cc.cc Examining data/pdns-recursor-4.4.1/snmp-agent.cc Examining data/pdns-recursor-4.4.1/qtype.cc Examining data/pdns-recursor-4.4.1/lua-base4.cc Examining data/pdns-recursor-4.4.1/json.cc Examining data/pdns-recursor-4.4.1/test-ixfr_cc.cc Examining data/pdns-recursor-4.4.1/dns_random.cc Examining data/pdns-recursor-4.4.1/protobuf.cc Examining data/pdns-recursor-4.4.1/rec_control.cc Examining data/pdns-recursor-4.4.1/xpf.cc Examining data/pdns-recursor-4.4.1/test-recursorcache_cc.cc Examining data/pdns-recursor-4.4.1/dnsname.cc Examining data/pdns-recursor-4.4.1/dnswriter.cc Examining data/pdns-recursor-4.4.1/gettime.cc Examining data/pdns-recursor-4.4.1/dnsrecords.cc FINAL RESULTS: data/pdns-recursor-4.4.1/pdns_recursor.cc:2054: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(sockname.c_str(), sockowner, sockgroup) < 0) { data/pdns-recursor-4.4.1/pdns_recursor.cc:2062: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(sockname.c_str(), sockmode) < 0) { data/pdns-recursor-4.4.1/rec_channel.cc:122: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(d_local.sun_path,0666)<0) // make sure that pdns can reply! data/pdns-recursor-4.4.1/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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.1/pdns_recursor.cc:4193:12: [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. else if (access(dir.c_str(), R_OK | W_OK | X_OK) != 0) { data/pdns-recursor-4.4.1/misc.cc:386: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-recursor-4.4.1/misc.cc:417: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-recursor-4.4.1/pdns_recursor.cc:4625: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-recursor-4.4.1/pdns_recursor.cc:4631: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-recursor-4.4.1/pdns_recursor.cc:5021:12: [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-recursor-4.4.1/pdns_recursor.cc:5087:22: [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. auto runtimeDir = getenv("RUNTIME_DIRECTORY"); data/pdns-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/dnsrecords.cc:688: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(&ca.sin6.sin6_addr.s6_addr, ard->d_ip.d_ip6, ard->d_afdlength); data/pdns-recursor-4.4.1/dnsrecords.cc:793: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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/dnssecinfra.cc:548: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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.1/fstrm_logger.cc:191: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(frame, data.c_str(), data.length()); data/pdns-recursor-4.4.1/iputils.cc:190: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-recursor-4.4.1/logger.cc:59:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[50] = ""; data/pdns-recursor-4.4.1/logger.cc:138: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-recursor-4.4.1/logger.cc:149: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-recursor-4.4.1/logger.cc:156: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-recursor-4.4.1/lwres.cc:349: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(const_cast<char*>(buf.data()), packet.c_str(), len); data/pdns-recursor-4.4.1/misc.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[30]; data/pdns-recursor-4.4.1/misc.cc:493: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-recursor-4.4.1/misc.cc:564: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-recursor-4.4.1/misc.cc:576: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-recursor-4.4.1/misc.cc:707: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-recursor-4.4.1/misc.cc:772: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-recursor-4.4.1/misc.cc:787: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-recursor-4.4.1/mtasker_ucontext.cc:60:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy (&words.first, &hw, 4); data/pdns-recursor-4.4.1/mtasker_ucontext.cc:61:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy (&words.second, &lw, 4); data/pdns-recursor-4.4.1/mtasker_ucontext.cc:74:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy (&hw, &first, 4); data/pdns-recursor-4.4.1/mtasker_ucontext.cc:75:10: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. std::memcpy (&lw, &second, 4); data/pdns-recursor-4.4.1/nod.cc:78:20: [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). infile.open(filename, std::ios::in | std::ios::binary); data/pdns-recursor-4.4.1/nod.cc:131: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). ofile.open(f.string(), std::ios::out | std::ios::binary); data/pdns-recursor-4.4.1/opensslsigners.cc:307: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-recursor-4.4.1/opensslsigners.cc:312: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-recursor-4.4.1/opensslsigners.cc:317: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-recursor-4.4.1/opensslsigners.cc:376: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-recursor-4.4.1/opensslsigners.cc:706: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-recursor-4.4.1/opensslsigners.cc:711: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-recursor-4.4.1/opensslsigners.cc:782: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-recursor-4.4.1/opensslsigners.cc:808: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-recursor-4.4.1/opensslsigners.cc:1058: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-recursor-4.4.1/pdns_recursor.cc:440: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 resp[512]; data/pdns-recursor-4.4.1/pdns_recursor.cc:1232: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(&prefix.sin6.sin6_addr.s6_addr[12], &ipv4.sin4.sin_addr.s_addr, sizeof(ipv4.sin4.sin_addr.s_addr)); data/pdns-recursor-4.4.1/pdns_recursor.cc:1871: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[2]; data/pdns-recursor-4.4.1/pdns_recursor.cc:3141: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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/rec_channel.cc:112:8: [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). if(mkstemp(d_local.sun_path) < 0) data/pdns-recursor-4.4.1/rec_channel.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[16384]; data/pdns-recursor-4.4.1/rec_channel_rec.cc:267: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). int fd=open(fname.c_str(), O_CREAT | O_EXCL | O_WRONLY, 0660); data/pdns-recursor-4.4.1/rec_channel_rec.cc:298: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). int fd=open(fname.c_str(), O_CREAT | O_EXCL | O_WRONLY, 0660); data/pdns-recursor-4.4.1/rec_channel_rec.cc:320: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). int fd=open(fname.c_str(), O_CREAT | O_EXCL | O_WRONLY, 0660); data/pdns-recursor-4.4.1/rec_channel_rec.cc:355:12: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open(fname.c_str(), O_CREAT | O_EXCL | O_WRONLY, 0660); data/pdns-recursor-4.4.1/rec_channel_rec.cc:381: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). int fd=open(fname.c_str(), O_CREAT | O_EXCL | O_WRONLY, 0660); data/pdns-recursor-4.4.1/rec_channel_rec.cc:403: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). int fd=open(fname.c_str(), O_CREAT | O_EXCL | O_WRONLY, 0660); data/pdns-recursor-4.4.1/reczones.cc:61: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 templ[40]; data/pdns-recursor-4.4.1/reczones.cc:398: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. const char *option_names[3]={"auth-zones", "forward-zones", "forward-zones-recurse"}; data/pdns-recursor-4.4.1/reczones.cc:455:52: [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(::arg()["forward-zones-file"].c_str(), "r"), fclose); data/pdns-recursor-4.4.1/resolver.cc:261: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-recursor-4.4.1/resolver.cc:324: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-recursor-4.4.1/rpzloader.cc:308:12: [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(&temp.at(0)); data/pdns-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/syncres.cc:432: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[26]; data/pdns-recursor-4.4.1/syncres.cc:487: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[26]; data/pdns-recursor-4.4.1/syncres.cc:513: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[26]; data/pdns-recursor-4.4.1/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-recursor-4.4.1/test-ednsoptions_cc.cc:146: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(&res.sin4.sin_addr.s_addr, &ecsOptionStr.at(4), sourceBytes); data/pdns-recursor-4.4.1/test-ednsoptions_cc.cc:152: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(&res.sin6.sin6_addr.s6_addr, &ecsOptionStr.at(4), sourceBytes); data/pdns-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/test-misc_hh.cc:218: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[4096]; data/pdns-recursor-4.4.1/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-recursor-4.4.1/test-negcache_cc.cc:436:51: [2] (tmpfile) tmpfile: Function tmpfile() has a security flaw on some systems (e.g., older System V systems) (CWE-377). auto fp = std::unique_ptr<FILE, int (*)(FILE*)>(tmpfile(), fclose); data/pdns-recursor-4.4.1/test-syncres_cc.cc:66: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 templ[40]; data/pdns-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.1/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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.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-recursor-4.4.1/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-recursor-4.4.1/misc.cc:97: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-recursor-4.4.1/misc.cc:124: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-recursor-4.4.1/misc.cc:1592: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). hostname.resize(strlen(hostname.c_str())); data/pdns-recursor-4.4.1/pdns_recursor.cc:3440:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(threadInfo.pipes.readFromThread, &resp, sizeof(resp)) != sizeof(resp)) data/pdns-recursor-4.4.1/pdns_recursor.cc:3557:6: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(fd, &tmsg, sizeof(tmsg)) != sizeof(tmsg)) { // fd == readToThread || fd == readQueriesToThread data/pdns-recursor-4.4.1/pdns_recursor.cc:3631:8: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(tps.readFromThread, &resp, sizeof(resp)) != sizeof(resp)) data/pdns-recursor-4.4.1/rec_channel.cc:162:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(remoteaddr.sun_path, remote->c_str(), sizeof(remoteaddr.sun_path)-1); data/pdns-recursor-4.4.1/reczones.cc:62:7: [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(templ,"a.root-servers.net.", sizeof(templ) - 1); data/pdns-recursor-4.4.1/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-recursor-4.4.1/snmp-agent.cc:62:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). got = read(d_trapPipe[0], &varList, sizeof(varList)); data/pdns-recursor-4.4.1/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-recursor-4.4.1/test-negcache_cc.cc:445:11: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t read; data/pdns-recursor-4.4.1/test-syncres_cc.cc:67:5: [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(templ, "a.root-servers.net.", sizeof(templ) - 1); data/pdns-recursor-4.4.1/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) ANALYSIS SUMMARY: Hits = 202 Lines analyzed = 73670 in approximately 2.11 seconds (34954 lines/second) Physical Source Lines of Code (SLOC) = 58460 Hits@level = [0] 74 [1] 61 [2] 126 [3] 8 [4] 4 [5] 3 Hits@level+ = [0+] 276 [1+] 202 [2+] 141 [3+] 15 [4+] 7 [5+] 3 Hits/KSLOC@level+ = [0+] 4.72118 [1+] 3.45535 [2+] 2.41191 [3+] 0.256586 [4+] 0.11974 [5+] 0.0513171 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.