Skip to content

Commit 000e574

Browse files
committed
Update cURL to v8.19.0 to fix its security issue (CVE-2025-14819)
Fix notepad-plus-plus/notepad-plus-plus#17869
1 parent 8ccd8e6 commit 000e574

File tree

3,838 files changed

+132671
-133418
lines changed

Some content is hidden

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

3,838 files changed

+132671
-133418
lines changed

curl/.clang-tidy.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
2+
#
3+
# SPDX-License-Identifier: curl
4+
---
5+
# https://clang.llvm.org/extra/clang-tidy/
6+
7+
# https://clang.llvm.org/extra/clang-tidy/checks/list.html
8+
Checks:
9+
- clang-analyzer-*
10+
- -clang-analyzer-optin.performance.Padding
11+
- -clang-analyzer-security.ArrayBound # due to false positives with clang-tidy v21.1.0
12+
- -clang-analyzer-security.insecureAPI.bzero # for FD_ZERO() (seen on macOS)
13+
- -clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling
14+
- -clang-diagnostic-nullability-extension
15+
- bugprone-assert-side-effect
16+
- bugprone-chained-comparison
17+
- bugprone-dynamic-static-initializers
18+
- bugprone-macro-parentheses
19+
- bugprone-macro-repeated-side-effects
20+
- bugprone-misplaced-operator-in-strlen-in-alloc
21+
- bugprone-misplaced-pointer-arithmetic-in-alloc
22+
- bugprone-not-null-terminated-result
23+
- bugprone-posix-return
24+
- bugprone-redundant-branch-condition
25+
- bugprone-signed-char-misuse
26+
- bugprone-suspicious-enum-usage
27+
- bugprone-suspicious-memset-usage
28+
- bugprone-suspicious-missing-comma
29+
- bugprone-suspicious-realloc-usage
30+
- bugprone-suspicious-semicolon
31+
- misc-const-correctness
32+
- misc-header-include-cycle
33+
- portability-*
34+
- readability-duplicate-include
35+
- readability-math-missing-parentheses
36+
- readability-named-parameter
37+
- readability-redundant-control-flow
38+
- readability-redundant-declaration
39+
- readability-redundant-function-ptr-dereference
40+
- readability-redundant-parentheses
41+
- readability-redundant-preprocessor
42+
- readability-suspicious-call-argument
43+
- readability-uppercase-literal-suffix
44+
45+
CheckOptions:
46+
misc-header-include-cycle.IgnoredFilesList: 'curl/curl.h'
47+
48+
HeaderFilterRegex: '.*' # Default in v22.1.0+

curl/.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
2+
#
3+
# SPDX-License-Identifier: curl
4+
5+
root = true
6+
7+
[*]
8+
charset = utf-8
9+
insert_final_newline = true
10+
indent_style = space
11+
trim_trailing_whitespace = true
12+
13+
[*.{c,h}]
14+
indent_size = 2
15+
max_line_length = 79
16+
17+
[*.{pl,pm}]
18+
indent_size = 4

curl/CHANGES.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Copyright (C) Daniel Stenberg, <daniel@haxx.se>, et al.
44
SPDX-License-Identifier: curl
55
-->
66

7-
In a release tarball, check the RELEASES-NOTES file for what was done in the
7+
In a release tarball, check the RELEASE-NOTES file for what was done in the
88
most recent release. In a git check-out, that file mentions changes that have
99
been done since the previous release.
1010

curl/CMake/CMakeConfigurableFile.in

Lines changed: 0 additions & 24 deletions
This file was deleted.

curl/CMake/CurlSymbolHiding.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
option(CURL_HIDDEN_SYMBOLS "Hide libcurl internal symbols (=hide all symbols that are not officially external)" ON)
2525
mark_as_advanced(CURL_HIDDEN_SYMBOLS)
2626

27-
if(WIN32 AND (ENABLE_DEBUG OR ENABLE_CURLDEBUG))
27+
if(WIN32 AND ENABLE_DEBUG)
2828
# We need to export internal debug functions,
2929
# e.g. curl_easy_perform_ev() or curl_dbg_*(),
3030
# so disable symbol hiding for debug builds and for memory tracking.
3131
set(CURL_HIDDEN_SYMBOLS OFF)
32-
elseif(DOS OR AMIGA OR MINGW32CE)
32+
elseif(DOS OR AMIGA)
3333
set(CURL_HIDDEN_SYMBOLS OFF)
3434
endif()
3535

