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/gdnsd-2.4.2/include/gdnsd/dname.h Examining data/gdnsd-2.4.2/include/gdnsd/prcu.h Examining data/gdnsd-2.4.2/include/gdnsd/dmn.h Examining data/gdnsd-2.4.2/include/gdnsd/alloc.h Examining data/gdnsd-2.4.2/include/gdnsd/misc.h Examining data/gdnsd-2.4.2/include/gdnsd/plugin.h Examining data/gdnsd-2.4.2/include/gdnsd/stats.h Examining data/gdnsd-2.4.2/include/gdnsd/log.h Examining data/gdnsd-2.4.2/include/gdnsd/file.h Examining data/gdnsd-2.4.2/include/gdnsd/paths.h Examining data/gdnsd-2.4.2/include/gdnsd/net.h Examining data/gdnsd-2.4.2/include/gdnsd/mon.h Examining data/gdnsd-2.4.2/include/gdnsd/compiler.h Examining data/gdnsd-2.4.2/include/gdnsd/vscf.h Examining data/gdnsd-2.4.2/include/gdnsd/plugapi.h Examining data/gdnsd-2.4.2/include/gdmaps.h Examining data/gdnsd-2.4.2/include/gdnsd-prot/misc.h Examining data/gdnsd-2.4.2/include/gdnsd-prot/mon.h Examining data/gdnsd-2.4.2/include/gdnsd-prot/plugapi.h Examining data/gdnsd-2.4.2/libgdnsd/net.c Examining data/gdnsd-2.4.2/libgdnsd/alloc.c Examining data/gdnsd-2.4.2/libgdnsd/dmn_net.c Examining data/gdnsd-2.4.2/libgdnsd/plugapi.c Examining data/gdnsd-2.4.2/libgdnsd/log.c Examining data/gdnsd-2.4.2/libgdnsd/mon.c Examining data/gdnsd-2.4.2/libgdnsd/misc.c Examining data/gdnsd-2.4.2/libgdnsd/paths.c Examining data/gdnsd-2.4.2/libgdnsd/misc.h Examining data/gdnsd-2.4.2/libgdnsd/file.c Examining data/gdnsd-2.4.2/libgdnsd/prcu.c Examining data/gdnsd-2.4.2/libgdnsd/dmn.c Examining data/gdnsd-2.4.2/libgdnsd/net.h Examining data/gdnsd-2.4.2/libgdnsd/dname.c Examining data/gdnsd-2.4.2/libgdnsd/plugapi.h Examining data/gdnsd-2.4.2/src/dnsio_udp.h Examining data/gdnsd-2.4.2/src/conf.c Examining data/gdnsd-2.4.2/src/ztree.h Examining data/gdnsd-2.4.2/src/ltarena.h Examining data/gdnsd-2.4.2/src/ztree.c Examining data/gdnsd-2.4.2/src/zsrc_rfc1035.c Examining data/gdnsd-2.4.2/src/ltree.c Examining data/gdnsd-2.4.2/src/zsrc_djb.c Examining data/gdnsd-2.4.2/src/dnswire.h Examining data/gdnsd-2.4.2/src/dnspacket.h Examining data/gdnsd-2.4.2/src/socks.c Examining data/gdnsd-2.4.2/src/dnsio_tcp.h Examining data/gdnsd-2.4.2/src/zscan_rfc1035.h Examining data/gdnsd-2.4.2/src/zscan_djb.c Examining data/gdnsd-2.4.2/src/main.c Examining data/gdnsd-2.4.2/src/main.h Examining data/gdnsd-2.4.2/src/zscan_djb.h Examining data/gdnsd-2.4.2/src/ltarena.c Examining data/gdnsd-2.4.2/src/socks.h Examining data/gdnsd-2.4.2/src/conf.h Examining data/gdnsd-2.4.2/src/statio.h Examining data/gdnsd-2.4.2/src/statio.c Examining data/gdnsd-2.4.2/src/zsrc_rfc1035.h Examining data/gdnsd-2.4.2/src/zsrc_djb.h Examining data/gdnsd-2.4.2/src/dnspacket.c Examining data/gdnsd-2.4.2/src/dnsio_udp.c Examining data/gdnsd-2.4.2/src/dnsio_tcp.c Examining data/gdnsd-2.4.2/src/ltree.h Examining data/gdnsd-2.4.2/libgdmaps/nlist.c Examining data/gdnsd-2.4.2/libgdmaps/nets.h Examining data/gdnsd-2.4.2/libgdmaps/ntree.h Examining data/gdnsd-2.4.2/libgdmaps/dclists.h Examining data/gdnsd-2.4.2/libgdmaps/dcinfo.c Examining data/gdnsd-2.4.2/libgdmaps/dcinfo.h Examining data/gdnsd-2.4.2/libgdmaps/gdmaps.c Examining data/gdnsd-2.4.2/libgdmaps/gdgeoip2.c Examining data/gdnsd-2.4.2/libgdmaps/ntree.c Examining data/gdnsd-2.4.2/libgdmaps/gdgeoip.h Examining data/gdnsd-2.4.2/libgdmaps/fips104.h Examining data/gdnsd-2.4.2/libgdmaps/gdgeoip.c Examining data/gdnsd-2.4.2/libgdmaps/dclists.c Examining data/gdnsd-2.4.2/libgdmaps/fips104.c Examining data/gdnsd-2.4.2/libgdmaps/dcmap.h Examining data/gdnsd-2.4.2/libgdmaps/dcmap.c Examining data/gdnsd-2.4.2/libgdmaps/nets.c Examining data/gdnsd-2.4.2/libgdmaps/nlist.h Examining data/gdnsd-2.4.2/libgdmaps/gdgeoip2.h Examining data/gdnsd-2.4.2/plugins/metafo.c Examining data/gdnsd-2.4.2/plugins/http_status.c Examining data/gdnsd-2.4.2/plugins/geoip.c Examining data/gdnsd-2.4.2/plugins/extmon_comms.h Examining data/gdnsd-2.4.2/plugins/gdnsd_geoip_test.c Examining data/gdnsd-2.4.2/plugins/null.c Examining data/gdnsd-2.4.2/plugins/extmon_comms.c Examining data/gdnsd-2.4.2/plugins/multifo.c Examining data/gdnsd-2.4.2/plugins/extmon_helper.c Examining data/gdnsd-2.4.2/plugins/reflect.c Examining data/gdnsd-2.4.2/plugins/extfile.c Examining data/gdnsd-2.4.2/plugins/weighted.c Examining data/gdnsd-2.4.2/plugins/simplefo.c Examining data/gdnsd-2.4.2/plugins/tcp_connect.c Examining data/gdnsd-2.4.2/plugins/extmon.c Examining data/gdnsd-2.4.2/plugins/static.c Examining data/gdnsd-2.4.2/t/libgdmaps/t60_g2_gn_corner.c Examining data/gdnsd-2.4.2/t/libgdmaps/t57_g2_castatdef.c Examining data/gdnsd-2.4.2/t/libgdmaps/t10_def.c Examining data/gdnsd-2.4.2/t/libgdmaps/t55_g2_def2.c Examining data/gdnsd-2.4.2/t/libgdmaps/t56_g2_defnone.c Examining data/gdnsd-2.4.2/t/libgdmaps/t12_defnone.c Examining data/gdnsd-2.4.2/t/libgdmaps/t20_extn_allgs.c Examining data/gdnsd-2.4.2/t/libgdmaps/t07_v6nets.c Examining data/gdnsd-2.4.2/t/libgdmaps/t22_nets_corner.c Examining data/gdnsd-2.4.2/t/libgdmaps/t03_v6citydb.c Examining data/gdnsd-2.4.2/t/libgdmaps/t09_complex.c Examining data/gdnsd-2.4.2/t/libgdmaps/t23_gn_corner.c Examining data/gdnsd-2.4.2/t/libgdmaps/t18_extn_all.c Examining data/gdnsd-2.4.2/t/libgdmaps/t08_cityauto.c Examining data/gdnsd-2.4.2/t/libgdmaps/t01_v6db.c Examining data/gdnsd-2.4.2/t/libgdmaps/t54_g2_complex.c Examining data/gdnsd-2.4.2/t/libgdmaps/t05_v64citydb.c Examining data/gdnsd-2.4.2/t/libgdmaps/gdmaps_test.c Examining data/gdnsd-2.4.2/t/libgdmaps/t17_extn_empty.c Examining data/gdnsd-2.4.2/t/libgdmaps/t59_g2_extnets.c Examining data/gdnsd-2.4.2/t/libgdmaps/t51_g2_city.c Examining data/gdnsd-2.4.2/t/libgdmaps/t16_extnets.c Examining data/gdnsd-2.4.2/t/libgdmaps/t00_v4db.c Examining data/gdnsd-2.4.2/t/libgdmaps/t53_g2_cityauto.c Examining data/gdnsd-2.4.2/t/libgdmaps/t11_def2.c Examining data/gdnsd-2.4.2/t/libgdmaps/t13_castatdef.c Examining data/gdnsd-2.4.2/t/libgdmaps/gdmaps_test.h Examining data/gdnsd-2.4.2/t/libgdmaps/t52_g2_nets.c Examining data/gdnsd-2.4.2/t/libgdmaps/t50_g2_country.c Examining data/gdnsd-2.4.2/t/libgdmaps/t58_g2_missingcoords.c Examining data/gdnsd-2.4.2/t/libgdmaps/t19_extn_allg.c Examining data/gdnsd-2.4.2/t/libgdmaps/t02_v4citydb.c Examining data/gdnsd-2.4.2/t/libgdmaps/t21_extn_subs.c Examining data/gdnsd-2.4.2/t/libgdmaps/t06_v4nets.c Examining data/gdnsd-2.4.2/t/libgdmaps/t15_nogeo.c Examining data/gdnsd-2.4.2/t/libgdmaps/t04_v64db.c Examining data/gdnsd-2.4.2/t/libgdmaps/t14_missingcoords.c Examining data/gdnsd-2.4.2/t/libtap/tap.c Examining data/gdnsd-2.4.2/t/libtap/tap.h FINAL RESULTS: data/gdnsd-2.4.2/libgdnsd/dmn.c:961:16: [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(params.pid_dir, PERMS750)) data/gdnsd-2.4.2/libgdnsd/dmn.c:968:20: [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(params.pid_dir, params.uid, params.gid)) data/gdnsd-2.4.2/libgdnsd/dmn.c:978:20: [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(params.pid_file, PERMS640)) data/gdnsd-2.4.2/libgdnsd/dmn.c:983:24: [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(params.pid_file, params.uid, params.gid)) data/gdnsd-2.4.2/libgdmaps/gdmaps.c:685:9: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(buf, dcname ? dcname : dclist_nodc); data/gdnsd-2.4.2/libgdnsd/dmn.c:331:9: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stdio_out, fmt, apcpy); data/gdnsd-2.4.2/libgdnsd/dmn_net.c:166:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(buf, generic_nullstr); data/gdnsd-2.4.2/libgdnsd/dmn_net.c:192:9: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(buf, generic_nullstr); data/gdnsd-2.4.2/libgdnsd/mon.c:973:28: [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. const int snp_rv = snprintf(buf, avail, http_tmpl, smgrs[i].desc, cur_class, cur_st, real_class, real_st); data/gdnsd-2.4.2/libgdnsd/mon.c:1010:28: [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. const int snp_rv = snprintf(buf, avail, csv_tmpl, smgrs[i].desc, cur_st, real_st); data/gdnsd-2.4.2/libgdnsd/mon.c:1049:28: [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. const int snp_rv = snprintf(buf, avail, json_tmpl, smgrs[i].desc, cur_st, real_st); data/gdnsd-2.4.2/plugins/extmon.c:290:9: [4] (shell) execl: 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. execl(helper_path, helper_path, dmn_get_debug() ? "Y" : "N", dmn_get_syslog_alive() ? "S" : "X", data/gdnsd-2.4.2/plugins/extmon_helper.c:243:9: [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. execv(this_mon->cmd->args[0], this_mon->cmd->args); data/gdnsd-2.4.2/plugins/http_status.c:365:9: [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. snprintf(s->req_data, s->req_data_len + 1, REQ_TMPL_VHOST, url_path, vhost); data/gdnsd-2.4.2/plugins/http_status.c:370:9: [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. snprintf(s->req_data, s->req_data_len + 1, REQ_TMPL, url_path); data/gdnsd-2.4.2/src/main.c:91:5: [4] (format) fprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. fprintf(stderr, data/gdnsd-2.4.2/src/statio.c:349: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. int snp_rv = snprintf(outbufs[1].iov_base, data_buffer_size, csv_fixed, get_uptime_u64(), statio.dns_noerror, statio.dns_refused, statio.dns_nxdomain, statio.dns_notimp, statio.dns_badvers, statio.dns_formerr, statio.dns_dropped, statio.dns_v6, statio.dns_edns, statio.dns_edns_clientsub, statio.udp_reqs, statio.udp_recvfail, statio.udp_sendfail, statio.udp_tc, statio.udp_edns_big, statio.udp_edns_tc, statio.tcp_reqs, statio.tcp_recvfail, statio.tcp_sendfail); data/gdnsd-2.4.2/src/statio.c:354:14: [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. snp_rv = snprintf(outbufs[0].iov_base, hdr_buffer_size, http_headers, "text/plain", (unsigned)outbufs[1].iov_len); data/gdnsd-2.4.2/src/statio.c:365: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. int snp_rv = snprintf(outbufs[1].iov_base, data_buffer_size, json_fixed, get_uptime_u64(), statio.dns_noerror, statio.dns_refused, statio.dns_nxdomain, statio.dns_notimp, statio.dns_badvers, statio.dns_formerr, statio.dns_dropped, statio.dns_v6, statio.dns_edns, statio.dns_edns_clientsub, statio.udp_reqs, statio.udp_recvfail, statio.udp_sendfail, statio.udp_tc, statio.udp_edns_big, statio.udp_edns_tc, statio.tcp_reqs, statio.tcp_recvfail, statio.tcp_sendfail); data/gdnsd-2.4.2/src/statio.c:372:14: [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. snp_rv = snprintf(outbufs[0].iov_base, hdr_buffer_size, http_headers, "application/json", (unsigned)outbufs[1].iov_len); data/gdnsd-2.4.2/src/statio.c:389: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. int snp_rv = snprintf(outbufs[1].iov_base, data_buffer_size, html_fixed, now_char, fmt_uptime(), statio.dns_noerror, statio.dns_refused, statio.dns_nxdomain, statio.dns_notimp, statio.dns_badvers, statio.dns_formerr, statio.dns_dropped, statio.dns_v6, statio.dns_edns, statio.dns_edns_clientsub, statio.udp_reqs, statio.udp_recvfail, statio.udp_sendfail, statio.udp_tc, statio.udp_edns_big, statio.udp_edns_tc, statio.tcp_reqs, statio.tcp_recvfail, statio.tcp_sendfail); data/gdnsd-2.4.2/src/statio.c:396:14: [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. snp_rv = snprintf(outbufs[0].iov_base, hdr_buffer_size, http_headers, "application/xhtml+xml", (unsigned)outbufs[1].iov_len); data/gdnsd-2.4.2/src/zsrc_rfc1035.c:542:13: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(optr, #_x); \ data/gdnsd-2.4.2/src/zsrc_rfc1035.c:544:13: [4] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). strcat(optr, "|" #_x); \ data/gdnsd-2.4.2/t/libtap/tap.c:83:2: [4] (format) vfprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vfprintf(stdout, fmt, ap); data/gdnsd-2.4.2/libgdnsd/dmn.c:433:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. getenv("NOTIFY_SOCKET") data/gdnsd-2.4.2/libgdnsd/dmn.c:434:12: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. || getenv("MAINPID") data/gdnsd-2.4.2/libgdnsd/dmn.c:463:25: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* spath = getenv("NOTIFY_SOCKET"); data/gdnsd-2.4.2/libgdnsd/mon.c:411:8: [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("GDNSD_TESTSUITE_NODELAY")) data/gdnsd-2.4.2/libgdnsd/paths.c:68:17: [3] (buffer) realpath: This function does not protect against buffer overflows, and some implementations can overflow internally (CWE-120/CWE-785!). Ensure that the destination buffer is at least of size MAXPATHLEN, andto protect against implementation problems, the input argument should also be checked to ensure it is no larger than MAXPATHLEN. char* out = realpath(dpath, NULL); data/gdnsd-2.4.2/plugins/extfile.c:290:8: [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("GDNSD_TESTSUITE_NODELAY")) data/gdnsd-2.4.2/src/main.c:315:22: [3] (buffer) getopt: Some older implementations do not protect against internal buffer overflows (CWE-120, CWE-20). Check implementation on installation, or limit the size of all string inputs. while((optchar = getopt(argc, argv, "c:xDfsS"))) { data/gdnsd-2.4.2/src/zsrc_rfc1035.c:797:9: [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("GDNSD_TESTSUITE_NODELAY")) // testsuite can bypass restrictions! data/gdnsd-2.4.2/t/libgdmaps/t00_v4db.c:40: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t01_v6db.c:41: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t02_v4citydb.c:40: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t03_v6citydb.c:41: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t04_v64db.c:41: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t05_v64citydb.c:42: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t06_v4nets.c:44: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t07_v6nets.c:49: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t08_cityauto.c:42: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t09_complex.c:53: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t10_def.c:37: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t11_def2.c:39: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t12_defnone.c:41: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t13_castatdef.c:45: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t14_missingcoords.c:54: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t15_nogeo.c:40: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t16_extnets.c:41: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t17_extn_empty.c:36: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t18_extn_all.c:36: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t19_extn_allg.c:37: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t20_extn_allgs.c:37: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t21_extn_subs.c:36: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t22_nets_corner.c:36: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t23_gn_corner.c:41: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t50_g2_country.c:40: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t51_g2_city.c:40: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t52_g2_nets.c:49: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t53_g2_cityauto.c:42: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t54_g2_complex.c:51: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t55_g2_def2.c:39: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t56_g2_defnone.c:41: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t57_g2_castatdef.c:45: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t58_g2_missingcoords.c:53: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t59_g2_extnets.c:41: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/t/libgdmaps/t60_g2_gn_corner.c:41: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. gdmaps_test_init(getenv("TEST_CFDIR")); data/gdnsd-2.4.2/include/gdnsd/dname.h: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(dest, source, len + 1U); data/gdnsd-2.4.2/libgdmaps/dclists.c: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(dcl_clone->list, old->list, dcl_clone->count * sizeof(uint8_t*)); data/gdnsd-2.4.2/libgdmaps/dclists.c:188:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(sortlist, lists->list[0], store_len); data/gdnsd-2.4.2/libgdmaps/dcmap.c:173: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 lookup[DCMAP_LOOKUP_MAXLEN]; data/gdnsd-2.4.2/libgdmaps/fips104.c:77: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 ccrr[5]; data/gdnsd-2.4.2/libgdmaps/fips104.c:78: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 rname[81]; data/gdnsd-2.4.2/libgdmaps/fips104.c:116:18: [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* file = fopen(pathname, "r"); data/gdnsd-2.4.2/libgdmaps/gdgeoip.c:67: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. static const char GeoIP_country_continent[NUM_COUNTRIES][3] = { "--", data/gdnsd-2.4.2/libgdmaps/gdgeoip.c:96: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. static const char GeoIP_country_code[NUM_COUNTRIES][3] = { "--", data/gdnsd-2.4.2/libgdmaps/gdgeoip.c:131: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. static const char continent_list[NUM_CONTINENTS][3] = { data/gdnsd-2.4.2/libgdmaps/gdgeoip.c:192:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char locstr[7]; data/gdnsd-2.4.2/libgdmaps/gdgeoip.c:215: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 locstr[10]; data/gdnsd-2.4.2/libgdmaps/gdgeoip.c:271: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 locstr[256]; data/gdnsd-2.4.2/libgdmaps/gdgeoip.c:339:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&locstr[loc_pos], region_name, region_len); data/gdnsd-2.4.2/libgdmaps/gdgeoip.c:355:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&locstr[loc_pos], city_name, city_len); data/gdnsd-2.4.2/libgdmaps/gdgeoip2.c:73: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 btime_str[32]; data/gdnsd-2.4.2/libgdmaps/gdgeoip2.c:207:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(lookup, val.utf8_string, val.data_size);\ data/gdnsd-2.4.2/libgdmaps/gdgeoip2.c:268:11: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. const char idx[2] = { '0' + subd_level, '\0' }; data/gdnsd-2.4.2/libgdmaps/gdgeoip2.c:275:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(lookup, val.utf8_string, val.data_size); data/gdnsd-2.4.2/libgdmaps/gdmaps.c:684:13: [2] (buffer) strcat: Does not check for buffer overflows when concatenating to destination [MS-banned] (CWE-120). Consider using strcat_s, strncat, strlcat, or snprintf (warning: strncat is easily misused). Risk is low because the source is a constant string. strcat(buf, ", "); data/gdnsd-2.4.2/libgdmaps/nets.c:72: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 net_str[net_str_len + 1]; data/gdnsd-2.4.2/libgdmaps/nets.c:73: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(net_str, net_str_cfg, net_str_len + 1); data/gdnsd-2.4.2/libgdmaps/nets.c:101:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ipv6, tempsin.sin6.sin6_addr.s6_addr, 16); data/gdnsd-2.4.2/libgdmaps/nets.c:117:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&ipv6[12], &tempsin.sin.sin_addr.s_addr, 4); data/gdnsd-2.4.2/libgdmaps/nlist.c:67: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(nlc->nets, nl->nets, sizeof(net_t) * nlc->count); data/gdnsd-2.4.2/libgdmaps/nlist.c:179: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(this_net->ipv6, ipv6, 16U); data/gdnsd-2.4.2/libgdmaps/ntree.c:90: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(&tempsin.sin6.sin6_addr, &ipv6, sizeof(struct in6_addr)); data/gdnsd-2.4.2/libgdnsd/dmn.c:283: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 tmpbuf[DMN_ERRNO_MAXLEN]; data/gdnsd-2.4.2/libgdnsd/dmn.c:303:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, tmpbuf_ptr, len); data/gdnsd-2.4.2/libgdnsd/dmn.c:377: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 cbuf[bt_max_name]; data/gdnsd-2.4.2/libgdnsd/dmn.c: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(&iovec.iov_base, ¬ify_msg, sizeof(void*)); // iov_base=const hack data/gdnsd-2.4.2/libgdnsd/dmn.c:650: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(cur, strs[i].ptr, strs[i].len); data/gdnsd-2.4.2/libgdnsd/dmn.c:719:23: [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). const int pidfd = open(params.pid_file, O_RDONLY); data/gdnsd-2.4.2/libgdnsd/dmn.c:1042:17: [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 pidfd = open(params.pid_file, O_WRONLY | O_CREAT | O_SYNC, PERMS640); data/gdnsd-2.4.2/libgdnsd/dmn_net.c:54:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&result->sa, ainfo->ai_addr, ainfo->ai_addrlen); data/gdnsd-2.4.2/libgdnsd/dmn_net.c:143: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 hostbuf[INET6_ADDRSTRLEN]; data/gdnsd-2.4.2/libgdnsd/dmn_net.c:144:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char servbuf[6]; data/gdnsd-2.4.2/libgdnsd/dmn_net.c:157:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(bufptr, hostbuf, hostbuf_len); data/gdnsd-2.4.2/libgdnsd/dmn_net.c:162:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(bufptr, servbuf, servbuf_len + 1); // include NUL data/gdnsd-2.4.2/libgdnsd/dmn_net.c:173: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 tmpbuf[DMN_ANYSIN_MAXSTR]; data/gdnsd-2.4.2/libgdnsd/dmn_net.c:180:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, tmpbuf, copylen); data/gdnsd-2.4.2/libgdnsd/dmn_net.c:198: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 tmpbuf[INET6_ADDRSTRLEN]; data/gdnsd-2.4.2/libgdnsd/dmn_net.c:205:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, tmpbuf, copylen); data/gdnsd-2.4.2/libgdnsd/dname.c:79: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 label_buf[252]; data/gdnsd-2.4.2/libgdnsd/dname.c:173: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(dname_cursor, label_buf, llen); data/gdnsd-2.4.2/libgdnsd/dname.c:240: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(dn1 + dn1_len, dn2 + 1, dn2_len); data/gdnsd-2.4.2/libgdnsd/file.c:55:14: [2] (misc) open: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). int fd = open(fn, O_RDONLY | O_CLOEXEC); data/gdnsd-2.4.2/libgdnsd/log.c:45: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(tempsin.sin6.sin6_addr.s6_addr, ipv6, 16); data/gdnsd-2.4.2/libgdnsd/log.c: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 tmpbuf[1024]; data/gdnsd-2.4.2/libgdnsd/log.c:61:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(dnbuf, tmpbuf, len); data/gdnsd-2.4.2/libgdnsd/misc.c:58: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(work, s1, s1_len); data/gdnsd-2.4.2/libgdnsd/misc.c:60: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(work, s2, s2_len); data/gdnsd-2.4.2/libgdnsd/misc.c:93:9: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(cur, strs[i].ptr, strs[i].len); data/gdnsd-2.4.2/libgdnsd/misc.c:126:16: [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 urfd = open("/dev/urandom", O_RDONLY); data/gdnsd-2.4.2/libgdnsd/mon.c:117:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(smgr_sttl, smgr_sttl_consumer_, sizeof(gdnsd_sttl_t) * num_smgrs); data/gdnsd-2.4.2/libgdnsd/mon.c:138: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 tmpbuf[15]; data/gdnsd-2.4.2/libgdnsd/mon.c:150:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out, tmpbuf, snp_len + 1U); data/gdnsd-2.4.2/libgdnsd/mon.c:513: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 addr_str[INET6_ADDRSTRLEN]; data/gdnsd-2.4.2/libgdnsd/mon.c:525: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(&this_smgr->addr, addr, sizeof(dmn_anysin_t)); data/gdnsd-2.4.2/libgdnsd/mon.c:962:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, http_head, http_head_len); data/gdnsd-2.4.2/libgdnsd/mon.c:985:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, http_foot, http_foot_len); data/gdnsd-2.4.2/libgdnsd/mon.c:1002:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, csv_head, csv_head_len); data/gdnsd-2.4.2/libgdnsd/mon.c:1032: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(buf, json_nl, json_nl_len); data/gdnsd-2.4.2/libgdnsd/mon.c:1036: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(buf, json_sep, json_sep_len); data/gdnsd-2.4.2/libgdnsd/mon.c:1041:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, json_head, json_head_len); data/gdnsd-2.4.2/libgdnsd/mon.c:1059:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, json_sep, json_sep_len); data/gdnsd-2.4.2/libgdnsd/mon.c:1068:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, json_foot, json_foot_len); data/gdnsd-2.4.2/libgdnsd/plugapi.c:73: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(&result->storage[v6_offset + (result->count_v6++ * 16U)], asin->sin6.sin6_addr.s6_addr, 16); data/gdnsd-2.4.2/plugins/extmon.c:204: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 outbuf[1024]; // way more than enough, I'd hope... data/gdnsd-2.4.2/plugins/extmon.c:208:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(out_cur, thing, thing_len); data/gdnsd-2.4.2/plugins/extmon.c:313: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 cmds_buf[7]; data/gdnsd-2.4.2/plugins/extmon.c:314: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(cmds_buf, "CMDS:", 5); data/gdnsd-2.4.2/plugins/extmon_comms.c:94:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(buf, "CMD:", 4); data/gdnsd-2.4.2/plugins/extmon_comms.c:118: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(&buf[len], cmd->args[i], arg_len); data/gdnsd-2.4.2/plugins/extmon_comms.c:128:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&buf[len], cmd->desc, desc_len); data/gdnsd-2.4.2/plugins/extmon_comms.c:204:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(cmd->args[cmd->num_args], current, cmdlen); data/gdnsd-2.4.2/plugins/extmon_helper.c:370: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). plugin_read_fd = atoi(argv[3]); data/gdnsd-2.4.2/plugins/extmon_helper.c:371:23: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). plugin_write_fd = atoi(argv[4]); data/gdnsd-2.4.2/plugins/gdnsd_geoip_test.c:78: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(&cinfo.dns_source, &cinfo.edns_client, sizeof(dmn_anysin_t)); data/gdnsd-2.4.2/plugins/gdnsd_geoip_test.c:111: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 linebuf[256]; data/gdnsd-2.4.2/plugins/gdnsd_geoip_test.c:112: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 map_name[128]; data/gdnsd-2.4.2/plugins/gdnsd_geoip_test.c:113: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 ip_addr[128]; data/gdnsd-2.4.2/plugins/http_status.c:62: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 res_buf[14]; data/gdnsd-2.4.2/plugins/http_status.c:278: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 code_str[4] = { 0 }; data/gdnsd-2.4.2/plugins/http_status.c:434: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(&this_mon->addr, addr, sizeof(dmn_anysin_t)); data/gdnsd-2.4.2/plugins/multifo.c:88: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 lbuf[12]; data/gdnsd-2.4.2/plugins/tcp_connect.c:248: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(&this_mon->addr, addr, sizeof(dmn_anysin_t)); data/gdnsd-2.4.2/src/conf.c:88:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(combined, chaos_prefix, chaos_prefix_len); data/gdnsd-2.4.2/src/conf.c:92: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(combined + chaos_prefix_len + 3, data, dlen); data/gdnsd-2.4.2/src/conf.c:220: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(cfg, &cfg_defaults, sizeof(*cfg)); data/gdnsd-2.4.2/src/dnsio_udp.c:300: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 cbuf[CMSG_BUFSIZE]; data/gdnsd-2.4.2/src/dnsio_udp.c:410: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 cmsg_buf[width][cmsg_size]; data/gdnsd-2.4.2/src/dnspacket.c:278:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&ctx->client_info.edns_client.sin.sin_addr.s_addr, opt_data, addr_bytes); data/gdnsd-2.4.2/src/dnspacket.c:287:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ctx->client_info.edns_client.sin6.sin6_addr.s6_addr, opt_data, addr_bytes); data/gdnsd-2.4.2/src/dnspacket.c:513: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(&ctx->packet[pkt_dname_offset], dn + 1, final_size); data/gdnsd-2.4.2/src/dnspacket.c:591: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(&packet[pkt_dname_offset], dn, tocopy); data/gdnsd-2.4.2/src/dnspacket.c:596: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(&packet[pkt_dname_offset], dn, dn_len); data/gdnsd-2.4.2/src/dnspacket.c:608: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(&dname[offset + 1], &raw[offset], llen); data/gdnsd-2.4.2/src/dnspacket.c:738: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(&packet[offset], rrset->addrs.v6 + (i << 4), 16); data/gdnsd-2.4.2/src/dnspacket.c:803: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(&packet[offset], &v6[i << 4], 16); data/gdnsd-2.4.2/src/dnspacket.c:1104:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&packet[offset], this_txt, oal); data/gdnsd-2.4.2/src/dnspacket.c:1141:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&packet[offset], bs, oal); data/gdnsd-2.4.2/src/dnspacket.c:1202: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[offset], &rdata->times, 20); data/gdnsd-2.4.2/src/dnspacket.c:1249: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(&packet[offset], rrset->rdata[i].rd, rrset->rdata[i].rdlen); data/gdnsd-2.4.2/src/dnspacket.c:1750:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(ctx->dync_synth_rrset.addr.v4a, dr->v4, sizeof(uint32_t) * dr->count_v4); data/gdnsd-2.4.2/src/dnspacket.c:1928: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(&ctx->packet[offset], ctx->addtl_store, ctx->addtl_offset); data/gdnsd-2.4.2/src/dnspacket.c:1981:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&ctx->client_info.dns_source, asin, sizeof(dmn_anysin_t)); data/gdnsd-2.4.2/src/dnspacket.c:1986:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&packet[res_offset], gcfg->chaos, gcfg->chaos_len); data/gdnsd-2.4.2/src/dnspacket.c:2027:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&packet[res_offset], &ctx->client_info.edns_client.sin.sin_addr.s_addr, addr_bytes); data/gdnsd-2.4.2/src/dnspacket.c:2036:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&packet[res_offset], ctx->client_info.edns_client.sin6.sin6_addr.s6_addr, addr_bytes); data/gdnsd-2.4.2/src/ltarena.c:223: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(rv, label, sz); data/gdnsd-2.4.2/src/ltarena.c:247: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(retval, dname, dnlen); data/gdnsd-2.4.2/src/ltree.c:320:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(new_v4, rrset->v4a, sizeof(uint32_t) * LTREE_V4A_SIZE); data/gdnsd-2.4.2/src/ltree.c:354: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(rrset->addrs.v6, addr, 16); data/gdnsd-2.4.2/src/ltree.c:377:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(new_v4, rrset->v4a, sizeof(uint32_t) * rrset->gen.count); data/gdnsd-2.4.2/src/ltree.c:382: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(rrset->addrs.v6 + (rrset->count_v6++ * 16), addr, 16); data/gdnsd-2.4.2/src/ltree.c:422: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 plugin_name[rhs_size]; data/gdnsd-2.4.2/src/ltree.c:423: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(plugin_name, rhs, rhs_size); data/gdnsd-2.4.2/src/ltree.c:480: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 plugin_name[rhs_size]; data/gdnsd-2.4.2/src/ltree.c:481: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(plugin_name, rhs, rhs_size); data/gdnsd-2.4.2/src/socks.c:155: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(ac_v4, addr_defs, sizeof(dns_addr_t)); data/gdnsd-2.4.2/src/socks.c:158: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(ac_v6, addr_defs, sizeof(dns_addr_t)); data/gdnsd-2.4.2/src/socks.c:176:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&temp_asin.sin6, ifap->ifa_addr, sizeof(struct sockaddr_in6)); data/gdnsd-2.4.2/src/socks.c:180:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&temp_asin.sin, ifap->ifa_addr, sizeof(struct sockaddr_in)); data/gdnsd-2.4.2/src/socks.c:200: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(addrconf, addr_defs, sizeof(dns_addr_t)); data/gdnsd-2.4.2/src/socks.c:201: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(&addrconf->addr, &temp_asin, sizeof(dmn_anysin_t)); data/gdnsd-2.4.2/src/socks.c:235:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(addrconf, addr_defs, sizeof(dns_addr_t)); data/gdnsd-2.4.2/src/socks.c:270:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(addrconf, addr_defs, sizeof(dns_addr_t)); data/gdnsd-2.4.2/src/socks.c:328: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(socks_cfg, &socks_cfg_defaults, sizeof(*socks_cfg)); data/gdnsd-2.4.2/src/statio.c: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 read_buffer[HTTP_READ_BYTES]; data/gdnsd-2.4.2/src/statio.c:314:8: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. static char ival_buf[IVAL_BUFSZ]; data/gdnsd-2.4.2/src/statio.c:369: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(ADDVOID(outbufs[1].iov_base, outbufs[1].iov_len), json_footer, sizeof(json_footer) - 1U); data/gdnsd-2.4.2/src/statio.c: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 now_char[64]; data/gdnsd-2.4.2/src/statio.c:393: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(ADDVOID(outbufs[1].iov_base, outbufs[1].iov_len), html_footer, sizeof(html_footer) - 1U); data/gdnsd-2.4.2/src/statio.c:409: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(&outbufs[0].iov_base, &http_404_hdr[0], sizeof(void*)); data/gdnsd-2.4.2/src/statio.c:410: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(&outbufs[1].iov_base, &http_404_data[0], sizeof(void*)); data/gdnsd-2.4.2/src/zscan_djb.c:263: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 dnstr[1024]; data/gdnsd-2.4.2/src/zscan_djb.c:395:17: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&z->texts[i][1], src, s); data/gdnsd-2.4.2/src/zscan_djb.c:437:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(&z->texts[i][1], field[3+i].ptr, field[3+i].len); data/gdnsd-2.4.2/src/zscan_djb.c:468:15: [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). z->file = fopen(z->full_fn, "rt"); data/gdnsd-2.4.2/src/ztree.c:270: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(rv->label, label, lsz); data/gdnsd-2.4.2/src/ztree.c:401:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(new_list, old_list, old_len * sizeof(zone_t*)); data/gdnsd-2.4.2/src/ztree.c:478:13: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(new_list, old_list, old_len * sizeof(zone_t*)); data/gdnsd-2.4.2/src/ztree.c:531: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(ztclone->zones, original->zones, original->zones_len * sizeof(zone_t*)); data/gdnsd-2.4.2/include/gdnsd/vscf.h:156:44: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). vscf_hash_get_data_bykey((_d), (_key), strlen(_key), (_sm)) data/gdnsd-2.4.2/libgdmaps/dcmap.c:142: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). locstr += strlen(locstr) + 1; data/gdnsd-2.4.2/libgdmaps/dcmap.c:148:78: [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 dcmap_lookup_loc(dcmap->child_dcmaps[i], locstr + strlen(locstr) + 1); data/gdnsd-2.4.2/libgdmaps/gdgeoip.c:311:31: [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). unsigned region_len = strlen(region_name); data/gdnsd-2.4.2/libgdmaps/gdgeoip.c:327:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). region_len = strlen(region_name); data/gdnsd-2.4.2/libgdmaps/gdgeoip.c:346:35: [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). const unsigned city_len = strlen(city_name); data/gdnsd-2.4.2/libgdmaps/gdgeoip.c:362: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). rec += strlen((const char*)rec); data/gdnsd-2.4.2/libgdmaps/gdmaps.c:669:23: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). output_len += strlen(dcname ? dcname : dclist_nodc); data/gdnsd-2.4.2/libgdnsd/dmn.c:301:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const unsigned len = strlen(tmpbuf_ptr) + 1; data/gdnsd-2.4.2/libgdnsd/dmn.c:478:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(sun.sun_path, spath, sizeof(sun.sun_path)); data/gdnsd-2.4.2/libgdnsd/dmn.c:486: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). iovec.iov_len = strlen(notify_msg); data/gdnsd-2.4.2/libgdnsd/dmn.c:492:67: [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). msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(spath); data/gdnsd-2.4.2/libgdnsd/dmn.c:599:23: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). read_rv = read(readpipe, &msg, 1); data/gdnsd-2.4.2/libgdnsd/dmn.c:638:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const unsigned l = strlen(s); data/gdnsd-2.4.2/libgdnsd/dmn.c:697:5: [1] (access) umask: Ensure that umask is given most restrictive possible setting (e.g., 066 or 077) (CWE-732). umask(022); data/gdnsd-2.4.2/libgdnsd/dmn.c:1109:13: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(1 != read(state.pipe_from_helper[PIPE_RD], &msg, 1)) data/gdnsd-2.4.2/libgdnsd/dmn.c:1128:17: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(1 != read(state.pipe_from_helper[PIPE_RD], &msg, 1)) data/gdnsd-2.4.2/libgdnsd/dmn_net.c:151:42: [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). const unsigned hostbuf_len = strlen(hostbuf); data/gdnsd-2.4.2/libgdnsd/dmn_net.c:152:42: [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). const unsigned servbuf_len = strlen(servbuf); data/gdnsd-2.4.2/libgdnsd/dmn_net.c:178: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). const unsigned copylen = strlen(tmpbuf) + 1; data/gdnsd-2.4.2/libgdnsd/dmn_net.c:203: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). const unsigned copylen = strlen(tmpbuf) + 1; data/gdnsd-2.4.2/libgdnsd/misc.c:54:29: [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). const unsigned s1_len = strlen(s1); data/gdnsd-2.4.2/libgdnsd/misc.c:55:29: [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). const unsigned s2_len = strlen(s2); data/gdnsd-2.4.2/libgdnsd/misc.c:83:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const unsigned l = strlen(s); data/gdnsd-2.4.2/libgdnsd/misc.c:134:12: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). if(read(urfd, rdata, sizeof(*rdata)) != sizeof(*rdata)) data/gdnsd-2.4.2/libgdnsd/mon.c:868:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). max_stats_len += strlen(smgrs[i].desc); data/gdnsd-2.4.2/plugins/extmon.c:120:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t read_rv = read(helper_read_fd, &data, 4); data/gdnsd-2.4.2/plugins/extmon.c:223:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const unsigned thing_len = strlen(mon->thing); data/gdnsd-2.4.2/plugins/extmon_comms.c:61:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t read_rv = read(fd, out + seen, len - seen); data/gdnsd-2.4.2/plugins/extmon_comms.c:82:26: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const unsigned len = strlen(str); data/gdnsd-2.4.2/plugins/extmon_comms.c:113:34: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const unsigned arg_len = strlen(cmd->args[i]) + 1; data/gdnsd-2.4.2/plugins/extmon_comms.c:123:31: [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). const unsigned desc_len = strlen(cmd->desc) + 1; data/gdnsd-2.4.2/plugins/extmon_comms.c:215:20: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). current += strlen((const char*)current); data/gdnsd-2.4.2/plugins/http_status.c:361: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). const unsigned url_len = strlen(url_path); data/gdnsd-2.4.2/plugins/http_status.c:363:58: [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). s->req_data_len = REQ_TMPL_VHOST_LEN + url_len + strlen(vhost); data/gdnsd-2.4.2/plugins/multifo.c:90:33: [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). vscf_hash_add_val(lbuf, strlen(lbuf), newhash, vscf_clone(this_addr_cfg, false)); data/gdnsd-2.4.2/src/conf.c:82:27: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const unsigned dlen = strlen(data); data/gdnsd-2.4.2/src/ltree.c:421:31: [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). const unsigned rhs_size = strlen(rhs) + 1; data/gdnsd-2.4.2/src/ltree.c:479:31: [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). const unsigned rhs_size = strlen(rhs) + 1; data/gdnsd-2.4.2/src/statio.c:443:32: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const unsigned msize = strlen(http_lookup[i].match); data/gdnsd-2.4.2/src/statio.c:716:29: [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). + (19 * (stat_len - strlen(PRIuPTR))) // 19 stats, up to 20 bytes long each data/gdnsd-2.4.2/src/zscan_djb.c:496:36: [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). field[i].len = strlen(c); data/gdnsd-2.4.2/src/zsrc_rfc1035.c:253:70: [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). const unsigned zfn_hash = gdnsd_lookup2((const uint8_t*)zfn, strlen(zfn)); data/gdnsd-2.4.2/src/zsrc_rfc1035.c:271:28: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). unsigned zf_name_len = strlen(zf_name); data/gdnsd-2.4.2/src/zsrc_rfc1035.c:422:63: [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). current_zft->hash = gdnsd_lookup2((const uint8_t*)fn, strlen(fn)); data/gdnsd-2.4.2/src/zsrc_rfc1035.c:721:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). ssize_t read_rv = read(w->fd, evtbuf, inotify_bufsize); data/gdnsd-2.4.2/src/ztree.c:79:61: [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). dname_status_t status = dname_from_string(dname, zname, strlen(zname)); data/gdnsd-2.4.2/t/libgdmaps/gdmaps_test.c:89:43: [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). vscf_data_t* maps_cfg = vscf_scan_buf(strlen(cfg_data), cfg_data, "(test maps)", false); ANALYSIS SUMMARY: Hits = 260 Lines analyzed = 28975 in approximately 0.91 seconds (31857 lines/second) Physical Source Lines of Code (SLOC) = 19446 Hits@level = [0] 46 [1] 48 [2] 144 [3] 43 [4] 21 [5] 4 Hits@level+ = [0+] 306 [1+] 260 [2+] 212 [3+] 68 [4+] 25 [5+] 4 Hits/KSLOC@level+ = [0+] 15.7359 [1+] 13.3704 [2+] 10.902 [3+] 3.49686 [4+] 1.28561 [5+] 0.205698 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.