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/c-ares-1.17.1/src/lib/ares_parse_txt_reply.c Examining data/c-ares-1.17.1/src/lib/ares__close_sockets.c Examining data/c-ares-1.17.1/src/lib/ares_getnameinfo.c Examining data/c-ares-1.17.1/src/lib/ares_data.h Examining data/c-ares-1.17.1/src/lib/ares_expand_string.c Examining data/c-ares-1.17.1/src/lib/ares_android.c Examining data/c-ares-1.17.1/src/lib/ares_send.c Examining data/c-ares-1.17.1/src/lib/ares_writev.h Examining data/c-ares-1.17.1/src/lib/ares_nowarn.c Examining data/c-ares-1.17.1/src/lib/ares_mkquery.c Examining data/c-ares-1.17.1/src/lib/ares__sortaddrinfo.c Examining data/c-ares-1.17.1/src/lib/windows_port.c Examining data/c-ares-1.17.1/src/lib/ares_nowarn.h Examining data/c-ares-1.17.1/src/lib/ares_platform.h Examining data/c-ares-1.17.1/src/lib/ares_destroy.c Examining data/c-ares-1.17.1/src/lib/bitncmp.c Examining data/c-ares-1.17.1/src/lib/ares_strsplit.c Examining data/c-ares-1.17.1/src/lib/config-win32.h Examining data/c-ares-1.17.1/src/lib/ares_platform.c Examining data/c-ares-1.17.1/src/lib/ares_strdup.h Examining data/c-ares-1.17.1/src/lib/ares_setup.h Examining data/c-ares-1.17.1/src/lib/nameser.h Examining data/c-ares-1.17.1/src/lib/inet_ntop.c Examining data/c-ares-1.17.1/src/lib/ares__read_line.c Examining data/c-ares-1.17.1/src/lib/ares_process.c Examining data/c-ares-1.17.1/src/lib/ares_strcasecmp.c Examining data/c-ares-1.17.1/src/lib/ares_parse_ptr_reply.c Examining data/c-ares-1.17.1/src/lib/ares_options.c Examining data/c-ares-1.17.1/src/lib/ares_private.h Examining data/c-ares-1.17.1/src/lib/ares_strsplit.h Examining data/c-ares-1.17.1/src/lib/ares__get_hostent.c Examining data/c-ares-1.17.1/src/lib/ares_library_init.h Examining data/c-ares-1.17.1/src/lib/ares_iphlpapi.h Examining data/c-ares-1.17.1/src/lib/ares_parse_naptr_reply.c Examining data/c-ares-1.17.1/src/lib/ares_llist.h Examining data/c-ares-1.17.1/src/lib/ares__timeval.c Examining data/c-ares-1.17.1/src/lib/ares_parse_soa_reply.c Examining data/c-ares-1.17.1/src/lib/ares_timeout.c Examining data/c-ares-1.17.1/src/lib/ares_cancel.c Examining data/c-ares-1.17.1/src/lib/ares_search.c Examining data/c-ares-1.17.1/src/lib/setup_once.h Examining data/c-ares-1.17.1/src/lib/ares_init.c Examining data/c-ares-1.17.1/src/lib/ares_gethostbyname.c Examining data/c-ares-1.17.1/src/lib/ares_parse_aaaa_reply.c Examining data/c-ares-1.17.1/src/lib/bitncmp.h Examining data/c-ares-1.17.1/src/lib/ares__readaddrinfo.c Examining data/c-ares-1.17.1/src/lib/ares_fds.c Examining data/c-ares-1.17.1/src/lib/inet_net_pton.c Examining data/c-ares-1.17.1/src/lib/ares_strdup.c Examining data/c-ares-1.17.1/src/lib/ares_free_hostent.c Examining data/c-ares-1.17.1/src/lib/ares_ipv6.h Examining data/c-ares-1.17.1/src/lib/ares_inet_net_pton.h Examining data/c-ares-1.17.1/src/lib/ares_version.c Examining data/c-ares-1.17.1/src/lib/ares_llist.c Examining data/c-ares-1.17.1/src/lib/ares__parse_into_addrinfo.c Examining data/c-ares-1.17.1/src/lib/ares_library_init.c Examining data/c-ares-1.17.1/src/lib/ares_query.c Examining data/c-ares-1.17.1/src/lib/ares_gethostbyaddr.c Examining data/c-ares-1.17.1/src/lib/ares_data.c Examining data/c-ares-1.17.1/src/lib/ares_parse_mx_reply.c Examining data/c-ares-1.17.1/src/lib/ares_parse_a_reply.c Examining data/c-ares-1.17.1/src/lib/ares_parse_ns_reply.c Examining data/c-ares-1.17.1/src/lib/ares_freeaddrinfo.c Examining data/c-ares-1.17.1/src/lib/ares_android.h Examining data/c-ares-1.17.1/src/lib/ares_expand_name.c Examining data/c-ares-1.17.1/src/lib/ares_free_string.c Examining data/c-ares-1.17.1/src/lib/ares_parse_srv_reply.c Examining data/c-ares-1.17.1/src/lib/ares_getaddrinfo.c Examining data/c-ares-1.17.1/src/lib/config-dos.h Examining data/c-ares-1.17.1/src/lib/ares_strcasecmp.h Examining data/c-ares-1.17.1/src/lib/ares_strerror.c Examining data/c-ares-1.17.1/src/lib/ares_getsock.c Examining data/c-ares-1.17.1/src/lib/ares_getenv.c Examining data/c-ares-1.17.1/src/lib/ares_getenv.h Examining data/c-ares-1.17.1/src/lib/ares_parse_caa_reply.c Examining data/c-ares-1.17.1/src/lib/ares_create_query.c Examining data/c-ares-1.17.1/src/lib/ares_writev.c Examining data/c-ares-1.17.1/src/tools/ahost.c Examining data/c-ares-1.17.1/src/tools/ares_getopt.c Examining data/c-ares-1.17.1/src/tools/acountry.c Examining data/c-ares-1.17.1/src/tools/adig.c Examining data/c-ares-1.17.1/src/tools/ares_getopt.h Examining data/c-ares-1.17.1/include/ares_version.h Examining data/c-ares-1.17.1/include/ares_dns.h Examining data/c-ares-1.17.1/include/ares_rules.h Examining data/c-ares-1.17.1/include/ares.h Examining data/c-ares-1.17.1/include/ares_build.h Examining data/c-ares-1.17.1/test/ares-test-parse-soa.cc Examining data/c-ares-1.17.1/test/dns-proto.cc Examining data/c-ares-1.17.1/test/gmock-1.8.0/gmock/gmock.h Examining data/c-ares-1.17.1/test/gmock-1.8.0/gtest/gtest.h Examining data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc Examining data/c-ares-1.17.1/test/ares-test-live.cc Examining data/c-ares-1.17.1/test/ares-test-main.cc Examining data/c-ares-1.17.1/test/ares-test-parse-mx.cc Examining data/c-ares-1.17.1/test/ares-test-parse.cc Examining data/c-ares-1.17.1/test/ares-test.h Examining data/c-ares-1.17.1/test/ares-test-fuzz-name.c Examining data/c-ares-1.17.1/test/ares-test-misc.cc Examining data/c-ares-1.17.1/test/ares-test-internal.cc Examining data/c-ares-1.17.1/test/ares-test-parse-srv.cc Examining data/c-ares-1.17.1/test/ares-test.cc Examining data/c-ares-1.17.1/test/ares-test-parse-caa.cc Examining data/c-ares-1.17.1/test/ares-test-parse-txt.cc Examining data/c-ares-1.17.1/test/ares-test-parse-aaaa.cc Examining data/c-ares-1.17.1/test/ares-test-mock-ai.cc Examining data/c-ares-1.17.1/test/ares-test-parse-naptr.cc Examining data/c-ares-1.17.1/test/ares-test-ai.h Examining data/c-ares-1.17.1/test/ares-test-parse-ptr.cc Examining data/c-ares-1.17.1/test/dns-dump.cc Examining data/c-ares-1.17.1/test/ares-test-parse-a.cc Examining data/c-ares-1.17.1/test/ares-fuzz.c Examining data/c-ares-1.17.1/test/ares-test-fuzz.c Examining data/c-ares-1.17.1/test/ares-test-ns.cc Examining data/c-ares-1.17.1/test/ares-test-mock.cc Examining data/c-ares-1.17.1/test/ares-test-init.cc Examining data/c-ares-1.17.1/test/dns-proto.h Examining data/c-ares-1.17.1/test/dns-proto-test.cc Examining data/c-ares-1.17.1/test/ares-test-parse-ns.cc Examining data/c-ares-1.17.1/test/ares-test-parse-soa-any.cc FINAL RESULTS: data/c-ares-1.17.1/test/ares-test-init.cc:495:5: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(filename_.c_str(), 0000); data/c-ares-1.17.1/test/ares-test-init.cc:497:23: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. ~MakeUnreadable() { chmod(filename_.c_str(), 0644); } data/c-ares-1.17.1/test/ares-test-mock.cc:1027:3: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(aliases.filename(), 0); data/c-ares-1.17.1/test/ares-test-mock.cc:1034:3: [5] (race) chmod: This accepts filename arguments; if an attacker can move those files, a race condition results. (CWE-362). Use fchmod( ) instead. chmod(aliases.filename(), 0777); data/c-ares-1.17.1/src/lib/ares_getaddrinfo.c:479:7: [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(PATH_HOSTS, WIN_PATH_HOSTS); data/c-ares-1.17.1/src/lib/ares_gethostbyaddr.c:208:3: [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(PATH_HOSTS, WIN_PATH_HOSTS); data/c-ares-1.17.1/src/lib/ares_gethostbyname.c:387:3: [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(PATH_HOSTS, WIN_PATH_HOSTS); data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:410:5: [4] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). strcpy(&buf[bufl], tmpbuf); data/c-ares-1.17.1/src/lib/ares_options.c:275:3: [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(csv, _csv); data/c-ares-1.17.1/src/lib/ares_parse_ns_reply.c:135:7: [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(nameservers[nameservers_num],rr_data); data/c-ares-1.17.1/src/lib/inet_ntop.c:93:15: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. if ((size_t)sprintf(tmp, fmt, src[0], src[1], src[2], src[3]) >= size) { data/c-ares-1.17.1/src/lib/inet_ntop.c:97:3: [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(dst, tmp); data/c-ares-1.17.1/src/lib/inet_ntop.c:194:3: [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(dst, tmp); data/c-ares-1.17.1/src/tools/acountry.c:85:24: [4] (format) printf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. printf fmt ; \ data/c-ares-1.17.1/src/tools/acountry.c:98:3: [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(stderr, fmt, args); data/c-ares-1.17.1/src/tools/acountry.c:174:7: [4] (format) sprintf: Potential format string problem (CWE-134). Make format string constant. sprintf(buf, nerd_fmt, data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:1594:10: [4] (format) vsnprintf: 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 vsnprintf _vsnprintf data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:4419:5: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(fmt, args); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:4439:3: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(fmt, args); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:4446:3: [4] (format) vprintf: If format strings can be influenced by an attacker, they can be exploited (CWE-134). Use a constant for the format specification. vprintf(fmt, args); data/c-ares-1.17.1/test/gmock-1.8.0/gtest/gtest.h:3631:20: [4] (buffer) StrNCpy: 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). inline const char* StrNCpy(char* dest, const char* src, size_t n) { data/c-ares-1.17.1/test/gmock-1.8.0/gtest/gtest.h:3702:26: [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 GTEST_SNPRINTF_ _snprintf data/c-ares-1.17.1/test/gmock-1.8.0/gtest/gtest.h:3704:26: [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 GTEST_SNPRINTF_ snprintf data/c-ares-1.17.1/test/gmock-1.8.0/gtest/gtest.h:9177: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(\ data/c-ares-1.17.1/src/lib/ares_getaddrinfo.c:446:20: [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. path_hosts = getenv("CARES_HOSTS"); data/c-ares-1.17.1/src/lib/ares_init.c:550:17: [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. localdomain = getenv("LOCALDOMAIN"); data/c-ares-1.17.1/src/lib/ares_init.c:558:17: [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. res_options = getenv("RES_OPTIONS"); data/c-ares-1.17.1/src/lib/ares_init.c:1481:10: [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. line = getenv("Inet$Resolvers"); data/c-ares-1.17.1/src/lib/ares_private.h:106: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. # define getenv(ptr) ares_getenv(ptr) data/c-ares-1.17.1/src/lib/ares_search.c:256:21: [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. hostaliases = getenv("HOSTALIASES"); data/c-ares-1.17.1/test/ares-test-ns.cc:74:7: [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(buffer) != 0) { data/c-ares-1.17.1/test/ares-test-ns.cc:167:9: [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. if (realpath(mountpt.c_str(), buffer)) { data/c-ares-1.17.1/test/ares-test.cc:782:13: [3] (tmpfile) tempnam: Temporary file race condition (CWE-377). char *p = tempnam(dir, prefix); data/c-ares-1.17.1/test/ares-test.h:365:21: [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 (!overwrite && getenv(name) != NULL) { data/c-ares-1.17.1/test/ares-test.h:389: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. char *original = getenv(name); data/c-ares-1.17.1/test/ares-test.h:441:25: [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. ContainerFilesystem chroot(files, ".."); \ data/c-ares-1.17.1/test/ares-test.h:443:34: [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. EXPECT_EQ(0, RunInContainer(&chroot, hostname, domainname, fn)); \ data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:719:37: [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. void ShuffleRange(internal::Random* random, int begin, int end, data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:740:39: [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. inline void Shuffle(internal::Random* random, std::vector<E>* v) { data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:741: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. ShuffleRange(random, 0, static_cast<int>(v->size()), v); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:1199:21: [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. internal::Random* random() { return &random_; } data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:1642:44: [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* const testbridge_test_only = getenv(GTEST_TEST_FILTER_ENV_VAR_); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:4241:47: [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. void TestCase::ShuffleTests(internal::Random* random) { data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:4242:11: [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. Shuffle(random, &test_indices_); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:6075:7: [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. random()->Reseed(random_seed_); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:6389: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. ShuffleRange(random(), 0, last_death_test_case_ + 1, &test_case_indices_); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:6392: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. ShuffleRange(random(), last_death_test_case_ + 1, data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:6397:34: [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. test_cases_[i]->ShuffleTests(random()); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:8792:5: [3] (misc) InitializeCriticalSection: Exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. ::InitializeCriticalSection(critical_section_); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:8810:5: [3] (misc) EnterCriticalSection: On some versions of Windows, exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. ::EnterCriticalSection(critical_section_); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:8842:11: [3] (misc) InitializeCriticalSection: Exceptions can be thrown in low-memory situations. Use InitializeCriticalSectionAndSpinCount instead. ::InitializeCriticalSection(critical_section_); data/c-ares-1.17.1/test/gmock-1.8.0/gtest/gtest.h:3670:27: [3] (buffer) getenv: Environment variables are untrustable input if they can be set by an attacker. They can have any content and length, and the same variable can be set more than once (CWE-807, CWE-20). Check environment variables carefully before using them. const char* const env = getenv(name); data/c-ares-1.17.1/test/gmock-1.8.0/gtest/gtest.h:3673:10: [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. return getenv(name); data/c-ares-1.17.1/test/gmock-1.8.0/gtest/gtest.h:19524:39: [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. void ShuffleTests(internal::Random* random); data/c-ares-1.17.1/include/ares.h:517: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 _S6_u8[16]; data/c-ares-1.17.1/include/ares_rules.h:90:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. typedef char data/c-ares-1.17.1/include/ares_rules.h:100:9: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. typedef char data/c-ares-1.17.1/src/lib/ares__get_hostent.c:188: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(hostent->h_addr_list[0], &addr.addrV4, sizeof(addr.addrV4)); data/c-ares-1.17.1/src/lib/ares__get_hostent.c:190: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(hostent->h_addr_list[0], &addr.addrV6, sizeof(addr.addrV6)); data/c-ares-1.17.1/src/lib/ares__parse_into_addrinfo.c:144:11: [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(&sin->sin_addr.s_addr, aptr, sizeof(struct in_addr)); data/c-ares-1.17.1/src/lib/ares__parse_into_addrinfo.c:181:11: [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(&sin6->sin6_addr.s6_addr, aptr, sizeof(struct ares_in6_addr)); data/c-ares-1.17.1/src/lib/ares__readaddrinfo.c:43: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 *aliases[MAX_ALIASES]; data/c-ares-1.17.1/src/lib/ares__readaddrinfo.c:192:15: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(node->ai_addr, &addr.sa4, sizeof(addr.sa4)); data/c-ares-1.17.1/src/lib/ares__readaddrinfo.c:213:15: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(node->ai_addr, &addr.sa6, sizeof(addr.sa6)); data/c-ares-1.17.1/src/lib/ares_getaddrinfo.c:234: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[4096]; data/c-ares-1.17.1/src/lib/ares_getaddrinfo.c:365:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(node->ai_addr, &addr.sa4, sizeof(addr.sa4)); data/c-ares-1.17.1/src/lib/ares_getaddrinfo.c:367:5: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy(node->ai_addr, &addr.sa6, sizeof(addr.sa6)); data/c-ares-1.17.1/src/lib/ares_getaddrinfo.c:452: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 PATH_HOSTS[MAX_PATH]; data/c-ares-1.17.1/src/lib/ares_getaddrinfo.c:461: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 tmp[MAX_PATH]; data/c-ares-1.17.1/src/lib/ares_getaddrinfo.c:491:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(path_hosts, "r"); data/c-ares-1.17.1/src/lib/ares_gethostbyaddr.c:105:3: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char name[128]; data/c-ares-1.17.1/src/lib/ares_gethostbyaddr.c:182: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 PATH_HOSTS[MAX_PATH]; data/c-ares-1.17.1/src/lib/ares_gethostbyaddr.c:190: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[MAX_PATH]; data/c-ares-1.17.1/src/lib/ares_gethostbyaddr.c:217:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(PATH_HOSTS, "r"); data/c-ares-1.17.1/src/lib/ares_gethostbyaddr.c:273:8: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(name, "%lu.%lu.%lu.%lu.in-addr.arpa", a4, a3, a2, a1); data/c-ares-1.17.1/src/lib/ares_gethostbyaddr.c:280:8: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(name, data/c-ares-1.17.1/src/lib/ares_gethostbyaddr.c:286:8: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(name+strlen(name), data/c-ares-1.17.1/src/lib/ares_gethostbyname.c:255: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 *aliases[1] = { NULL }; data/c-ares-1.17.1/src/lib/ares_gethostbyname.c:256: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 *addrs[2]; data/c-ares-1.17.1/src/lib/ares_gethostbyname.c:361: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 PATH_HOSTS[MAX_PATH]; data/c-ares-1.17.1/src/lib/ares_gethostbyname.c:369: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[MAX_PATH]; data/c-ares-1.17.1/src/lib/ares_gethostbyname.c:401:8: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(PATH_HOSTS, "r"); data/c-ares-1.17.1/src/lib/ares_gethostbyname.c:453: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(&a1, host->h_addr_list[i1], sizeof(struct in_addr)); data/c-ares-1.17.1/src/lib/ares_gethostbyname.c:457:11: [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(&a2, host->h_addr_list[i2], sizeof(struct in_addr)); data/c-ares-1.17.1/src/lib/ares_gethostbyname.c:461:11: [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(host->h_addr_list[i2 + 1], &a2, sizeof(struct in_addr)); data/c-ares-1.17.1/src/lib/ares_gethostbyname.c:463: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(host->h_addr_list[i2 + 1], &a1, sizeof(struct in_addr)); data/c-ares-1.17.1/src/lib/ares_gethostbyname.c:509: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(&a1, host->h_addr_list[i1], sizeof(struct ares_in6_addr)); data/c-ares-1.17.1/src/lib/ares_gethostbyname.c:513:11: [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(&a2, host->h_addr_list[i2], sizeof(struct ares_in6_addr)); data/c-ares-1.17.1/src/lib/ares_gethostbyname.c:517:11: [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(host->h_addr_list[i2 + 1], &a2, sizeof(struct ares_in6_addr)); data/c-ares-1.17.1/src/lib/ares_gethostbyname.c:519: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(host->h_addr_list[i2 + 1], &a1, sizeof(struct ares_in6_addr)); data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:117: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[33], *service; data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:131: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 ipbuf[IPBUFSIZ]; data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:132: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 srvbuf[33]; data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:200: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 srvbuf[33]; data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:223: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. char buf[255]; data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:243: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 ipbuf[IPBUFSIZ]; data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:283: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[4096]; data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:336:11: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(tmpbuf, "%u", (unsigned int)ntohs(port)); data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:342: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, name, name_len + 1); data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:359: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[IF_NAMESIZE + 2]; data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:373:11: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(&tmpbuf[1], "%lu", (unsigned long)addr6->sin6_scope_id); data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:377:11: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(&tmpbuf[1], "%u", (unsigned int)addr6->sin6_scope_id); data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:386:15: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(&tmpbuf[1], "%lu", (unsigned long)addr6->sin6_scope_id); data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:390:15: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(&tmpbuf[1], "%u", (unsigned int)addr6->sin6_scope_id); data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:397:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(&tmpbuf[1], "%lu", (unsigned long)addr6->sin6_scope_id); data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:401:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(&tmpbuf[1], "%u", (unsigned int)addr6->sin6_scope_id); data/c-ares-1.17.1/src/lib/ares_init.c:289: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)->local_ip6, src->local_ip6, sizeof(src->local_ip6)); data/c-ares-1.17.1/src/lib/ares_init.c:376:11: [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(&options->servers[j++], data/c-ares-1.17.1/src/lib/ares_init.c:678: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 enumKeyName[256]; data/c-ares-1.17.1/src/lib/ares_init.c:983: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 text[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; data/c-ares-1.17.1/src/lib/ares_init.c:1349: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 keyName[256]; data/c-ares-1.17.1/src/lib/ares_init.c:1574: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 propname[PROP_NAME_MAX]; data/c-ares-1.17.1/src/lib/ares_init.c:1575: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 propvalue[PROP_VALUE_MAX]=""; data/c-ares-1.17.1/src/lib/ares_init.c:1602: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 str[INET6_ADDRSTRLEN]; data/c-ares-1.17.1/src/lib/ares_init.c:1672:10: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(resolvconf_path, "r"); data/c-ares-1.17.1/src/lib/ares_init.c:1714: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). fp = fopen("/etc/nsswitch.conf", "r"); data/c-ares-1.17.1/src/lib/ares_init.c:1744: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). fp = fopen("/etc/host.conf", "r"); data/c-ares-1.17.1/src/lib/ares_init.c:1775: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). fp = fopen("/etc/svc.conf", "r"); data/c-ares-1.17.1/src/lib/ares_init.c:2013: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 lookups[3], *l; data/c-ares-1.17.1/src/lib/ares_init.c:2052:52: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 int ares_ipv6_subnet_matches(const unsigned char netbase[16], data/c-ares-1.17.1/src/lib/ares_init.c:2053:46: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 netmask, data/c-ares-1.17.1/src/lib/ares_init.c:2054:52: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 ipaddr[16]) data/c-ares-1.17.1/src/lib/ares_init.c:2056: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 mask[16] = { 0 }; data/c-ares-1.17.1/src/lib/ares_init.c:2080:56: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 int ares_ipv6_server_blacklisted(const unsigned char ipaddr[16]) data/c-ares-1.17.1/src/lib/ares_init.c:2084:20: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 netbase[16]; data/c-ares-1.17.1/src/lib/ares_init.c:2171: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(&newserv[*nservers].addr.addrV4, &host.addrV4, data/c-ares-1.17.1/src/lib/ares_init.c:2174: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(&newserv[*nservers].addr.addrV6, &host.addrV6, data/c-ares-1.17.1/src/lib/ares_init.c:2196: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 ipbuf[16], ipbufpfx[32]; data/c-ares-1.17.1/src/lib/ares_init.c:2201: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(ipbuf, str, q-str); data/c-ares-1.17.1/src/lib/ares_init.c:2209:11: [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(ipbufpfx, str, q-str); data/c-ares-1.17.1/src/lib/ares_init.c:2248:15: [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(ipbuf, str, q-str); data/c-ares-1.17.1/src/lib/ares_init.c:2474:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *f = fopen(RANDOM_FILE, "rb"); data/c-ares-1.17.1/src/lib/ares_options.c:182: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(&channel->servers[i].addr.addrV4, &srvr->addrV4, data/c-ares-1.17.1/src/lib/ares_options.c:185: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(&channel->servers[i].addr.addrV6, &srvr->addrV6, data/c-ares-1.17.1/src/lib/ares_options.c:234: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(&channel->servers[i].addr.addrV4, &srvr->addrV4, data/c-ares-1.17.1/src/lib/ares_options.c:237: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(&channel->servers[i].addr.addrV6, &srvr->addrV6, data/c-ares-1.17.1/src/lib/ares_options.c:348: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(&s->addr, &in6, sizeof(struct ares_in6_addr)); data/c-ares-1.17.1/src/lib/ares_options.c:358: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(&s->addr, &in4, sizeof(struct in_addr)); data/c-ares-1.17.1/src/lib/ares_parse_a_reply.c:165:15: [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(hostent->h_addr_list[i], data/c-ares-1.17.1/src/lib/ares_parse_a_reply.c:175:19: [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(&addrttls[i].ipaddr, data/c-ares-1.17.1/src/lib/ares_parse_aaaa_reply.c:167:15: [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(hostent->h_addr_list[i], data/c-ares-1.17.1/src/lib/ares_parse_aaaa_reply.c:177:21: [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(&addrttls[i].ip6addr, data/c-ares-1.17.1/src/lib/ares_parse_caa_reply.c:156:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((char *) caa_curr->property, strptr, caa_curr->plength); data/c-ares-1.17.1/src/lib/ares_parse_caa_reply.c:173:11: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((char *) caa_curr->value, strptr, caa_curr->length); data/c-ares-1.17.1/src/lib/ares_parse_ptr_reply.c:198:23: [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(hostent->h_addr_list[0], addr, addrlen); data/c-ares-1.17.1/src/lib/ares_parse_txt_reply.c:165:15: [2] (buffer) memcpy: Does not check for buffer overflows when copying to destination (CWE-120). Make sure destination can always hold the source data. memcpy ((char *) txt_curr->txt, strptr, substr_len); data/c-ares-1.17.1/src/lib/ares_private.h:168: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 tcp_lenbuf[2]; data/c-ares-1.17.1/src/lib/ares_private.h:262: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 state[256]; data/c-ares-1.17.1/src/lib/ares_private.h:288: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 local_dev_name[32]; data/c-ares-1.17.1/src/lib/ares_private.h:290: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 local_ip6[16]; data/c-ares-1.17.1/src/lib/ares_process.c:467: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 buf[MAXENDSSZ + 1]; data/c-ares-1.17.1/src/lib/ares_process.c:1033: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(&local.sa6.sin6_addr, channel->local_ip6, data/c-ares-1.17.1/src/lib/ares_process.c:1066: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(&saddr.sa4.sin_addr, &server->addr.addrV4, data/c-ares-1.17.1/src/lib/ares_process.c:1079: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(&saddr.sa6.sin6_addr, &server->addr.addrV6, data/c-ares-1.17.1/src/lib/ares_process.c:1179: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(&saddr.sa4.sin_addr, &server->addr.addrV4, data/c-ares-1.17.1/src/lib/ares_process.c:1192: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(&saddr.sa6.sin6_addr, &server->addr.addrV6, data/c-ares-1.17.1/src/lib/ares_process.c:1471:20: [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(sendreq->data_storage, sendreq->data, sendreq->len); data/c-ares-1.17.1/src/lib/ares_search.c:222: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(*s, name, nlen); data/c-ares-1.17.1/src/lib/ares_search.c:224: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(*s + nlen + 1, domain, dlen); data/c-ares-1.17.1/src/lib/ares_search.c:259:16: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). fp = fopen(hostaliases, "r"); data/c-ares-1.17.1/src/lib/ares_search.c:279:27: [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(*s, p, q - p); data/c-ares-1.17.1/src/lib/ares_send.c:89: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(query->tcpbuf + 2, qbuf, qlen); data/c-ares-1.17.1/src/lib/ares_strdup.c:41: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(s2, s1, sz * sizeof(char)); data/c-ares-1.17.1/src/lib/ares_writev.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 (bp, iov[i].iov_base, iov[i].iov_len); data/c-ares-1.17.1/src/lib/bitncmp.c:46:25: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. lb = ((const unsigned char *)l)[b]; data/c-ares-1.17.1/src/lib/bitncmp.c:47:25: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. rb = ((const unsigned char *)r)[b]; data/c-ares-1.17.1/src/lib/inet_net_pton.c:274: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 tmp[NS_IN6ADDRSZ], *tp, *endp, *colonp; data/c-ares-1.17.1/src/lib/inet_net_pton.c: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(dst, tmp, bytes); data/c-ares-1.17.1/src/lib/inet_ntop.c:91: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[sizeof("255.255.255.255")]; data/c-ares-1.17.1/src/lib/inet_ntop.c: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[sizeof("ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255")]; data/c-ares-1.17.1/src/lib/inet_ntop.c:180:11: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. tp += sprintf(tp, "%x", words[i]); data/c-ares-1.17.1/src/tools/acountry.c:158: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[100]; data/c-ares-1.17.1/src/tools/acountry.c:228: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[20]; data/c-ares-1.17.1/src/tools/acountry.c:260: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(addr, host->h_addr, sizeof(*addr)); data/c-ares-1.17.1/src/tools/acountry.c:265: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. char short_name[3]; /* A2 short country code */ data/c-ares-1.17.1/src/tools/acountry.c:569: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 ccode_A2[3], *ccopy, *dot_4; data/c-ares-1.17.1/src/tools/adig.c:552: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 addr[46]; data/c-ares-1.17.1/src/tools/adig.c:854:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 new_name [MAX_IP6_RR]; data/c-ares-1.17.1/src/tools/adig.c:897:10: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy (c, "].IP6.ARPA"); data/c-ares-1.17.1/src/tools/adig.c:910:10: [2] (buffer) strcpy: Does not check for buffer overflows when copying to destination [MS-banned] (CWE-120). Consider using snprintf, strcpy_s, or strlcpy (warning: strncpy easily misused). Risk is low because the source is a constant string. strcpy (c, "IP6.ARPA"); data/c-ares-1.17.1/src/tools/ahost.c:190: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 addr_buf[46] = "??"; data/c-ares-1.17.1/test/ares-fuzz.c:18:17: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 afl_buffer[kMaxAflInputSize]; data/c-ares-1.17.1/test/ares-fuzz.c:38: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(copied_data, afl_buffer, count); data/c-ares-1.17.1/test/ares-fuzz.c:53: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 fd = open(argv[ii], O_RDONLY); data/c-ares-1.17.1/test/ares-test-fuzz-name.c:15: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(name, data, size); data/c-ares-1.17.1/test/ares-test-fuzz.c:22: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 addrv4[4] = {0x10, 0x20, 0x30, 0x40}; data/c-ares-1.17.1/test/ares-test-internal.cc:260:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *fp = fopen(temp.filename(), "r"); data/c-ares-1.17.1/test/ares-test-internal.cc:280:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *fp = fopen(temp.filename(), "r"); data/c-ares-1.17.1/test/ares-test-internal.cc:308:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *fp = fopen(hostsfile.filename(), "r"); data/c-ares-1.17.1/test/ares-test-internal.cc:346:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *fp = fopen(hostsfile.filename(), "r"); data/c-ares-1.17.1/test/ares-test-internal.cc:447:14: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *fp = fopen(hostsfile.filename(), "r"); data/c-ares-1.17.1/test/ares-test-live.cc:17:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 gdns_addr4[4] = {0x08, 0x08, 0x08, 0x08}; data/c-ares-1.17.1/test/ares-test-live.cc:18:10: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (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 gdns_addr6[16] = {0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, data/c-ares-1.17.1/test/ares-test-live.cc:245: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 addr[4] = {8, 8, 8, 8}; data/c-ares-1.17.1/test/ares-test-live.cc:254: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 addr[4] = {8, 8, 8, 8}; data/c-ares-1.17.1/test/ares-test-live.cc:263: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 addr[4] = {8, 8, 8, 8}; data/c-ares-1.17.1/test/ares-test-live.cc:400: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(sockaddr.sin6_addr.s6_addr, gdns_addr6, 16); data/c-ares-1.17.1/test/ares-test-live.cc:416: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(sockaddr.sin6_addr.s6_addr, gdns_addr6, 16); data/c-ares-1.17.1/test/ares-test-live.cc:449: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(sockaddr.sin6_addr.s6_addr, gdns_addr6, 16); data/c-ares-1.17.1/test/ares-test-live.cc:466: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 addr6[16] = {0xfe, 0x80, 0x01, 0x02, 0x01, 0x02, 0x00, 0x00, data/c-ares-1.17.1/test/ares-test-live.cc:468: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(sockaddr.sin6_addr.s6_addr, addr6, 16); data/c-ares-1.17.1/test/ares-test-live.cc:520: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 addr6[16] = {0x20, 0x01, 0x0d, 0xb8, 0x01, 0x02, 0x00, 0x00, data/c-ares-1.17.1/test/ares-test-live.cc:522: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(sockaddr.sin6_addr.s6_addr, addr6, 16); data/c-ares-1.17.1/test/ares-test-live.cc:539: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(sockaddr.sin6_addr.s6_addr, gdns_addr6, 16); data/c-ares-1.17.1/test/ares-test-live.cc:554: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(sockaddr.sin6_addr.s6_addr, gdns_addr6, 16); data/c-ares-1.17.1/test/ares-test-main.cc:13:31: [2] (integer) atoi: Unless checked, the resulting number can exceed the expected range (CWE-190). If source untrusted, check both minimum and maximum, even if the input had no minus sign (large numbers can roll over into negative number; consider saving to an unsigned value if that is intended). ares::test::mock_port = atoi(argv[ii]); data/c-ares-1.17.1/test/ares-test-misc.cc:161: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[256]; data/c-ares-1.17.1/test/ares-test-misc.cc:301: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 buf[2]; data/c-ares-1.17.1/test/ares-test-mock.cc:955: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 gdns_addr4[4] = {0x08, 0x08, 0x08, 0x08}; data/c-ares-1.17.1/test/ares-test-ns.cc:68: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[PATH_MAX + 1]; data/c-ares-1.17.1/test/ares-test-ns.cc:125: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(mapfile.c_str(), O_CREAT|O_WRONLY|O_TRUNC, 0644); data/c-ares-1.17.1/test/ares-test-ns.cc:166: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[PATH_MAX + 1]; data/c-ares-1.17.1/test/ares-test.cc:454: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 *domains[3] = {"first.com", "second.org", "third.gov"}; data/c-ares-1.17.1/test/ares-test.cc:765:13: [2] (misc) fopen: Check when opening files - can an attacker redirect it (via symlinks), force the opening of special file type (e.g., device files), move things around to create a race condition, control its ancestors, or change its contents? (CWE-362). FILE *f = fopen(filename.c_str(), "w"); data/c-ares-1.17.1/test/dns-dump.cc:17: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(filename, O_RDONLY); data/c-ares-1.17.1/test/dns-dump.cc:24: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 buffer[1024]; data/c-ares-1.17.1/test/dns-proto.cc:18: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[2 + 1]; data/c-ares-1.17.1/test/dns-proto.cc:19:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buffer, "%02x", data[ii]); data/c-ares-1.17.1/test/dns-proto.cc:161:5: [2] (buffer) char: Statically-sized arrays can be improperly restricted, leading to potential overflows or other issues (CWE-119!/CWE-120). Perform bounds checking, use functions that limit length, or ensure that the size is larger than the maximum possible length. char buffer[4*4 + 3 + 1]; data/c-ares-1.17.1/test/dns-proto.cc:162:5: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buffer, "%u.%u.%u.%u", data/c-ares-1.17.1/test/dns-proto.cc:171: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 buffer[4 + 1]; data/c-ares-1.17.1/test/dns-proto.cc:172:7: [2] (buffer) sprintf: Does not check for buffer overflows (CWE-120). Use sprintf_s, snprintf, or vsnprintf. Risk is low because the source has a constant maximum length. sprintf(buffer, "%02x%02x", (unsigned char)addr[ii], (unsigned char)addr[ii+1]); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:2310:7: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_ACP, 0, ansi, length, data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:2313:3: [2] (buffer) MultiByteToWideChar: Requires maximum length in CHARACTERS, not bytes (CWE-120). MultiByteToWideChar(CP_ACP, 0, ansi, length, data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:3128: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 error_text[kBufSize] = { '\0' }; data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:3212: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 str[5]; // Big enough for the largest valid code point. data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:7155: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[256]; data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:7571: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 executable_path[_MAX_PATH + 1]; // NOLINT data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:7857:22: [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 cwd_fd = open(".", O_RDONLY); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:8273: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 cwd[GTEST_PATH_MAX_ + 1] = { '\0' }; data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:8276: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 cwd[GTEST_PATH_MAX_ + 1] = { '\0' }; data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:8688: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). const int fd = open("/proc/self/as", O_RDONLY); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:9414: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(buffer, regex, len); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:9487: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 temp_dir_path[MAX_PATH + 1] = { '\0' }; // NOLINT data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:9488: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 temp_file_path[MAX_PATH + 1] = { '\0' }; // NOLINT data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:9525:29: [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). const int captured_fd = mkstemp(name_template); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:9871: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 text[5] = ""; data/c-ares-1.17.1/test/gmock-1.8.0/gtest/gtest.h:3643:10: [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). return fopen(path, mode); data/c-ares-1.17.1/src/lib/ares__read_line.c:51:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = offset + strlen(*buf + offset); data/c-ares-1.17.1/src/lib/ares_android.c:333:5: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(dns_list[i], ch_server_address, 64); data/c-ares-1.17.1/src/lib/ares_create_query.c:109:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(name) + 2 + HFIXEDSZ + QFIXEDSZ + data/c-ares-1.17.1/src/lib/ares_expand_string.c:61:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((char *)q, (char *)encoded, elen.uns); data/c-ares-1.17.1/src/lib/ares_getaddrinfo.c:762:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t nname = strlen(hquery->name); data/c-ares-1.17.1/src/lib/ares_gethostbyaddr.c:286: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). sprintf(name+strlen(name), data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:339:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). name_len = strlen(name); data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:406:10: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). bufl = strlen(buf); data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:408:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if(bufl + strlen(tmpbuf) < buflen) data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:419: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). size_t s1_len = strlen(s1), s2_len = strlen(s2); data/c-ares-1.17.1/src/lib/ares_getnameinfo.c:419:40: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t s1_len = strlen(s1), s2_len = strlen(s2); data/c-ares-1.17.1/src/lib/ares_init.c:286:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy((*dest)->local_dev_name, src->local_dev_name, data/c-ares-1.17.1/src/lib/ares_init.c:845: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). newsize = len + (*dst ? (strlen(*dst) + 2) : 1); data/c-ares-1.17.1/src/lib/ares_init.c:852:7: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if (strlen(*dst) != 0) data/c-ares-1.17.1/src/lib/ares_init.c:853:5: [1] (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 character. strcat(*dst, ","); data/c-ares-1.17.1/src/lib/ares_init.c:854:3: [1] (buffer) strncat: Easily used incorrectly (e.g., incorrectly computing the correct maximum size to add) [MS-banned] (CWE-120). Consider strcat_s, strlcat, snprintf, or automatically resizing strings. strncat(*dst, src, len); data/c-ares-1.17.1/src/lib/ares_init.c:864:24: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). commanjoin(dst, src, strlen(src)); data/c-ares-1.17.1/src/lib/ares_init.c:2330: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). size_t len = strlen(opt); data/c-ares-1.17.1/src/lib/ares_init.c:2374:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). if ((len = strlen(opt)) == 0) data/c-ares-1.17.1/src/lib/ares_init.c:2538:3: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(channel->local_dev_name, local_dev_name, data/c-ares-1.17.1/src/lib/ares_options.c:267:7: [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). i = strlen(_csv); data/c-ares-1.17.1/src/lib/ares_parse_ns_reply.c:126:50: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). nameservers[nameservers_num] = ares_malloc(strlen(rr_data)+1); data/c-ares-1.17.1/src/lib/ares_parse_ptr_reply.c:128:25: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). rr_data_len = strlen(rr_data)+1; data/c-ares-1.17.1/src/lib/ares_parse_ptr_reply.c:136:11: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). strncpy(aliases[aliascnt], rr_data, rr_data_len); data/c-ares-1.17.1/src/lib/ares_platform.c:11003:15: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). switch (strlen(proto)) { data/c-ares-1.17.1/src/lib/ares_search.c:216:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t nlen = strlen(name); data/c-ares-1.17.1/src/lib/ares_search.c:217:17: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). size_t dlen = strlen(domain); data/c-ares-1.17.1/src/lib/ares_search.c:235: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). size_t len = strlen(name); data/c-ares-1.17.1/src/lib/ares_strdup.c:35:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). sz = strlen(s1); data/c-ares-1.17.1/src/lib/ares_strsplit.c:26:9: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). len = strlen(str); data/c-ares-1.17.1/src/lib/ares_strsplit.c:90:12: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). in_len = strlen(in); data/c-ares-1.17.1/src/lib/ares_strsplit.c:91: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). num_delims = strlen(delms); data/c-ares-1.17.1/src/lib/inet_ntop.c:177:13: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). tp += strlen(tp); data/c-ares-1.17.1/src/lib/setup_once.h:134:36: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). #define sread(x,y,z) (ares_ssize_t)read((RECV_TYPE_ARG1)(x), \ data/c-ares-1.17.1/test/ares-fuzz.c:32:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int count = read(fd, afl_buffer, kMaxAflInputSize); data/c-ares-1.17.1/test/ares-test-mock.cc:728: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). SetAllocSizeFail(strlen("1.2.3.4") + 1); data/c-ares-1.17.1/test/ares-test-ns.cc:41:5: [1] (obsolete) usleep: This C routine is considered obsolete (as opposed to the shell command by the same name). The interaction of this function with SIGALRM and other timer functions such as sleep(), alarm(), setitimer(), and nanosleep() is unspecified (CWE-676). Use nanosleep(2) or setitimer(2) instead. usleep(100000); data/c-ares-1.17.1/test/ares-test.h:369:14: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). buf_size = strlen(name) + strlen(value) + 1 /* = */ + 1 /* NULL */; data/c-ares-1.17.1/test/ares-test.h:369: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). buf_size = strlen(name) + strlen(value) + 1 /* = */ + 1 /* NULL */; data/c-ares-1.17.1/test/dns-dump.cc:25:15: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). int len = read(fd, buffer, sizeof(buffer)); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:2308:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const int length = strlen(ansi); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:3273:34: [1] (buffer) wcslen: 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). num_chars = static_cast<int>(wcslen(str)); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:5046: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). segment = next_segment + strlen("]]>"); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:5211:18: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). result.reserve(strlen(str) + 1); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:6450: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 size_t prefix_len = strlen(prefix); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:9148: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). const size_t full_regex_len = strlen(regex) + 10; data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:9402:22: [1] (buffer) strlen: Does not handle strings that are not \0-terminated; if given one it may perform an over-read (it could cause a crash if unprotected) (CWE-126). const size_t len = strlen(regex); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:9614: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). else if (temp_dir[strlen(temp_dir) - 1] == '\\') data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:10131: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). PrintCharsAsStringTo(s, strlen(s), os); data/c-ares-1.17.1/test/gmock-1.8.0/gmock-gtest-all.cc:10148:34: [1] (buffer) wcslen: 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). PrintCharsAsStringTo(s, std::wcslen(s), os); data/c-ares-1.17.1/test/gmock-1.8.0/gtest/gtest.h:3632:10: [1] (buffer) strncpy: Easily used incorrectly; doesn't always \0-terminate or check for invalid pointers [MS-banned] (CWE-120). return strncpy(dest, src, n); data/c-ares-1.17.1/test/gmock-1.8.0/gtest/gtest.h:3654:27: [1] (buffer) read: Check buffer boundaries if used in a loop including recursive loops (CWE-120, CWE-20). return static_cast<int>(read(fd, buf, count)); ANALYSIS SUMMARY: Hits = 290 Lines analyzed = 89257 in approximately 2.54 seconds (35146 lines/second) Physical Source Lines of Code (SLOC) = 64157 Hits@level = [0] 169 [1] 52 [2] 184 [3] 30 [4] 20 [5] 4 Hits@level+ = [0+] 459 [1+] 290 [2+] 238 [3+] 54 [4+] 24 [5+] 4 Hits/KSLOC@level+ = [0+] 7.15432 [1+] 4.52016 [2+] 3.70965 [3+] 0.841685 [4+] 0.374082 [5+] 0.0623471 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.