curl/CMake/CurlTests.c

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
#include <sys/types.h>
2828
#include <unistd.h>
2929
#include <fcntl.h>
30-
/* */
30+
3131
#if defined(sun) || defined(__sun__) || \
32-
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
32+
defined(__SUNPRO_C) || defined(__SUNPRO_CC)
3333
# if defined(__SVR4) || defined(__srv4__)
3434
# define PLATFORM_SOLARIS
3535
# else
@@ -39,7 +39,7 @@
3939
#if (defined(_AIX) || defined(__xlC__)) && !defined(_AIX41)
4040
# define PLATFORM_AIX_V3
4141
#endif
42-
/* */
42+
4343
#if defined(PLATFORM_SUNOS4) || defined(PLATFORM_AIX_V3)
4444
#error "O_NONBLOCK does not work on this platform"
4545
#endif
@@ -87,7 +87,7 @@ int main(void)
8787
#elif defined(HAVE_GETHOSTBYNAME_R_5) || \
8888
defined(HAVE_GETHOSTBYNAME_R_5_REENTRANT)
8989
rc = gethostbyname_r(address, &h, buffer, 8192, &h_errnop);
90-
(void)hp; /* not used for test */
90+
(void)hp;
9191
(void)h_errnop;
9292
#elif defined(HAVE_GETHOSTBYNAME_R_6) || \
9393
defined(HAVE_GETHOSTBYNAME_R_6_REENTRANT)
@@ -119,16 +119,19 @@ int main(void)
119119
#include <stdarg.h>
120120
#include <string.h>
121121
#include <float.h>
122-
int main(void) { return 0; }
122+
int main(void)
123+
{
124+
return 0;
125+
}
123126
#endif
124127

125128
#ifdef HAVE_FILE_OFFSET_BITS
126129
#include <sys/types.h>
127130
/* Check that off_t can represent 2**63 - 1 correctly.
128-
We cannot simply define LARGE_OFF_T to be 9223372036854775807,
131+
We cannot define LARGE_OFF_T to be 9223372036854775807,
129132
since some C++ compilers masquerading as C compilers
130133
incorrectly reject 9223372036854775807. */
131-
#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
134+
#define LARGE_OFF_T (((off_t)1 << 62) - 1 + ((off_t)1 << 62))
132135
static int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 &&
133136
LARGE_OFF_T % 2147483647 == 1)
134137
? 1 : -1];
@@ -272,7 +275,10 @@ int main(void)
272275
#include <string.h>
273276
#include <errno.h>
274277

275-
static void check(char c) { (void)c; }
278+
static void check(char c)
279+
{
280+
(void)c;
281+
}
276282

