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)
* fix leak if naddress of particular type found
* fix segfault when wanted ttls count lesser than count of result records
* add fuzzer input files that trigger problems (from #263)
Reported-By: David Drysdale (@daviddrysdale)
Fix-By: Andrew Selivanov (@ki11roy)
* Service support has been added to getaddrinfo.
* ares_parse_a/aaaa_record now share code with the addrinfo parser.
* Private ares_addrinfo structure with useful extensions such as ttls (including cname ttls),
as well as the ability to list multiple cnames in chain of lookups
Work By: Andrew Selivanov @ki11roy
Initial implementation for ares_getaddrinfo(). It is NOT compliant with RFC6724, though
it is expected to come closer to conformance prior to the next release.
Features not supported include sorted addresses and honoring of service and hints
parameters.
Implementation by: Christian Ammer (@ChristianAmmer)
Add a new ares_library_init_mem() initialization function for the
library which allows the library user to specify their own malloc,
realloc & free equivalents for use library-wide.
Store these function pointers in library-wide global variables,
defaulting to libc's malloc(), realloc() and free().
Change all calls to malloc, realloc and free to use the function pointer
instead. Also ensure that ares_strdup() is always available
(even if the local environment includes strdup(3)), and change the
library code to always use it.
Convert calls to calloc() to use ares_malloc() + memset
Add comments for the benefit of the lcov tool, marking
lines that cannot be hit. Typically these are fall-back
protection arms that are already covered by earlier checks,
and so it's not worth taking out the unhittable code (in case
someone changes the code between the two places in future).
ares_addr6ttl in order to prevent name space pollution, along with
necessary changes to code base and man pages.This change does not break
ABI, there is no need to recompile existing applications. But existing
applications using these structs with the old name will need source code
adjustments when recompiled using c-ares 1.6.1.
that is now used by the ares_parse_*_reply() functions instead of the
ares_expand_name() simply to easier return ARES_EBADRESP for the cases where
the name expansion fails as in responses that really isn't expected.
check for ssize_t to make it possible to use that when receiving the send()
error code. This is necessary to prevent compiler warnings on some systems.
- Made configure create config.h, and all source files now include setup.h that
might include the proper config.h (or a handicrafted alternative).
- Switched to 'ares_socket_t' type for sockets in ares, since Windows don't
use 'int' for that.
- automake-ified and libool-ified c-ares. Now it builds libcares as a shared
lib on most platforms if wanted. (This bloated the size of the release
archive with another 200K!)
- Makefile.am now uses Makefile.inc for the c sources, h headers and man
pages, to make it easier for other makefiles to use the exact same set of
files.
- Adjusted 'maketgz' to use the new automake magic when building distribution
archives.