Skip to content

Commit a18052e

Browse files
deps: update c-ares to 1.34.8
PR-URL: #64330 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Richard Lau <richard.lau@ibm.com>
1 parent 0792ee5 commit a18052e

65 files changed

Lines changed: 1213 additions & 359 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

deps/cares/CMakeLists.txt

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ INCLUDE (CheckCSourceCompiles)
1212
INCLUDE (CheckStructHasMember)
1313
INCLUDE (CheckLibraryExists)
1414

15-
PROJECT (c-ares LANGUAGES C VERSION "1.34.6" )
15+
PROJECT (c-ares LANGUAGES C VERSION "1.34.8" )
1616

1717
# Set this version before release
1818
SET (CARES_VERSION "${PROJECT_VERSION}")
@@ -30,7 +30,7 @@ INCLUDE (GNUInstallDirs) # include this *AFTER* PROJECT(), otherwise paths are w
3030
# For example, a version of 4:0:2 would generate output such as:
3131
# libname.so -> libname.so.2
3232
# libname.so.2 -> libname.so.2.2.0
33-
SET (CARES_LIB_VERSIONINFO "21:5:19")
33+
SET (CARES_LIB_VERSIONINFO "21:7:19")
3434

3535

3636
OPTION (CARES_STATIC "Build as a static library" OFF)
@@ -43,6 +43,7 @@ OPTION (CARES_BUILD_TOOLS "Build tools"
4343
OPTION (CARES_SYMBOL_HIDING "Hide private symbols in shared libraries" OFF)
4444
OPTION (CARES_THREADS "Build with thread-safety support" ON)
4545
OPTION (CARES_COVERAGE "Build for code coverage" OFF)
46+
OPTION (CARES_WERROR "Treat compiler warnings on the c-ares library as errors" OFF)
4647
SET (CARES_RANDOM_FILE "/dev/urandom" CACHE STRING "Suitable File / Device Path for entropy, such as /dev/urandom")
4748

4849
# Tests require static to be enabled on Windows to be able to access otherwise hidden symbols
@@ -54,6 +55,30 @@ ENDIF ()
5455

5556
INCLUDE (EnableWarnings)
5657

58+
# Optionally treat warnings as errors for the c-ares library itself. This is
59+
# applied per-target (see cares_set_werror() usage) rather than globally so it
60+
# does not affect the test/fuzz harnesses (which carry their own warnings) or
61+
# CMake's own compiler feature checks. Enabled in CI only on toolchains known
62+
# to be free of spurious warnings at our high warning levels.
63+
FUNCTION (cares_set_werror target)
64+
IF (NOT CARES_WERROR)
65+
RETURN ()
66+
ENDIF ()
67+
IF (MSVC)
68+
TARGET_COMPILE_OPTIONS (${target} PRIVATE /WX)
69+
ELSE ()
70+
TARGET_COMPILE_OPTIONS (${target} PRIVATE -Werror)
71+
# Modern libc headers (e.g. glibc <string.h>) use the C11 _Generic
72+
# keyword for const-correctness of strchr()/memchr()/etc. Clang flags
73+
# that as a C11 extension under our C90 + -Wpedantic build even though it
74+
# originates in a system header at our call sites. It is not something
75+
# we can fix in our own code, so warn but do not fail on it.
76+
IF (CMAKE_C_COMPILER_ID MATCHES "Clang")
77+
TARGET_COMPILE_OPTIONS (${target} PRIVATE -Wno-error=c11-extensions)
78+
ENDIF ()
79+
ENDIF ()
80+
ENDFUNCTION ()
81+
5782
IF (MSVC)
5883
# allow linking against the static runtime library in msvc
5984
OPTION (CARES_MSVC_STATIC_RUNTIME "Link against the static runtime library" OFF)

deps/cares/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# [![c-ares logo](https://c-ares.org/art/c-ares-logo.svg)](https://c-ares.org/)
22

3-
[![Build Status](https://api.cirrus-ci.com/github/c-ares/c-ares.svg?branch=main)](https://cirrus-ci.com/github/c-ares/c-ares)
4-
[![Windows Build Status](https://ci.appveyor.com/api/projects/status/aevgc5914tm72pvs/branch/main?svg=true)](https://ci.appveyor.com/project/c-ares/c-ares/branch/main)
3+
[![Build Status](https://github.com/c-ares/c-ares/actions/workflows/ubuntu-latest.yml/badge.svg?branch=main)](https://github.com/c-ares/c-ares/actions/workflows/ubuntu-latest.yml)
4+
[![Windows Build Status](https://github.com/c-ares/c-ares/actions/workflows/windows.yml/badge.svg?branch=main)](https://github.com/c-ares/c-ares/actions/workflows/windows.yml)
55
[![Coverage Status](https://coveralls.io/repos/github/c-ares/c-ares/badge.svg?branch=main)](https://coveralls.io/github/c-ares/c-ares?branch=main)
66
[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/291/badge)](https://bestpractices.coreinfrastructure.org/projects/291)
77
[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/c-ares.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:c-ares)

deps/cares/RELEASE-NOTES.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,113 @@
1+
## c-ares version 1.34.8 - July 7 2026
2+
3+
This is a bugfix release.
4+
5+
Bugfixes:
6+
* Revert "Mark parameters in callbacks as const" which shipped in 1.34.7.
7+
Changing the parameter types of the `ares_callback`, `ares_host_callback`,
8+
and `ares_nameinfo_callback` function pointer typedefs was an unintended
9+
API break: existing applications with the historical non-const callback
10+
signatures no longer compiled, particularly in C++ where function pointer
11+
types must match exactly. The read-only nature of the callback parameters
12+
is now documented instead.
13+
[PR #1244](https://github.com/c-ares/c-ares/pull/1244)
14+
15+
Thanks go to these friendly people for their efforts and contributions for this
16+
release:
17+
18+
* Brad House (@bradh352)
19+
20+
21+
## c-ares version 1.34.7 - July 6 2026
22+
23+
This is a security release.
24+
25+
Security:
26+
* CVE-2026-33630. Use-after-free / double-free in c-ares' query-completion
27+
handling, remotely triggerable via ares_getaddrinfo() over TCP. Please see
28+
https://github.com/c-ares/c-ares/security/advisories/GHSA-6wfj-rwm7-3542
29+
* CPU-exhaustion denial of service via unbounded DNS name compression pointer
30+
chains. Please see
31+
https://github.com/c-ares/c-ares/security/advisories/GHSA-pjmc-gx33-gc76
32+
* Memory-amplification denial of service via unvalidated DNS header record
33+
counts. Please see
34+
https://github.com/c-ares/c-ares/security/advisories/GHSA-jv8r-gqr9-68wj
35+
36+
Changes:
37+
* `ares_getaddrinfo()`: handle a NULL node per POSIX and implement
38+
`ARES_AI_PASSIVE`. [PR #1186](https://github.com/c-ares/c-ares/pull/1186)
39+
* Mark parameters in callbacks as const.
40+
[PR #1060](https://github.com/c-ares/c-ares/pull/1060)
41+
* Correct `ARES_CLASS_HESOID` misspelling to `ARES_CLASS_HESIOD`.
42+
[PR #1092](https://github.com/c-ares/c-ares/pull/1092)
43+
44+
Bugfixes:
45+
* Fix sticky server recovery when all servers have failures. [PR #1192](https://github.com/c-ares/c-ares/pull/1192)
46+
* Fix UDP socket exhaustion regression: retire connections per-connection, not via server failure count. [PR #1197](https://github.com/c-ares/c-ares/pull/1197)
47+
* Guard DNS record binary length overflow. [PR #1168](https://github.com/c-ares/c-ares/pull/1168)
48+
* Prevent integer overflow in allocation size calculations. [PR #1147](https://github.com/c-ares/c-ares/pull/1147)
49+
* Prevent overflow in ares_array allocation size calculations. [PR #1117](https://github.com/c-ares/c-ares/pull/1117)
50+
* Prevent integer overflow in buffer size calculation. [PR #1116](https://github.com/c-ares/c-ares/pull/1116)
51+
* Add overflow checks to ares_buf_ensure_space(). [PR #1094](https://github.com/c-ares/c-ares/pull/1094)
52+
* Skip name compression offsets beyond the 14-bit pointer limit. [PR #1159](https://github.com/c-ares/c-ares/pull/1159)
53+
* ares_dns_parse: reject name compression in RDATA where not permitted (RFC 3597). [PR #1190](https://github.com/c-ares/c-ares/pull/1190)
54+
* ares_dns_parse: reject responses with more than one OPT record (RFC 6891). [PR #1189](https://github.com/c-ares/c-ares/pull/1189)
55+
* Discard oversized UDP datagrams instead of truncating the length frame. [PR #1161](https://github.com/c-ares/c-ares/pull/1161)
56+
* Route numeric config parsing through range-checked ares_str_parse_uint. [PR #1158](https://github.com/c-ares/c-ares/pull/1158)
57+
* Replace atoi-based port parsing with validated helper. [PR #1097](https://github.com/c-ares/c-ares/pull/1097)
58+
* Defer TCP connection error handling until DNS responses are parsed. [PR #1138](https://github.com/c-ares/c-ares/pull/1138)
59+
* Prevent undefined-behavior left shift in ares_calc_query_timeout(). [PR #1151](https://github.com/c-ares/c-ares/pull/1151)
60+
* Use unsigned type for ares_round_up_pow2_u64 to avoid undefined behavior. [PR #1107](https://github.com/c-ares/c-ares/pull/1107)
61+
* Fix undefined behavior in ares_buf_replace() pointer arithmetic. [PR #1099](https://github.com/c-ares/c-ares/pull/1099)
62+
* ares_array: reset offset when array becomes empty. [PR #1165](https://github.com/c-ares/c-ares/pull/1165)
63+
* ares_iface_ips: add ARES_IFACE_IP_NONE zero enum value. [PR #1187](https://github.com/c-ares/c-ares/pull/1187)
64+
* ares_sysconfig_files: recognize AIX netsvc.conf bind4/local4 tokens. [PR #1188](https://github.com/c-ares/c-ares/pull/1188)
65+
* Use safe string construction in Windows sysconfig join path. [PR #1143](https://github.com/c-ares/c-ares/pull/1143)
66+
* Fix zero-length RAW_RR losing type metadata during parsing. [PR #1129](https://github.com/c-ares/c-ares/pull/1129)
67+
* Fix RAW_RR type tostr/fromstr roundtrip mismatch. [PR #1123](https://github.com/c-ares/c-ares/pull/1123)
68+
* Fix NULL dereference for ifa netmask. [PR #1120](https://github.com/c-ares/c-ares/pull/1120)
69+
* adig: fix negated option prefix parsing. [PR #1135](https://github.com/c-ares/c-ares/pull/1135)
70+
* Use UnregisterWaitEx to prevent use-after-free on Win32. [PR #1111](https://github.com/c-ares/c-ares/pull/1111)
71+
* Add NULL check after ares_malloc_zero in Windows UTF8 conversion. [PR #1121](https://github.com/c-ares/c-ares/pull/1121)
72+
* Fix NULL dereference after ares_malloc_zero in Win32 IOCP event add. [PR #1132](https://github.com/c-ares/c-ares/pull/1132)
73+
* Fix microsecond overflow in ares_queue_wait_empty timeout. [PR #1122](https://github.com/c-ares/c-ares/pull/1122)
74+
* Fix NULL dereference in ares_buf_replace() on NULL buf. [PR #1124](https://github.com/c-ares/c-ares/pull/1124)
75+
* Initialize *read_bytes in ares_socket_recvfrom(). [PR #1125](https://github.com/c-ares/c-ares/pull/1125)
76+
* Fix memory leak of binbuf in ares_buf_parse_dns_binstr_int. [PR #1126](https://github.com/c-ares/c-ares/pull/1126)
77+
* Fix memory leak of qcache entry on key allocation failure. [PR #1127](https://github.com/c-ares/c-ares/pull/1127)
78+
* Fix memory leak of buf in ares_dns_multistring_combined() on OOM. [PR #1110](https://github.com/c-ares/c-ares/pull/1110)
79+
* Fix memory leaks on error paths in two functions. [PR #1109](https://github.com/c-ares/c-ares/pull/1109)
80+
* Fix memory leak of buckets in ares_htable_dict_keys() error path. [PR #1108](https://github.com/c-ares/c-ares/pull/1108)
81+
* Fix memory leak of bucket->key in ares_htable_dict_insert error path. [PR #1105](https://github.com/c-ares/c-ares/pull/1105)
82+
* Fix additional memory leaks. [PR #1091](https://github.com/c-ares/c-ares/pull/1091) [PR #1078](https://github.com/c-ares/c-ares/pull/1078)
83+
* Prevent corrupt addrinfo nodes on sockaddr allocation failure. [PR #1112](https://github.com/c-ares/c-ares/pull/1112)
84+
* Fix two logic bugs in DNS cookie handling. [PR #1103](https://github.com/c-ares/c-ares/pull/1103)
85+
* Fix linked list INSERT_BEFORE corruption and array insertdata_first ordering. [PR #1101](https://github.com/c-ares/c-ares/pull/1101)
86+
* Fix HASH_IDX macro missing parentheses. [PR #1128](https://github.com/c-ares/c-ares/pull/1128)
87+
* Fix malloc(0) in ares_htable_all_buckets on empty table. [PR #1131](https://github.com/c-ares/c-ares/pull/1131)
88+
* Fix wrong sizeof in QNX confstr() call truncating domain names. [PR #1130](https://github.com/c-ares/c-ares/pull/1130)
89+
* Clear probe pending flag after timeout. [PR #1059](https://github.com/c-ares/c-ares/pull/1059)
90+
* Fix incorrect check for empty wide string. [PR #1064](https://github.com/c-ares/c-ares/pull/1064)
91+
* Handle strdup failure. [PR #1077](https://github.com/c-ares/c-ares/pull/1077)
92+
* doc: reference ares_free_string(), not ares_free(). [PR #1084](https://github.com/c-ares/c-ares/pull/1084)
93+
94+
Thanks go to these friendly people for their efforts and contributions for this
95+
release:
96+
97+
* (@Alb3e3)
98+
* Brad House (@bradh352)
99+
* (@dankmeme01)
100+
* David Hotham (@dimbleby)
101+
* Tom Flynn (@Flynnzaa)
102+
* (@jmestwa-coder)
103+
* (@kodareef5)
104+
* Kaixuan Li (@MarkLee131)
105+
* (@lifenjoiner)
106+
* (@metsw24-max)
107+
* Song Li (@SongTonyLi)
108+
* (@uwezkhan)
109+
110+
1111
## c-ares version 1.34.6 - December 8 2025
2112

3113
This is a security release.

deps/cares/aminclude_static.am

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# aminclude_static.am generated automatically by Autoconf
3-
# from AX_AM_MACROS_STATIC on Mon Dec 8 16:21:41 UTC 2025
3+
# from AX_AM_MACROS_STATIC on Tue Jul 7 16:14:13 UTC 2026
44

55

66
# Code coverage

deps/cares/configure

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#! /bin/sh
22
# Guess values for system-dependent variables and create Makefiles.
3-
# Generated by GNU Autoconf 2.71 for c-ares 1.34.6.
3+
# Generated by GNU Autoconf 2.71 for c-ares 1.34.8.
44
#
55
# Report bugs to <c-ares mailing list: http://lists.haxx.se/listinfo/c-ares>.
66
#
@@ -621,8 +621,8 @@ MAKEFLAGS=
621621
# Identity of this package.
622622
PACKAGE_NAME='c-ares'
623623
PACKAGE_TARNAME='c-ares'
624-
PACKAGE_VERSION='1.34.6'
625-
PACKAGE_STRING='c-ares 1.34.6'
624+
PACKAGE_VERSION='1.34.8'
625+
PACKAGE_STRING='c-ares 1.34.8'
626626
PACKAGE_BUGREPORT='c-ares mailing list: http://lists.haxx.se/listinfo/c-ares'
627627
PACKAGE_URL=''
628628

@@ -1430,7 +1430,7 @@ if test "$ac_init_help" = "long"; then
14301430
# Omit some internal or obsolete options to make the list less imposing.
14311431
# This message is too long to be a string in the A/UX 3.1 sh.
14321432
cat <<_ACEOF
1433-
\`configure' configures c-ares 1.34.6 to adapt to many kinds of systems.
1433+
\`configure' configures c-ares 1.34.8 to adapt to many kinds of systems.
14341434

14351435
Usage: $0 [OPTION]... [VAR=VALUE]...
14361436

@@ -1501,7 +1501,7 @@ fi
15011501

15021502
if test -n "$ac_init_help"; then
15031503
case $ac_init_help in
1504-
short | recursive ) echo "Configuration of c-ares 1.34.6:";;
1504+
short | recursive ) echo "Configuration of c-ares 1.34.8:";;
15051505
esac
15061506
cat <<\_ACEOF
15071507

@@ -1647,7 +1647,7 @@ fi
16471647
test -n "$ac_init_help" && exit $ac_status
16481648
if $ac_init_version; then
16491649
cat <<\_ACEOF
1650-
c-ares configure 1.34.6
1650+
c-ares configure 1.34.8
16511651
generated by GNU Autoconf 2.71
16521652

16531653
Copyright (C) 2021 Free Software Foundation, Inc.
@@ -2271,7 +2271,7 @@ cat >config.log <<_ACEOF
22712271
This file contains any messages produced by compilers while
22722272
running configure, to aid debugging if configure makes a mistake.
22732273

2274-
It was created by c-ares $as_me 1.34.6, which was
2274+
It was created by c-ares $as_me 1.34.8, which was
22752275
generated by GNU Autoconf 2.71. Invocation command line was
22762276

22772277
$ $0$ac_configure_args_raw
@@ -3245,7 +3245,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
32453245

32463246

32473247

3248-
CARES_VERSION_INFO="21:5:19"
3248+
CARES_VERSION_INFO="21:7:19"
32493249

32503250

32513251

@@ -6818,7 +6818,7 @@ fi
68186818

68196819
# Define the identity of the package.
68206820
PACKAGE='c-ares'
6821-
VERSION='1.34.6'
6821+
VERSION='1.34.8'
68226822

68236823

68246824
printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
@@ -28238,7 +28238,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
2823828238
# report actual input values of CONFIG_FILES etc. instead of their
2823928239
# values after options handling.
2824028240
ac_log="
28241-
This file was extended by c-ares $as_me 1.34.6, which was
28241+
This file was extended by c-ares $as_me 1.34.8, which was
2824228242
generated by GNU Autoconf 2.71. Invocation command line was
2824328243

2824428244
CONFIG_FILES = $CONFIG_FILES
@@ -28306,7 +28306,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
2830628306
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
2830728307
ac_cs_config='$ac_cs_config_escaped'
2830828308
ac_cs_version="\\
28309-
c-ares config.status 1.34.6
28309+
c-ares config.status 1.34.8
2831028310
configured by $0, generated by GNU Autoconf 2.71,
2831128311
with options \\"\$ac_cs_config\\"
2831228312

deps/cares/configure.ac

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ dnl Copyright (C) The c-ares project and its contributors
22
dnl SPDX-License-Identifier: MIT
33
AC_PREREQ([2.69])
44

5-
AC_INIT([c-ares], [1.34.6],
5+
AC_INIT([c-ares], [1.34.8],
66
[c-ares mailing list: http://lists.haxx.se/listinfo/c-ares])
77

8-
CARES_VERSION_INFO="21:5:19"
8+
CARES_VERSION_INFO="21:7:19"
99
dnl This flag accepts an argument of the form current[:revision[:age]]. So,
1010
dnl passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
1111
dnl 1.

deps/cares/docs/ares_dns_record.3

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ DNS Classes for requests and responses:
140140
.B ARES_CLASS_CHAOS
141141
- CHAOS
142142
.br
143-
.B ARES_CLASS_HESOID
143+
.B ARES_CLASS_HESIOD
144144
- Hesoid [Dyer 87]
145145
.br
146146
.B ARES_CLASS_NONE

deps/cares/docs/ares_getaddrinfo.3

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@ The
2727
and
2828
.I service
2929
parameters give the hostname and service as NULL-terminated C strings.
30+
Either
31+
.I name
32+
or
33+
.I service
34+
may be NULL, but not both. If
35+
.I name
36+
is NULL, the returned addresses are synthesized from
37+
.IR service :
38+
the wildcard address (0.0.0.0 or ::) is returned when
39+
.B ARES_AI_PASSIVE
40+
is set in
41+
.IR ai_flags ,
42+
otherwise the loopback address (127.0.0.1 or ::1) is returned.
3043
The
3144
.I hints
3245
parameter is an
@@ -63,6 +76,16 @@ If this option is set
6376
.I service
6477
field will be treated as a numeric value.
6578
.TP 19
79+
.B ARES_AI_PASSIVE
80+
If this option is set and
81+
.I name
82+
is NULL, the returned addresses will use the wildcard address (0.0.0.0 or ::),
83+
suitable for
84+
.BR bind (2)ing
85+
a socket that will accept connections. If not set and
86+
.I name
87+
is NULL, the loopback address (127.0.0.1 or ::1) is returned instead.
88+
.TP 19
6689
.B ARES_AI_CANONNAME
6790
The ares_addrinfo structure will return a canonical names list.
6891
.TP 19

deps/cares/docs/ares_gethostbyaddr.3

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,16 @@ points to a
8080
containing the name of the host returned by the query. The callback
8181
need not and should not attempt to free the memory pointed to by
8282
.IR hostent ;
83-
the ares library will free it when the callback returns. If the query
83+
the ares library will free it when the callback returns. The callback
84+
.B must not
85+
modify the
86+
.B struct hostent
87+
or retain a reference to it after returning; it is owned by c-ares and is only
88+
valid for the duration of the callback. The parameter is intentionally not
89+
declared
90+
.B const
91+
solely to preserve API/ABI compatibility with existing applications.
92+
If the query
8493
did not complete successfully,
8594
.I hostent
8695
will be

deps/cares/docs/ares_gethostbyname.3

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,16 @@ points to a
8888
containing the name of the host returned by the query. The callback
8989
need not and should not attempt to free the memory pointed to by
9090
.IR hostent ;
91-
the ares library will free it when the callback returns. If the query
91+
the ares library will free it when the callback returns. The callback
92+
.B must not
93+
modify the
94+
.B struct hostent
95+
or retain a reference to it after returning; it is owned by c-ares and is only
96+
valid for the duration of the callback. The parameter is intentionally not
97+
declared
98+
.B const
99+
solely to preserve API/ABI compatibility with existing applications.
100+
If the query
92101
did not complete successfully,
93102
.I hostent
94103
will be

0 commit comments

Comments
 (0)