277283
int main(void)
278284
{
@@ -289,7 +295,10 @@ int main(void)
289295
#include <errno.h>
290296

291297
/* Float, because a pointer cannot be implicitly cast to float */
292-
static void check(float f) { (void)f; }
298+
static void check(float f)
299+
{
300+
(void)f;
301+
}
293302

294303
int main(void)
295304
{

curl/CMake/FindBrotli.cmake

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,39 +25,47 @@
2525
#
2626
# Input variables:
2727
#
28-
# - `BROTLI_INCLUDE_DIR`: The brotli include directory.
29-
# - `BROTLICOMMON_LIBRARY`: Path to `brotlicommon` library.
30-
# - `BROTLIDEC_LIBRARY`: Path to `brotlidec` library.
28+
# - `BROTLI_INCLUDE_DIR`: Absolute path to brotli include directory.
29+
# - `BROTLICOMMON_LIBRARY`: Absolute path to `brotlicommon` library.
30+
# - `BROTLIDEC_LIBRARY`: Absolute path to `brotlidec` library.
31+
# - `BROTLI_USE_STATIC_LIBS`: Configure for static brotli libraries.
3132
#
32-
# Result variables:
33+
# Defines:
3334
#
34-
# - `BROTLI_FOUND`: System has brotli.
35-
# - `BROTLI_INCLUDE_DIRS`: The brotli include directories.
36-
# - `BROTLI_LIBRARIES`: The brotli library names.
37-
# - `BROTLI_LIBRARY_DIRS`: The brotli library directories.
38-
# - `BROTLI_PC_REQUIRES`: The brotli pkg-config packages.
39-
# - `BROTLI_CFLAGS`: Required compiler flags.
40-
# - `BROTLI_VERSION`: Version of brotli.
35+
# - `BROTLI_FOUND`: System has brotli.
36+
# - `BROTLI_VERSION`: Version of brotli.
37+
# - `CURL::brotli`: brotli library target.
4138

42-
set(BROTLI_PC_REQUIRES "libbrotlidec" "libbrotlicommon") # order is significant: brotlidec then brotlicommon
39+
set(_brotli_pc_requires "libbrotlidec" "libbrotlicommon") # order is significant: brotlidec then brotlicommon
4340

4441
if(CURL_USE_PKGCONFIG AND
4542
NOT DEFINED BROTLI_INCLUDE_DIR AND
4643
NOT DEFINED BROTLICOMMON_LIBRARY AND
4744
NOT DEFINED BROTLIDEC_LIBRARY)
4845
find_package(PkgConfig QUIET)
49-
pkg_check_modules(BROTLI ${BROTLI_PC_REQUIRES})
46+
pkg_check_modules(_brotli ${_brotli_pc_requires})
5047
endif()
5148

52-
if(BROTLI_FOUND)
49+
if(_brotli_FOUND)
5350
set(Brotli_FOUND TRUE)
54-
set(BROTLI_VERSION "${BROTLI_libbrotlicommon_VERSION}")
55-
string(REPLACE ";" " " BROTLI_CFLAGS "${BROTLI_CFLAGS}")
56-
message(STATUS "Found Brotli (via pkg-config): ${BROTLI_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")")
51+
set(BROTLI_FOUND TRUE)
52+
set(BROTLI_VERSION ${_brotli_libbrotlicommon_VERSION})
53+
if(BROTLI_USE_STATIC_LIBS)
54+
set(_brotli_CFLAGS "${_brotli_STATIC_CFLAGS}")
55+
set(_brotli_INCLUDE_DIRS "${_brotli_STATIC_INCLUDE_DIRS}")
56+
set(_brotli_LIBRARY_DIRS "${_brotli_STATIC_LIBRARY_DIRS}")
57+
set(_brotli_LIBRARIES "${_brotli_STATIC_LIBRARIES}")
58+
endif()
59+
message(STATUS "Found Brotli (via pkg-config): ${_brotli_INCLUDE_DIRS} (found version \"${BROTLI_VERSION}\")")
5760
else()
5861
find_path(BROTLI_INCLUDE_DIR "brotli/decode.h")
59-
find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon")
60-
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec")
62+
if(BROTLI_USE_STATIC_LIBS)
63+
find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon-static" "brotlicommon")
64+
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec-static" "brotlidec")
65+
else()
66+
find_library(BROTLICOMMON_LIBRARY NAMES "brotlicommon")
67+
find_library(BROTLIDEC_LIBRARY NAMES "brotlidec")
68+
endif()
6169

6270
include(FindPackageHandleStandardArgs)
6371
find_package_handle_standard_args(Brotli
@@ -68,9 +76,25 @@ else()
6876
)
6977

7078
if(BROTLI_FOUND)
71-
set(BROTLI_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR})
72-
set(BROTLI_LIBRARIES ${BROTLIDEC_LIBRARY} ${BROTLICOMMON_LIBRARY})
79+
set(_brotli_INCLUDE_DIRS ${BROTLI_INCLUDE_DIR})
80+
set(_brotli_LIBRARIES ${BROTLIDEC_LIBRARY} ${BROTLICOMMON_LIBRARY})
7381
endif()
7482

7583
mark_as_advanced(BROTLI_INCLUDE_DIR BROTLIDEC_LIBRARY BROTLICOMMON_LIBRARY)
7684
endif()
85+
86+
if(BROTLI_FOUND)
87+
if(CMAKE_VERSION VERSION_LESS 3.13)
88+
link_directories(${_brotli_LIBRARY_DIRS})
89+
endif()
90+
91+
if(NOT TARGET CURL::brotli)
92+
add_library(CURL::brotli INTERFACE IMPORTED)
93+
set_target_properties(CURL::brotli PROPERTIES
94+
INTERFACE_LIBCURL_PC_MODULES "${_brotli_pc_requires}"
95+
INTERFACE_COMPILE_OPTIONS "${_brotli_CFLAGS}"
96+
INTERFACE_INCLUDE_DIRECTORIES "${_brotli_INCLUDE_DIRS}"
97+
INTERFACE_LINK_DIRECTORIES "${_brotli_LIBRARY_DIRS}"
98+
INTERFACE_LINK_LIBRARIES "${_brotli_LIBRARIES}")
99+
endif()
100+
endif()

curl/CMake/FindCARES.cmake

Lines changed: 45 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,35 +25,44 @@
2525
#
2626
# Input variables:
2727
#
28-
# - `CARES_INCLUDE_DIR`: The c-ares include directory.
29-
# - `CARES_LIBRARY`: Path to `cares` library.
28+
# - `CARES_INCLUDE_DIR`: Absolute path to c-ares include directory.
29+
# - `CARES_LIBRARY`: Absolute path to `cares` library.
30+
# - `CARES_USE_STATIC_LIBS`: Configure for static c-ares libraries.
3031
#
31-
# Result variables:
32+
# Defines:
3233
#
33-
# - `CARES_FOUND`: System has c-ares.
34-
# - `CARES_INCLUDE_DIRS`: The c-ares include directories.
35-
# - `CARES_LIBRARIES`: The c-ares library names.
36-
# - `CARES_LIBRARY_DIRS`: The c-ares library directories.
37-
# - `CARES_PC_REQUIRES`: The c-ares pkg-config packages.
38-
# - `CARES_CFLAGS`: Required compiler flags.
39-
# - `CARES_VERSION`: Version of c-ares.
34+
# - `CARES_FOUND`: System has c-ares.
35+
# - `CARES_VERSION`: Version of c-ares.
36+
# - `CURL::cares`: c-ares library target.
4037

41-
set(CARES_PC_REQUIRES "libcares")
38+
set(_cares_pc_requires "libcares")
4239

4340
if(CURL_USE_PKGCONFIG AND
4441
NOT DEFINED CARES_INCLUDE_DIR AND
4542
NOT DEFINED CARES_LIBRARY)
4643
find_package(PkgConfig QUIET)
47-
pkg_check_modules(CARES ${CARES_PC_REQUIRES})
44+
pkg_check_modules(_cares ${_cares_pc_requires})
4845
endif()
4946

50-
if(CARES_FOUND)
47+
if(_cares_FOUND)
5148
set(Cares_FOUND TRUE)
52-
string(REPLACE ";" " " CARES_CFLAGS "${CARES_CFLAGS}")
53-
message(STATUS "Found Cares (via pkg-config): ${CARES_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")")
49+
set(CARES_FOUND TRUE)
50+
set(CARES_VERSION ${_cares_VERSION})
51+
if(CARES_USE_STATIC_LIBS)
52+
set(_cares_CFLAGS "${_cares_STATIC_CFLAGS}")
53+
set(_cares_INCLUDE_DIRS "${_cares_STATIC_INCLUDE_DIRS}")
54+
set(_cares_LIBRARY_DIRS "${_cares_STATIC_LIBRARY_DIRS}")
55+
set(_cares_LIBRARIES "${_cares_STATIC_LIBRARIES}")
56+
endif()
57+
message(STATUS "Found Cares (via pkg-config): ${_cares_INCLUDE_DIRS} (found version \"${CARES_VERSION}\")")
5458
else()
5559
find_path(CARES_INCLUDE_DIR NAMES "ares.h")
56-
find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares")
60+
if(CARES_USE_STATIC_LIBS)
61+
set(_cares_CFLAGS "-DCARES_STATICLIB")
62+
find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares_static" "cares")
63+
else()
64+
find_library(CARES_LIBRARY NAMES ${CARES_NAMES} "cares")
65+
endif()
5766

5867
unset(CARES_VERSION CACHE)
5968
if(CARES_INCLUDE_DIR AND EXISTS "${CARES_INCLUDE_DIR}/ares_version.h")
@@ -85,13 +94,29 @@ else()
8594
)
8695

