1
0
mirror of https://frontier.innolan.net/rainlance/c-ares.git synced 2026-03-17 21:57:05 +00:00
Commit Graph

1561 Commits

Author SHA1 Message Date
bd2c61353f Free temporary variable in error path
Fix Coverity CID 56890

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2014-09-30 16:49:51 +01:00
7db1afd38f Fix integer shift overflow if both tcp_socket and udp_socket are set
The problem occurs if at the start of the loop the sockindex is at the
last valid ARES_GETSOCK_MAXNUM position. If then both udp_socket and
tcp_socket are valid, sockindex gets incremented for UDP first and
points one entry behind the array for the tcp block.
So the fix is to check after every increment of sockindex if it is still
valid.

Fix Coverity error CID 56878

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2014-09-30 16:49:49 +01:00
13dc4800b2 Null check before dereference
Fix Coverity error CID 56880

Signed-off-by: Gregor Jasny <gjasny@googlemail.com>
2014-09-30 16:49:46 +01:00
880ec44da9 Comment in ares_ipv6.h 2014-07-28 20:27:51 +02:00
ede0f84b8e CONTRIBUTING: add file to indicate mailing list is preferred 2014-07-25 09:28:46 +01:00
2bc07b2e74 Add -t u option to ahost
Add an option to allow specification of the AF_UNSPEC
address family.
2014-07-24 16:39:13 +01:00
c1fe47f6d9 host_callback: Fall back to AF_INET on searching with AF_UNSPEC
Previously, when an ares_gethostbyname() searched with AF_UNSPEC and the
first AF_INET6 call only returned CNAMEs, the host_callback never
retried AF_INET.

This patch makes sure than on ARES_SUCCESS, the result of AF_INET6 is
taken as authoritative only if the result contains some addresses.
2014-07-24 16:12:39 +02:00
943e79f4bf Move memset call below platform-specific declarations
A GitHub commenter [1] says that my recent change to ahost.c has
problems compiling on Windows + C89 platforms.

[1]  https://github.com/bagder/c-ares/commit/ee22246507c9#commitcomment-6587616
2014-07-23 18:03:45 +02:00
7aabbefab1 Update ahost man page to describe -s option.
Commit ee22246507 added the -s <domain> option to the
ahost command, but neglected to update the man page to
describe it.

Also fix typo in description of -t option.
2014-07-01 10:47:56 +02:00
09e64d7124 ares_parse_soa_reply: Do not leak rr_name on allocation failure
If ares_malloc_data failed, already allocated rr_name would go out of
scope.
2014-05-22 16:35:58 +02:00
7df69c0f79 Don't override explicitly specified search domains
Only set search domains from /etc/resolv.conf if there isn't a value
already present in the channel.
2014-05-22 16:24:24 +02:00
ee22246507 Allow specification of search domain in ahost
Add the "-s domain" command line option to override the search
domains.
2014-05-22 16:21:56 +02:00
0004f498dc Revert "ares_parse_aaaa_reply: fix leak when reply contains 1 alias and no address"
This reverts commit 440110b303.
2014-05-12 20:00:36 +02:00
440110b303 ares_parse_aaaa_reply: fix leak when reply contains 1 alias and no address 2014-05-07 13:47:22 +02:00
bc529dd0c2 ares_build.h: fix building on 64-bit powerpc
There are two issues.

1. gcc actually does not use __ppc__ and __ppc64__ but __PPC__ and
__PPC64__.  The tests of __ILP32__ and __LP64__ are sufficient for gcc.

2. clang defines __GNU__ and defines both __ppc64__ and __ppc__ when
targeting ppc64.  This makes CARES_SIZEOF_LONG to be 4 on a ppc64 system
when building with clang.

My patch is two change the order of the checks so that we check the
64-bit case first.
2014-02-16 22:54:45 +01:00
d5d3871335 refresh: updated now with automake 1.14 2013-11-15 23:52:39 +01:00
4aa1fc4163 single_domain: Invalid memory access for empty string input
We noticed a small buglet in ares_search() when it gets an empty string
as input -- the single_domain() utility function in ares_search.c
accesses invalid memory (before the start of the string).
2013-11-12 17:40:42 -08:00
c8ec633bf5 Fixed warning 'type specifier missing'. 2013-08-31 22:40:22 +02:00
83ab208e83 ares_rules.h: CARES_SIZEOF_LONG doesn't exist anymore, don't test for it
It was removed in f19387dd72
2013-08-30 23:03:07 +02:00
f19387dd72 nowarn: use <limits.h> instead of configure for size of long
This makes the header file much more multi-arch friendly and can be used
as-is with both 32 bit and 64 bit builds.
2013-08-27 13:36:41 +02:00
efdd616118 timeoffset: made static and private
ares__timeoffset() was only used once within this single source file
2013-08-27 13:06:57 +02:00
30c9031afa timeadd: make static
ares__timeadd() was only ever used from within the same source
2013-08-27 13:02:35 +02:00
742e234855 xc-am-iface.m4: comments refinement 2013-07-18 16:03:21 +02:00
68b3c67e61 configure: fix 'subdir-objects' distclean related issue
See XC_AMEND_DISTCLEAN comments for details.
2013-07-18 04:20:31 +02:00
d69ae9c6f8 configure: automake 1.14 compatibility tweak (use XC_AUTOMAKE) 2013-07-09 00:10:38 +02:00
9540d48184 xc-am-iface.m4: provide XC_AUTOMAKE macro 2013-07-09 00:07:27 +02:00
f8a2354016 gitignore: ignore all ares_*pdf but also CHANGES.dist 2013-05-12 16:10:47 +02:00
1c948a70b1 bump: start working towards 1.10.1 2013-05-12 16:09:32 +02:00
46fa9cad79 RELEASE-NOTES: two more bug fixes cares-1_10_0 2013-05-12 15:35:42 +02:00
09be3edf3a ares_set_servers_csv: fixed IPv6 address parsing
Fixed bug that caused the last part of an IPv6 address to be parsed as
the port number when the last part is all numeric.
2013-05-12 15:23:43 +02:00
03e2fd085c nroff: fix two syntax mistakes
ares_parse_a_reply and ares_parse_aaaa_reply both had two \fB instead of
\fP

