Skip to content

Commit

Permalink
Update cURL to v8.4
Browse files Browse the repository at this point in the history
The cURL.dll of v8.2.1 which fixes vulnerability of CVE-2023-38545 was not deployed in the latest Notepad++ release.

Fix #50
  • Loading branch information
donho committed Nov 16, 2023
1 parent e6cd591 commit 2dfffa9
Show file tree
Hide file tree
Showing 2,947 changed files with 232,478 additions and 30,369 deletions.
11,655 changes: 6,093 additions & 5,562 deletions curl/CHANGES

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions curl/CMake/CurlSymbolHiding.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ include(CheckCSourceCompiles)
option(CURL_HIDDEN_SYMBOLS "Set to ON to hide libcurl internal symbols (=hide all symbols that aren't officially external)." ON)
mark_as_advanced(CURL_HIDDEN_SYMBOLS)

if(WIN32 AND ENABLE_CURLDEBUG)
# We need to export internal debug functions (e.g. curl_dbg_*), so disable
# symbol hiding for debug builds.
set(CURL_HIDDEN_SYMBOLS OFF)
endif()

if(CURL_HIDDEN_SYMBOLS)
set(SUPPORTS_SYMBOL_HIDING FALSE)

Expand Down
19 changes: 1 addition & 18 deletions curl/CMake/CurlTests.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,6 @@
* SPDX-License-Identifier: curl
*
***************************************************************************/
#ifdef TIME_WITH_SYS_TIME
/* Time with sys/time test */

#include <sys/types.h>
#include <sys/time.h>
#include <time.h>

int
main ()
{
if ((struct tm *) 0)
return 0;
;
return 0;
}

#endif

#ifdef HAVE_FCNTL_O_NONBLOCK