8796
if(CARES_FOUND)
88-
set(CARES_INCLUDE_DIRS ${CARES_INCLUDE_DIR})
89-
set(CARES_LIBRARIES ${CARES_LIBRARY})
97+
set(_cares_INCLUDE_DIRS ${CARES_INCLUDE_DIR})
98+
set(_cares_LIBRARIES ${CARES_LIBRARY})
9099
endif()
91100

92101
mark_as_advanced(CARES_INCLUDE_DIR CARES_LIBRARY)
93102
endif()
94103

95-
if(CARES_FOUND AND WIN32)
96-
list(APPEND CARES_LIBRARIES "iphlpapi") # for if_indextoname and others
104+
if(CARES_FOUND)
105+
if(WIN32)
106+
list(APPEND _cares_LIBRARIES "iphlpapi") # for if_indextoname and others
107+
endif()
108+
109+
if(CMAKE_VERSION VERSION_LESS 3.13)
110+
link_directories(${_cares_LIBRARY_DIRS})
111+
endif()
112+
113+
if(NOT TARGET CURL::cares)
114+
add_library(CURL::cares INTERFACE IMPORTED)
115+
set_target_properties(CURL::cares PROPERTIES
116+
INTERFACE_LIBCURL_PC_MODULES "${_cares_pc_requires}"
117+
INTERFACE_COMPILE_OPTIONS "${_cares_CFLAGS}"
118+
INTERFACE_INCLUDE_DIRECTORIES "${_cares_INCLUDE_DIRS}"
119+
INTERFACE_LINK_DIRECTORIES "${_cares_LIBRARY_DIRS}"
120+
INTERFACE_LINK_LIBRARIES "${_cares_LIBRARIES}")
121+
endif()
97122
endif()

0 commit comments

Comments
 (0)