| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bc7da0c commit cc11464
9 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,11 +7,11 @@ | |||
| 7 | 7 | ||
| 8 | 8 | #define ARES_VERSION_MAJOR 1 | |
| 9 | 9 | #define ARES_VERSION_MINOR 16 | |
| 10 | - #define ARES_VERSION_PATCH 0 | ||
| 10 | + #define ARES_VERSION_PATCH 1 | ||
| 11 | 11 | #define ARES_VERSION ((ARES_VERSION_MAJOR<<16)|\ | |
| 12 | 12 | (ARES_VERSION_MINOR<<8)|\ | |
| 13 | 13 | (ARES_VERSION_PATCH)) | |
| 14 | - #define ARES_VERSION_STR "1.16.0" | ||
| 14 | + #define ARES_VERSION_STR "1.16.1" | ||
| 15 | 15 | ||
| 16 | 16 | #if (ARES_VERSION >= 0x010700) | |
| 17 | 17 | # define CARES_HAVE_ARES_LIBRARY_INIT 1 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,85 +1,30 @@ | |||
| 1 | - c-ares version 1.16.0 | ||
| 1 | + c-ares version 1.16.1 | ||
| 2 | + | ||
| 3 | + Security: | ||
| 4 | + o Prevent possible use-after-free and double-free in ares_getaddrinfo() if | ||
| 5 | + ares_destroy() is called prior to ares_getaddrinfo() completing. Reported | ||
| 6 | + by Jann Horn at Google Project Zero. | ||
| 2 | 7 | ||
| 3 | 8 | Changes: | |
| 4 | - o Introduction of ares_getaddrinfo() API which provides similar output | ||
| 5 | - (including proper sorting as per RFC 6724) to the system native API, but | ||
| 6 | - utilizes different data structures in order to provide additional information | ||
| 7 | - such as TTLs and all aliases. Please reference the respective man pages for | ||
| 8 | - usage details. [3] [4] [5] [7] [8] [13] [14] [15] [16] [17] [22] | ||
| 9 | - o Parse SOA records from ns_t_any response [29] [30] | ||
| 10 | - o CMake: Provide c-ares version in package export file [24] | ||
| 11 | - o CMake: Add CPACK functionality for DEB and RPM [28] | ||
| 12 | - o CMake: Generate PDB files during build [33] [34] | ||
| 13 | - o CMake: Support manpage installation [37] [38] | ||
| 9 | + o Allow TXT records on CHAOS qclass. Used for retriving things like | ||
| 10 | + version.bind, version.server, authoris.bind, hostname.bind, and id.server. | ||
| 11 | + [3] | ||
| 14 | 12 | ||
| 15 | 13 | Bug fixes: | |
| 16 | - o Fix bad expectation in IPv6 localhost test. [1] [2] | ||
| 17 | - o AutoTools: use XC_CHECK_BUILD_FLAGS instead of XC_CHECK_USER_FLAGS to prevent | ||
| 18 | - complaints about CPPFLAGS in CFLAGS. [6] | ||
| 19 | - o Fix .onion handling | ||
| 20 | - o Command line usage was out of date for adig and ahost. [18] | ||
| 21 | - o Typos in manpages [19] [20] | ||
| 22 | - o If ares_getenv is defined, it must return a value on all platforms [21] | ||
| 23 | - o If /etc/resolv.conf has invalid lookup values, use the defaults. [23] | ||
| 24 | - o Tests: Separate live tests from SetServers* tests as only live tests should | ||
| 25 | - require internet access. [25] | ||
| 26 | - o ares_gethostbyname() should return ENODATA if no valid A or AAAA record is | ||
| 27 | - found, but a CNAME was found. [26] [27] | ||
| 28 | - o CMake: Rework library function checking to prevent unintended linking with | ||
| 29 | - system libraries that aren't needed. [31] [32] | ||
| 30 | - o Due to use of inet_addr() it was not possible to return 255.255.255.255 from | ||
| 31 | - ares_gethostbyname(). [35] [36] | ||
| 32 | - o CMake: Fix building of tests on Windows | ||
| 14 | + o Fix Windows Unicode incompatibilities with ares_getaddrinfo() [1] | ||
| 15 | + o Silence false cast-align compiler warnings due to valid casts of | ||
| 16 | + struct sockaddr to struct sockaddr_in and struct sockaddr_in6. | ||
| 17 | + o MacOS should use libresolv for retrieving DNS servers, like iOS | ||
| 18 | + o CMake build system should populate the INCLUDE_DIRECTORIES property of | ||
| 19 | + installed targets [2] | ||
| 20 | + o Correct macros in use for the ares_getaddrinfo.3 man page | ||
| 33 | 21 | ||
| 34 | 22 | Thanks go to these friendly people for their efforts and contributions: | |
| 35 | - Abhishek Arya (@inferno-chromium), Adam Majer (@AdamMajer), | ||
| 36 | - Andrew Selivanov (@ki11roy), Ben Noordhuis (@bnoordhuis), | ||
| 37 | - Brad House (@bradh352), Christian Ammer (@ChristianAmmer), Dan Noé (@dnoe), | ||
| 38 | - Daniel Stenberg (@bagder), Darrin Cullop (@dwcullop), | ||
| 39 | - Dron Rathore (@DronRathore), Fabrice Fontaine (@ffontaine), | ||
| 40 | - Gregor Jasny (@gjasny), @kedixa, Khaidi Chu (@XadillaX), | ||
| 41 | - Kyle Edwards (@KyleFromKitware), @lifenjoiner, Michal Rostecki (@mrostecki), | ||
| 42 | - Peter Eisentraut (@petere), Piotr Pietraszkiewicz (@ppietrasa), | ||
| 43 | - Stephen Bryant (@bf-bryants), @tjwalton, Vy Nguyen (@oontvoo) | ||
| 44 | - (22 contributors) | ||
| 23 | + Brad House (@bradh352), Daniel Stenberg (@bagder), Dmitry Igrishin (@dmitigr), | ||
| 24 | + Jann Horn, Shelly Vohr, Teemu R (@rytilahti) | ||
| 25 | + (6 contributors) | ||
| 45 | 26 | ||
| 46 | 27 | References to bug reports and discussions on issues: | |
| 47 | - [1] = https://github.com/c-ares/c-ares/pull/227 | ||
| 48 | - [2] = https://github.com/c-ares/c-ares/issues/85 | ||
| 49 | - [3] = https://github.com/c-ares/c-ares/pull/112 | ||
| 50 | - [4] = https://github.com/c-ares/c-ares/pull/233 | ||
| 51 | - [5] = https://github.com/c-ares/c-ares/pull/234 | ||
| 52 | - [6] = https://github.com/c-ares/c-ares/pull/236 | ||
| 53 | - [7] = https://github.com/c-ares/c-ares/pull/235 | ||
| 54 | - [8] = https://github.com/c-ares/c-ares/pull/239 | ||
| 55 | - [9] = https://github.com/c-ares/c-ares/pull/241 | ||
| 56 | - [10] = https://github.com/c-ares/c-ares/pull/187 | ||
| 57 | - [11] = https://github.com/c-ares/c-ares/pull/252 | ||
| 58 | - [12] = https://github.com/c-ares/c-ares/issues/251 | ||
| 59 | - [13] = https://github.com/c-ares/c-ares/pull/258 | ||
| 60 | - [14] = https://github.com/c-ares/c-ares/pull/257 | ||
| 61 | - [15] = https://github.com/c-ares/c-ares/pull/262 | ||
| 62 | - [16] = https://github.com/c-ares/c-ares/pull/264 | ||
| 63 | - [17] = https://github.com/c-ares/c-ares/pull/265 | ||
| 64 | - [18] = https://github.com/c-ares/c-ares/pull/256 | ||
| 65 | - [19] = https://github.com/c-ares/c-ares/pull/269 | ||
| 66 | - [20] = https://github.com/c-ares/c-ares/pull/275 | ||
| 67 | - [21] = https://github.com/c-ares/c-ares/pull/279 | ||
| 68 | - [22] = https://github.com/c-ares/c-ares/pull/290 | ||
| 69 | - [23] = https://github.com/c-ares/c-ares/pull/274 | ||
| 70 | - [24] = https://github.com/c-ares/c-ares/pull/296 | ||
| 71 | - [25] = https://github.com/c-ares/c-ares/pull/299 | ||
| 72 | - [26] = https://github.com/c-ares/c-ares/pull/304 | ||
| 73 | - [27] = https://github.com/c-ares/c-ares/issues/303 | ||
| 74 | - [28] = https://github.com/c-ares/c-ares/pull/283 | ||
| 75 | - [29] = https://github.com/c-ares/c-ares/pull/103 | ||
| 76 | - [30] = https://github.com/c-ares/c-ares/issues/102 | ||
| 77 | - [31] = https://github.com/c-ares/c-ares/pull/310 | ||
| 78 | - [32] = https://github.com/c-ares/c-ares/issues/307 | ||
| 79 | - [33] = https://github.com/c-ares/c-ares/pull/311 | ||
| 80 | - [34] = https://github.com/c-ares/c-ares/issues/245 | ||
| 81 | - [35] = https://github.com/c-ares/c-ares/issues/309 | ||
| 82 | - [36] = https://github.com/c-ares/c-ares/pull/312 | ||
| 83 | - [37] = https://github.com/c-ares/c-ares/issues/297 | ||
| 84 | - [38] = https://github.com/c-ares/c-ares/pull/314 | ||
| 85 | - | ||
| 28 | + [1] = https://github.com/c-ares/c-ares/pull/328 | ||
| 29 | + [2] = https://github.com/c-ares/c-ares/pull/323 | ||
| 30 | + [3] = https://github.com/c-ares/c-ares/pull/321 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -408,11 +408,11 @@ static void end_hquery(struct host_query *hquery, int status) | |||
| 408 | 408 | { | |
| 409 | 409 | if (next->ai_family == AF_INET) | |
| 410 | 410 | { | |
| 411 | - ((struct sockaddr_in *)next->ai_addr)->sin_port = htons(hquery->port); | ||
| 411 | + (CARES_INADDR_CAST(struct sockaddr_in *, next->ai_addr))->sin_port = htons(hquery->port); | ||
| 412 | 412 | } | |
| 413 | 413 | else | |
| 414 | 414 | { | |
| 415 | - ((struct sockaddr_in6 *)next->ai_addr)->sin6_port = htons(hquery->port); | ||
| 415 | + (CARES_INADDR_CAST(struct sockaddr_in6 *, next->ai_addr))->sin6_port = htons(hquery->port); | ||
| 416 | 416 | } | |
| 417 | 417 | next = next->ai_next; | |
| 418 | 418 | } | |
@@ -456,18 +456,18 @@ static int file_lookup(struct host_query *hquery) | |||
| 456 | 456 | char tmp[MAX_PATH]; | |
| 457 | 457 | HKEY hkeyHosts; | |
| 458 | 458 | ||
| 459 | - if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, | ||
| 459 | + if (RegOpenKeyExA(HKEY_LOCAL_MACHINE, WIN_NS_NT_KEY, 0, KEY_READ, | ||
| 460 | 460 | &hkeyHosts) == ERROR_SUCCESS) | |
| 461 | 461 | { | |
| 462 | 462 | DWORD dwLength = MAX_PATH; | |
| 463 | - RegQueryValueEx(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp, | ||
| 463 | + RegQueryValueExA(hkeyHosts, DATABASEPATH, NULL, NULL, (LPBYTE)tmp, | ||
| 464 | 464 | &dwLength); | |
| 465 | - ExpandEnvironmentStrings(tmp, PATH_HOSTS, MAX_PATH); | ||
| 465 | + ExpandEnvironmentStringsA(tmp, PATH_HOSTS, MAX_PATH); | ||
| 466 | 466 | RegCloseKey(hkeyHosts); | |
| 467 | 467 | } | |
| 468 | 468 | } | |
| 469 | 469 | else if (platform == WIN_9X) | |
| 470 | - GetWindowsDirectory(PATH_HOSTS, MAX_PATH); | ||
| 470 | + GetWindowsDirectoryA(PATH_HOSTS, MAX_PATH); | ||
| 471 | 471 | else | |
| 472 | 472 | return ARES_ENOTFOUND; | |
| 473 | 473 | ||
@@ -548,6 +548,7 @@ static void host_callback(void *arg, int status, int timeouts, | |||
| 548 | 548 | else if (status == ARES_EDESTRUCTION) | |
| 549 | 549 | { | |
| 550 | 550 | end_hquery(hquery, status); | |
| 551 | + return; | ||
| 551 | 552 | } | |
| 552 | 553 | ||
| 553 | 554 | if (!hquery->remaining) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -92,13 +92,13 @@ void ares_getnameinfo(ares_channel channel, const struct sockaddr *sa, | |||
| 92 | 92 | if ((sa->sa_family == AF_INET) && | |
| 93 | 93 | (salen == sizeof(struct sockaddr_in))) | |
| 94 | 94 | { | |
| 95 | - addr = (struct sockaddr_in *)sa; | ||
| 95 | + addr = CARES_INADDR_CAST(struct sockaddr_in *, sa); | ||
| 96 | 96 | port = addr->sin_port; | |
| 97 | 97 | } | |
| 98 | 98 | else if ((sa->sa_family == AF_INET6) && | |
| 99 | 99 | (salen == sizeof(struct sockaddr_in6))) | |
| 100 | 100 | { | |
| 101 | - addr6 = (struct sockaddr_in6 *)sa; | ||
| 101 | + addr6 = CARES_INADDR_CAST(struct sockaddr_in6 *, sa); | ||
| 102 | 102 | port = addr6->sin6_port; | |
| 103 | 103 | } | |
| 104 | 104 | else | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -163,7 +163,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, | |||
| 163 | 163 | { | |
| 164 | 164 | hostent->h_addr_list[i] = (char *)&addrs[i]; | |
| 165 | 165 | memcpy(hostent->h_addr_list[i], | |
| 166 | - &(((struct sockaddr_in *)next->ai_addr)->sin_addr), | ||
| 166 | + &(CARES_INADDR_CAST(struct sockaddr_in *, next->ai_addr)->sin_addr), | ||
| 167 | 167 | sizeof(struct in_addr)); | |
| 168 | 168 | if (naddrttls && i < *naddrttls) | |
| 169 | 169 | { | |
@@ -173,7 +173,7 @@ int ares_parse_a_reply(const unsigned char *abuf, int alen, | |||
| 173 | 173 | addrttls[i].ttl = next->ai_ttl; | |
| 174 | 174 | ||
| 175 | 175 | memcpy(&addrttls[i].ipaddr, | |
| 176 | - &(((struct sockaddr_in *)next->ai_addr)->sin_addr), | ||
| 176 | + &(CARES_INADDR_CAST(struct sockaddr_in *, next->ai_addr)->sin_addr), | ||
| 177 | 177 | sizeof(struct in_addr)); | |
| 178 | 178 | } | |
| 179 | 179 | ++i; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -165,7 +165,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, | |||
| 165 | 165 | { | |
| 166 | 166 | hostent->h_addr_list[i] = (char*)&addrs[i]; | |
| 167 | 167 | memcpy(hostent->h_addr_list[i], | |
| 168 | - &(((struct sockaddr_in6 *)next->ai_addr)->sin6_addr), | ||
| 168 | + &(CARES_INADDR_CAST(struct sockaddr_in6 *, next->ai_addr)->sin6_addr), | ||
| 169 | 169 | sizeof(struct ares_in6_addr)); | |
| 170 | 170 | if (naddrttls && i < *naddrttls) | |
| 171 | 171 | { | |
@@ -175,7 +175,7 @@ int ares_parse_aaaa_reply(const unsigned char *abuf, int alen, | |||
| 175 | 175 | addrttls[i].ttl = next->ai_ttl; | |
| 176 | 176 | ||
| 177 | 177 | memcpy(&addrttls[i].ip6addr, | |
| 178 | - &(((struct sockaddr_in6 *)next->ai_addr)->sin6_addr), | ||
| 178 | + &(CARES_INADDR_CAST(struct sockaddr_in6 *, next->ai_addr)->sin6_addr), | ||
| 179 | 179 | sizeof(struct ares_in6_addr)); | |
| 180 | 180 | } | |
| 181 | 181 | ++i; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -113,7 +113,7 @@ ares__parse_txt_reply (const unsigned char *abuf, int alen, | |||
| 113 | 113 | } | |
| 114 | 114 | ||
| 115 | 115 | /* Check if we are really looking at a TXT record */ | |
| 116 | - if (rr_class == C_IN && rr_type == T_TXT) | ||
| 116 | + if ((rr_class == C_IN || rr_class == C_CHAOS) && rr_type == T_TXT) | ||
| 117 | 117 | { | |
| 118 | 118 | /* | |
| 119 | 119 | * There may be multiple substrings in a single TXT record. Each | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -50,6 +50,11 @@ | |||
| 50 | 50 | #define STATIC_TESTABLE static | |
| 51 | 51 | #endif | |
| 52 | 52 | ||
| 53 | + /* By using a double cast, we can get rid of the bogus warning of | ||
| 54 | + * warning: cast from 'const struct sockaddr *' to 'const struct sockaddr_in6 *' increases required alignment from 1 to 4 [-Wcast-align] | ||
| 55 | + */ | ||
| 56 | + #define CARES_INADDR_CAST(type, var) ((type)((void *)var)) | ||
| 57 | + | ||
| 53 | 58 | #if defined(WIN32) && !defined(WATT32) | |
| 54 | 59 | ||
| 55 | 60 | #define WIN_NS_9X "System\\CurrentControlSet\\Services\\VxD\\MSTCP" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1337,13 +1337,13 @@ static int same_address(struct sockaddr *sa, struct ares_addr *aa) | |||
| 1337 | 1337 | { | |
| 1338 | 1338 | case AF_INET: | |
| 1339 | 1339 | addr1 = &aa->addrV4; | |
| 1340 | - addr2 = &((struct sockaddr_in *)sa)->sin_addr; | ||
| 1340 | + addr2 = &(CARES_INADDR_CAST(struct sockaddr_in *, sa))->sin_addr; | ||
| 1341 | 1341 | if (memcmp(addr1, addr2, sizeof(aa->addrV4)) == 0) | |
| 1342 | 1342 | return 1; /* match */ | |
| 1343 | 1343 | break; | |
| 1344 | 1344 | case AF_INET6: | |
| 1345 | 1345 | addr1 = &aa->addrV6; | |
| 1346 | - addr2 = &((struct sockaddr_in6 *)sa)->sin6_addr; | ||
| 1346 | + addr2 = &(CARES_INADDR_CAST(struct sockaddr_in6 *, sa))->sin6_addr; | ||
| 1347 | 1347 | if (memcmp(addr1, addr2, sizeof(aa->addrV6)) == 0) | |
| 1348 | 1348 | return 1; /* match */ | |
| 1349 | 1349 | break; | |
| Back | FazBrowse Home | New Git URL |
0 commit comments