Reported-by: Alexander Klauer
Bug: http://c-ares.haxx.se/mail/c-ares-archive-2013-03/0010.shtml
2013-05-02 23:11:13 +02:00
df55bfac79 build: fix build on msvc11 2013-05-02 22:46:48 +02:00
3f0ec4733e Makefile.am: increment -version-info for 1.10.0 release 2013-04-23 16:44:56 +02:00
76ef032fd0 README: remove unnecessary comment 2013-04-23 00:33:24 +02:00
58a822231c ares_version.h: copyright end range year is now 2013 2013-04-23 00:32:51 +02:00
c727dcb924 RELEASE-NOTES: synced with fb0737f3a0 2013-04-23 00:31:14 +02:00
fb0737f3a0 ares_parse_aaaa_reply: Plug memory leak
This change is similar to ares_parse_a_reply.c in commit
bffd67f16a
2013-04-22 23:54:40 +02:00
b5135bbc66 ares_parse_txt_reply: return a ares_txt_reply node for each sub-string
Previously, the function would wrongly return all substrings merged into
one.
2013-04-22 23:32:02 +02:00
9a92b80191 library init: documentation update
This commit updates the documentation of ares_library_init() and
ares_library_cleanup() with regard to the newly introduced reference
counting of initializations and deinitializations.
2013-04-22 23:26:01 +02:00
2e0c3076e5 library init: be recursive
Previously, a single call to ares_library_cleanup() would deinitialise
the c-ares library, regardless of how many times ares_library_init() was
called. This behaviour may cause problems in programs linking two or
more libraries which, in turn, use c-ares. The present commit fixes this
problem, deinitializing the library only after a number of calls to
ares_library_cleanup() matching the number of calls to
ares_library_init().
2013-04-22 23:24:50 +02:00
148c8e0353 protocol parsing: check input data stricter
... so that bad length fields aren't blindly accepted

Bug: http://c-ares.haxx.se/mail/c-ares-archive-2013-04/0016.shtml
2013-04-15 22:28:01 +02:00
2004a7a111 Create ares_build.h when buidling from Git. 2013-04-11 14:08:51 +02:00
c95041c6a1 Added -DCARES_STATICLIB to CFLAGS.
Currently this static makefile does only support building the
static library libcares.a.
2013-04-09 17:47:56 +02:00
483d49d060 .gitignore: ignore patch files
This commit adds a line to .gitignore to the effect that patch files
generated by 'git format-patch' are excluded from the repository.
2013-04-08 22:16:48 +02:00
1317a1c94b ares_destroy() documentation: no new requests
Clarify that no new requests may be added to a resolver channel that is
currently being destroyed.
2013-04-08 22:16:48 +02:00
fa19279bba Documentation: properly document ARES_ECANCELLED
This commit clarifies the behaviour of ares_cancel() with respect to
callbacks and adds missing documentation of ARES_ECANCELLED to the man
pages of the affected functions.
2013-04-08 22:16:48 +02:00
54faf09da6 ares_cancel(): cancel requests safely
An invocation of ares_cancel() walks through the request list, calling
the callbacks of all pending requests on a channel. Previously, if such
a callback added a new request to the channel, the request list might
not end up empty, causing an abort by assertion failure. The present
commit ensures that precisely all requests present upon entry of
ares_cancel() are cancelled, and that adding new requests through
callbacks is safe.
2013-04-08 22:16:48 +02:00
127d4cb357 ares.h: stricter CARES_EXTERN linkage decorations logic
No API change involved.
2013-03-10 21:28:35 +01:00
8f3f059f33 ares_build.h.dist: enhance non-configure GCC ABI detection logic
GCC specific adjustments:

- check __ILP32__ before 32 and 64bit processor architectures in
  order to detect ILP32 programming model on 64 bit processors
  which, of course, also support LP64 programming model, when using
  gcc 4.7 or newer.

- keep 32bit processor architecture checks in order to support gcc
  versions older than 4.7 which don't define __ILP32__

- check __LP64__ for gcc 3.3 and newer, while keeping 64bit processor
  architecture checks for older versions which don't define __LP64__
2013-03-10 21:28:35 +01:00
57203b14df ares.h: there is no ares_free_soa function 2013-03-09 16:48:28 +01:00