In the event that ares_destroy() is called prior to ares_getaddrinfo() completing,
it would result in an invalid read and double-free due to calling end_hquery() twice.
Reported By: Jann Horn @ Google Project Zero
Fixes the following compatibility issues:
* Use RegQueryValueExA instead of RegQueryValueEx
* Use ExpandEnvironmentStringsA instead of ExpandEnvironmentStrings
* Use RegOpenKeyExA instead of RegOpenKeyExA
* Use GetWindowsDirectoryA instead of GetWindowsDirectoryA
Fix By: Shelley Vohr (@codebytere)
Closes: #327
Create a macro to silence false cast-align warnings when casting
struct sockaddr * to struct sockaddr_in * and struct sockaddr_in6 *.
Fix By: Brad House (@bradh352)
Some DNS servers intentionally "misuse" the obsoleted CHAOS (CH) qclass to provide things like `version.bind`, `version.server`, `authors.bind`, `hostname.bind` and `id.server`.
C-ares was not allowing such use cases.
Fix By: Teemu R. (@rytilahti)
OSS-Fuzz has reported a double-free with the fuzzer input file
included here; run with:
./test/aresfuzz test/fuzzinput/clusterfuzz-5637790584012800
Bisecting the failure points to commit e0517f97d9 ("Parse SOA records
from ns_t_any response (#103)")
Tests require linking against the static library on Windows otherwise the symbols are not exported for internals being tested.
Fix By: Brad House (@bradh352)
Replace usage of inet_addr() with ares_inet_pton() which is more appropriate and fixes issues with legitimate addresses like 255.255.255.0. IPv6 already used this.
Fixes#309
Fix By: Brad House (@bradh352)
Build and Install PDB (Windows Debug Symbol) files if supported by underlying system.
Also update AppVeyor to test cmake builds.
Fixes#245
Fix By: Piotr Pietraszkiewicz (@ppietrasa) and Brad House (@bradh352)
CHECK_LIBRARY_EXISTS(), while it takes a function name, does not actually verify the function exists in the library being evaluated. Instead, if the function is found in any dependent library, and the referenced library also exists, it returns true. This is not desirable.
Wrap with a Macro to change the behavior.
Fixes: #307
Fix By: Brad House (@bradh352)
Added the capability of parsing SOA record from a response buffer of ns_t_any type query, this implementation doesn't interfere with existing T_SOA query's response as that too is treated as a list of records. The function returns ARES_EBADRESP if no SOA record is found(as per RFC).
The basic idea of sticking to RFC that a ns_t_any too should return an SOA record is something open for discussion but I have kept the functionality intact as it was previously i.e the function returns ARES_EBADRESP if it doesn't find a SOA record regardless of which response it is parsing i.e. T_SOA or T_ANY.
Note that asking for T_ANY is generally a bad idea:
- https://blog.cloudflare.com/what-happened-next-the-deprecation-of-any/
- https://tools.ietf.org/html/draft-ietf-dnsop-refuse-any
Bug: #102
Fix By: Dron Rathore (@DronRathore)
Added CPack functionality for generating RPM or DEB packages
ie: run `cpack -G RPM` (or "DEB") after building with CMake.
The current configuration creates 3 separate packages for the shared library,
the development files and the tools.
Fix By: Stephen Bryant (@bf-bryants)
ares_gethostbyname() was returning ESUCCESS when no A or AAAA record was found but a CNAME pointing nowhere was present. ENODATA should be returned instead, however the hosts pointer will still be present to provide the alias list.
* Return ENODATA if no valid A or AAAA record found
* Fix and update test ParseAReplyNoData.
* Add test for new ENODATA behaviour in ares_gethostbyname.
Fixes Bug #303
Fix By: @tjwalton
Before this change, SetServers, SetServersPorts and SetServersCSV
contained test cases trying to make DNS queries with the google.com
hostname, which requires Internet connectivity. Tests with that
requirement should be defined in the ares-test-live.cc file and contain
"Live" prefix to filter them out with `--gtest_filter=-*.Live*` on
machines without Internet connectivity.
Fix By: Michal Rostecki (@mrostecki)
When ares_parse_a_reply or ares_parse_aaaa_reply is called in case
where another AAAA and A responses exist, the resulting ares_addrttl
count is invalid and the structure points to gibberish.
This is a regression since 1.15.
Issue: https://github.com/c-ares/c-ares/issues/300
Fix By: Adam Majer (@AdamMajer)
* Add CARES_BUILD_CONTAINER_TESTS CMake option to add ability to build the Linux-only containerized tests.
* Accept invalid /etc/resolv.conf lookup values
Before this commit invalid `lookup` values resulted in c-ares not using
any lookups without any clear indication why. After this commit it uses
the default "fb".
Fix By: Ben Noordhuis (@bnoordhuis)
A and AAAA lookups for ares_getaddrinfo() are now performed in parallel.
For this change `ares_search` was removed from `ares_getaddrinfo`.
Instead `ares_query` in combination with `next_dns_lookup` are
doing the suffix search.
Adding support for `.onion` addresses which are tested by
`TEST_F(DefaultChannelTest, GetAddrinfoOnionDomain)`
Fix By: Christian Ammer (@ChristianAmmer)
7e6af8e inserted the documentation of resolvconf_path in the middle of
the item for ednspsz, leading to broken layout. Fix that.
Fix By: Peter Eisentraut (@petere)
The const AddrInfo& argument to operator<< overload for AddrInfo can be
a nullptr unique_ptr. Handle this explicitly by printing {nullptr} if
the rest of the function cannot be safely executed.
Fix-by: Dan Noé <dpn@google.com>