Expand Down Expand Up @@ -510,7 +493,7 @@ main() {
int
main() {
_Atomic int i = 1;
i = 0; // Force an atomic-write operation.
i = 0; /* Force an atomic-write operation. */
return i;
}
#endif
Expand Down
6 changes: 4 additions & 2 deletions curl/CMake/FindNGTCP2.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,10 @@ Find the ngtcp2 library
This module accepts optional COMPONENTS to control the crypto library (these are
mutually exclusive)::
OpenSSL: Use libngtcp2_crypto_quictls
GnuTLS: Use libngtcp2_crypto_gnutls
quictls, LibreSSL: Use libngtcp2_crypto_quictls
BoringSSL, AWS-LC: Use libngtcp2_crypto_boringssl
wolfSSL: Use libngtcp2_crypto_wolfssl
GnuTLS: Use libngtcp2_crypto_gnutls
Result Variables
^^^^^^^^^^^^^^^^
Expand Down
93 changes: 89 additions & 4 deletions curl/CMake/OtherTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
#
###########################################################################
include(CheckCSourceCompiles)
include(CheckCSourceRuns)

# The begin of the sources (macros and includes)
set(_source_epilogue "#undef inline")

Expand All @@ -38,7 +40,7 @@ if(HAVE_WINDOWS_H)
set(_source_epilogue
"${_source_epilogue}\n#ifndef WIN32_LEAN_AND_MEAN\n#define WIN32_LEAN_AND_MEAN\n#endif")
set(signature_call_conv "PASCAL")
if(HAVE_LIBWS2_32)
if(WIN32)
set(CMAKE_REQUIRED_LIBRARIES ws2_32)
endif()
else()
Expand All @@ -57,10 +59,9 @@ check_c_source_compiles("${_source_epilogue}

if(NOT HAVE_WINDOWS_H)
add_header_include(HAVE_SYS_TIME_H "sys/time.h")
add_header_include(TIME_WITH_SYS_TIME "time.h")
add_header_include(HAVE_TIME_H "time.h")
endif()
check_c_source_compiles("${_source_epilogue}
#include <time.h>
int main(void) {
struct timeval ts;
ts.tv_sec = 0;
Expand Down Expand Up @@ -90,7 +91,6 @@ if(NOT CMAKE_CROSSCOMPILING)
# only try this on non-apple platforms

# if not cross-compilation...
include(CheckCSourceRuns)
set(CMAKE_REQUIRED_FLAGS "")
if(HAVE_SYS_POLL_H)
set(CMAKE_REQUIRED_FLAGS "-DHAVE_SYS_POLL_H")
Expand Down Expand Up @@ -134,3 +134,88 @@ if(NOT CMAKE_CROSSCOMPILING)
endif()
endif()

# Detect HAVE_GETADDRINFO_THREADSAFE

if(WIN32)
set(HAVE_GETADDRINFO_THREADSAFE ${HAVE_GETADDRINFO})
elseif(NOT HAVE_GETADDRINFO)
set(HAVE_GETADDRINFO_THREADSAFE FALSE)
elseif(CMAKE_SYSTEM_NAME STREQUAL "AIX" OR
CMAKE_SYSTEM_NAME STREQUAL "Darwin" OR
CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "HP-UX" OR
CMAKE_SYSTEM_NAME STREQUAL "MidnightBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "NetBSD" OR
CMAKE_SYSTEM_NAME STREQUAL "SunOS")
set(HAVE_GETADDRINFO_THREADSAFE TRUE)
elseif(CMAKE_SYSTEM_NAME MATCHES "BSD")
set(HAVE_GETADDRINFO_THREADSAFE FALSE)
endif()

if(NOT DEFINED HAVE_GETADDRINFO_THREADSAFE)

set(_save_epilogue "${_source_epilogue}")
set(_source_epilogue "#undef inline")

add_header_include(HAVE_SYS_SOCKET_H "sys/socket.h")
add_header_include(HAVE_SYS_TIME_H "sys/time.h")
add_header_include(HAVE_NETDB_H "netdb.h")

check_c_source_compiles("${_source_epilogue}
int main(void)
{
#ifdef h_errno
return 0;
#else
force compilation error
#endif
}" HAVE_H_ERRNO)

if(NOT HAVE_H_ERRNO)
check_c_source_runs("${_source_epilogue}
int main(void)
{
h_errno = 2;
return h_errno != 0 ? 1 : 0;
}" HAVE_H_ERRNO_ASSIGNABLE)

if(NOT HAVE_H_ERRNO_ASSIGNABLE)
check_c_source_compiles("${_source_epilogue}
int main(void)
{
#if defined(_POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200809L)
return 0;
#elif defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 700)
return 0;
#else
force compilation error
#endif
}" HAVE_H_ERRNO_SBS_ISSUE_7)
endif()
endif()

if(HAVE_H_ERRNO OR HAVE_H_ERRNO_ASSIGNABLE OR HAVE_H_ERRNO_SBS_ISSUE_7)
set(HAVE_GETADDRINFO_THREADSAFE TRUE)
endif()

set(_source_epilogue "${_save_epilogue}")
endif()

if(NOT DEFINED HAVE_CLOCK_GETTIME_MONOTONIC_RAW)
set(_save_epilogue "${_source_epilogue}")
set(_source_epilogue "#undef inline")

add_header_include(HAVE_SYS_TYPES_H "sys/types.h")
add_header_include(HAVE_SYS_TIME_H "sys/time.h")

check_c_source_compiles("${_source_epilogue}
#include <time.h>
int main(void)
{
struct timespec ts;
(void)clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
return 0;
}" HAVE_CLOCK_GETTIME_MONOTONIC_RAW)

set(_source_epilogue "${_save_epilogue}")
endif()
56 changes: 49 additions & 7 deletions curl/CMake/Platforms/WindowsCache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,41 +23,80 @@
###########################################################################
if(NOT UNIX)
if(WIN32)

set(HAVE_WINDOWS_H 1)
set(HAVE_WS2TCPIP_H 1)
set(HAVE_WINSOCK2_H 1)

if(MINGW)
set(HAVE_SNPRINTF 1)
set(HAVE_UNISTD_H 1)
set(HAVE_INTTYPES_H 1)
set(HAVE_STRTOLL 1)
set(HAVE_BASENAME 1)
elseif(MSVC)
if(NOT MSVC_VERSION LESS 1800)
set(HAVE_INTTYPES_H 1)
set(HAVE_STRTOLL 1)
else()
set(HAVE_INTTYPES_H 0)
set(HAVE_STRTOLL 0)
endif()
if(NOT MSVC_VERSION LESS 1900)
set(HAVE_SNPRINTF 1)
else()
set(HAVE_SNPRINTF 0)
endif()
set(HAVE_BASENAME 0)
endif()

set(HAVE_LIBSOCKET 0)
set(HAVE_GETHOSTNAME 1)
set(HAVE_LIBZ 0)

set(HAVE_ARC4RANDOM 0)
set(HAVE_FNMATCH 0)
set(HAVE_SCHED_YIELD 0)
set(HAVE_ARPA_INET_H 0)
set(HAVE_FCNTL_H 1)
set(HAVE_IFADDRS_H 0)
set(HAVE_IO_H 1)
set(HAVE_NETDB_H 0)
set(HAVE_NETINET_IN_H 0)
set(HAVE_NETINET_TCP_H 0)
set(HAVE_NETINET_UDP_H 0)
set(HAVE_NET_IF_H 0)
set(HAVE_IOCTL_SIOCGIFADDR 0)
set(HAVE_POLL_H 0)
set(HAVE_POLL_FINE 0)
set(HAVE_PWD_H 0)
set(HAVE_SETJMP_H 1)
set(HAVE_SIGNAL_H 1)
set(HAVE_STDLIB_H 1)
set(HAVE_STRINGS_H 0)
set(HAVE_STRING_H 1)
set(HAVE_SYS_FILIO_H 0)
set(HAVE_SYS_WAIT_H 0)
set(HAVE_SYS_IOCTL_H 0)
set(HAVE_SYS_PARAM_H 0)
set(HAVE_SYS_POLL_H 0)
set(HAVE_SYS_RESOURCE_H 0)
set(HAVE_SYS_SELECT_H 0)
set(HAVE_SYS_SOCKET_H 0)
set(HAVE_SYS_SOCKIO_H 0)
set(HAVE_SYS_STAT_H 1)
set(HAVE_SYS_TIME_H 0)
set(HAVE_SYS_TYPES_H 1)
set(HAVE_SYS_UN_H 0)
set(HAVE_SYS_UTIME_H 1)
set(HAVE_TERMIOS_H 0)
set(HAVE_TERMIO_H 0)
set(HAVE_TIME_H 1)
set(HAVE_UTIME_H 0)

set(HAVE_FSEEKO 0)
set(HAVE__FSEEKI64 1)
set(HAVE_SOCKET 1)
set(HAVE_SELECT 1)
set(HAVE_STRDUP 1)
set(HAVE_STRICMP 1)
set(HAVE_STRCMPI 1)
set(HAVE_MEMRCHR 0)
set(HAVE_GETTIMEOFDAY 0)
set(HAVE_CLOSESOCKET 1)
set(HAVE_SIGSETJMP 0)
Expand All @@ -66,10 +105,14 @@ if(NOT UNIX)
set(HAVE_GETPWUID 0)
set(HAVE_GETEUID 0)
set(HAVE_UTIME 1)
set(HAVE_RAND_EGD 0)
set(HAVE_GMTIME_R 0)
set(HAVE_CLOCK_GETTIME_MONOTONIC_RAW 0)
set(HAVE_GETHOSTBYNAME_R 0)
set(HAVE_SIGNAL 1)
set(HAVE_LINUX_TCP_H 0)
set(HAVE_GLIBC_STRERROR_R 0)
set(HAVE_MACH_ABSOLUTE_TIME 0)
set(HAVE_GETIFADDRS 0)

set(HAVE_GETHOSTBYNAME_R_3 0)
set(HAVE_GETHOSTBYNAME_R_3_REENTRANT 0)
Expand All @@ -78,7 +121,6 @@ if(NOT UNIX)
set(HAVE_GETHOSTBYNAME_R_6 0)
set(HAVE_GETHOSTBYNAME_R_6_REENTRANT 0)

set(TIME_WITH_SYS_TIME 0)
set(HAVE_O_NONBLOCK 0)
set(HAVE_IN_ADDR_T 0)
set(STDC_HEADERS 1)
Expand Down
3 changes: 3 additions & 0 deletions curl/CMake/curl-config.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ endif()

include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
check_required_components("@PROJECT_NAME@")

# Alias for either shared or static library
add_library(@PROJECT_NAME@::libcurl ALIAS @PROJECT_NAME@::@LIB_SELECTED@)
Loading

0 comments on commit 2dfffa9

Please sign in to comment.