Commit Graph

38214 Commits

Author SHA1 Message Date
Daniel Stenberg
949b1ff34e
RELEASE-NOTES: synced 2026-03-24 09:09:30 +01:00
Daniel Stenberg
5023d2fe27
DEPRECATE: remove NTLM, SMB and local crypto implementations
Closes #21079
2026-03-24 08:52:54 +01:00
Daniel Stenberg
29dfc0238c
tool_getparam: use correct free function for libcurl memory
Memory returned from curl_easy_escape() should be fred with curl_free()
to avoid surprises.

Follow-up to f37840a46e

Spotted by Codex Security
Closes #21075
2026-03-24 08:49:20 +01:00
Daniel Stenberg
14712fa513
curl_version_info.md: clarify age details
The argument is not used.

Fixes #21052
Reported-by: Dan Fandrich
Closes #21059
2026-03-24 08:17:29 +01:00
Stefan Eissing
6f9f4b3cb7
lib: add thread pool and queue
- new source files for thread pool and queue
- test cases 3217 and 3218 for them
- internal documentation

Closes #20916
2026-03-23 23:03:58 +01:00
Daniel Stenberg
664db28d29
test2405: require wakeup
To get the correct file descriptor count

Reported-by: Marcel Raad
Fixes #21069
Closes #21074
2026-03-23 23:01:01 +01:00
Daniel Stenberg
3ef422e128
lib1560: verify more URLs
- control codes at various places in URL, even when URL encoding
  is requested

- verify zone id extraction more

Closes #21071
2026-03-23 14:35:02 +01:00
Daniel Stenberg
d3fa54a243
config2setopts: make --capath work in proxy disabled builds
Follow-up to 95e8515ca0

Spotted by Codex Security

Closes #21063
2026-03-23 14:33:59 +01:00
Daniel Stenberg
07d109b7c6
test1714: verify telnet download with --max-filesize
(disabled on Windows because of hangs)

Closes #21023
2026-03-23 14:32:46 +01:00
Viktor Szakats
806fd7a0e1
genserv.pl: make external calls safe
By passing command-line as separate arguments instead of using a single
string. This needs skipping the shell, so rework redirections to use
Perl `open3()`.

Also explored to use `-out` to avoid redirections, but it makes the
command-line incompatible with some OpenSSL implementations/versions
(e.g. on default macOS), and would still need a solution for
`2>/dev/null`.

Ref: https://perldoc.perl.org/IPC::Open3

Closes #20971
2026-03-23 12:39:38 +01:00
Daniel Stenberg
8f0e0f9dc7
urldata: make hstslist only present in HSTS builds
Closes #21068
2026-03-23 10:19:45 +01:00
Daniel Stenberg
e0327b2ebb
netrc: remove unused parsenetrc() macro for netrc-disabled
When netrc is disabled, this macro is unused (and wrong).

Closes #21067
2026-03-23 10:19:08 +01:00
Daniel Stenberg
e0be05cbab
urlapi: fix handling of "file:///"
When the path is exactly one byte, a single slash.

Extended test 1560 to verify.

Found by Codex Security

Closes #21070
2026-03-23 10:17:59 +01:00
Daniel Stenberg
0c475b5df7
urlapi: remove redundant condition in dedotdotify
Bonus: remove two variables, clear up some comments.

Poined out by CodeSonar

Closes #21065
2026-03-23 08:26:02 +01:00
Daniel Stenberg
9820e5dfac
tool_operate: fix memory-leak on failed uploads
Add test case 1673 to do repeated upload failures and verify there is no
leak. This proved a previous leak and now it verifies the fix.

Reported-by: James Fuller
Closes #21062
2026-03-22 23:58:02 +01:00
Viktor Szakats
e8c64a06c5
asyn-thrdd: fix clang-tidy unused value warning
with `-DCURL_DISABLE_SOCKETPAIR=ON`.

```
lib/asyn-thrdd.c:227:5: error: Value stored to 'do_abort' is never read [clang-analyzer-deadcode.DeadStores,-warnings-as-errors]
  227 |     do_abort = addr_ctx->do_abort;
      |     ^          ~~~~~~~~~~~~~~~~~~
```

Closes #21061
2026-03-22 19:15:56 +01:00
Viktor Szakats
757fd6aae9
gnutls: fix clang-tidy warning with !verbose
with
`-DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_USE_GNUTLS=ON -DCURL_CLANG_TIDY=ON`.

```
lib/vtls/gtls.c:268:7: error: Value stored to 'strerr' is never read [clang-analyzer-deadcode.DeadStores,-warnings-as-errors]
  268 |       strerr = gnutls_strerror(rc);
      |       ^        ~~~~~~~~~~~~~~~~~~~
```

Closes #21060
2026-03-22 19:15:56 +01:00
Daniel Stenberg
57a94fec47
multi.h: add CURLMNWC_CLEAR_ALL
The two bitmask constants for *CLEAR_DNS and *CLEAR_CONNS were
duplicates (both set to 1), so they cannot be distinguished and both
actions fire.

This shipped in public releases since 8.16.0 to and include 8.19.0.

This fix adds CURLMNWC_CLEAR_ALL to be the new 1, and it now implies all
bits. The DNS and CONNS defines get two new bits (2, 4).

Follow-up to 55c045c863

Found by Codex Security
Closes #20968
2026-03-22 18:06:32 +01:00
Daniel Stenberg
e9eddedf38
Revert "md5/md4: enable unaligned access fast path on powerpc64"
This reverts commit 21fc17b265.

That was not properly thought through. PowerPC can run in either endian
and the preprocessor does not know which.

Ref: #20985
Closes #21058
2026-03-22 18:04:08 +01:00
Viktor Szakats
fcec44df00
FAQ.md: point archive.org link to the original, no-JS, revision [ci skip]
To make it pass mdlinkcheck, open faster, w/o cookie banner, and not
need special URL format to make JS happy.

Ref: 1dc0ce9562
2026-03-22 13:33:34 +01:00
Daniel Stenberg
d3ae2e0565
RELEASE-NOTES: synced 2026-03-22 12:02:49 +01:00
Daniel Stenberg
6393103b99
lib: make SMB support opt-in
The SMB protocol has weak security and is rarely used these days.

Note that SMB also requires NTLM enabled.

Closes #20846
2026-03-22 11:55:39 +01:00
Viktor Szakats
06a83340b1
GHA/curl-for-win: enable c-ares with HTTPS-RR in an existing job
c-ares builds have been sped up within curl-for-win using, pre-fills. It
allows building it with acceptable performance, making it practical to
use it, alongside HTTPS-RR, in curl CI and possibly in curl-for-win. It
has been enabled in its dev branch for a while.

Ref: 61a7354120

Closes #21032
2026-03-22 00:26:25 +01:00
Viktor Szakats
e09a7b83d6
cf-https-connect: silence -Wimplicit-int-enum-cast with HTTPS-RR + clang 21
Fixing (seen in curl-for-win dev branch):
```
In file included from _a64-linux-gnu-bld/lib/CMakeFiles/libcurl_object.dir/Unity/unity_0_c.c:34:
lib/cf-https-connect.c:681:28: error: implicit conversion from 'unsigned char' to enumeration type 'enum alpnid' is invalid in C++ [-Werror,-Wimplicit-int-enum-cast]
  681 |         enum alpnid alpn = rr->alpns[i];
      |                     ~~~~   ^~~~~~~~~~~~e
```

Ref: #21032

Closes #21057
2026-03-21 23:45:55 +01:00
Daniel Stenberg
789282cb8d
lib: drop support for < c-ares 1.16.0
Closes #20911
2026-03-21 23:37:59 +01:00
Scott Boudreaux
21fc17b265
md5/md4: enable unaligned access fast path on powerpc64
PowerPC64 (both big-endian and little-endian) supports efficient
unaligned memory access, similar to x86. This extends the existing
fast path that avoids byte-by-byte loads in the MD5 and MD4 SET/GET
macros.

On POWER8 ppc64le, this eliminates 3 shifts + 3 ORs per 32-bit word
load, replacing them with a single lwz (or lwbrx on big-endian).

Co Authored By Claude Opus 4.6 (1M context)

Closes #20985
2026-03-21 23:35:58 +01:00
Daniel Stenberg
77ed315096
progress: count amount of data "delivered" to application
... and apply the CURLOPT_MAXFILESIZE limit (if set) on that as well.
This effectively protects the user against "zip bombs".

Test case 1618 verifies using a 14 byte brotli payload that otherwise
explodes to 102400 zero bytes.

Closes #20787
2026-03-21 23:21:55 +01:00
Daniel Stenberg
fa13f373b2
netrc: skip malformed macdef lines
When skipping macdef lines inside netrc files, ignore it completely and
do not tokenize or bail out on bad quotes.

Verify in test 1672

Follow-up to 3b43a05e00

Spotted by Codex Security
Closes #21049
2026-03-21 23:20:49 +01:00
Daniel Stenberg
6026d76fdf
test1668: unit test the FTP 213 time response parser
Should make it harder to introduce regressions.

Closes #21051
2026-03-21 23:10:32 +01:00
Daniel Stenberg
89d649c482
badwords-all: stop checking source code comments
The code runs under different rules than documentation and these checks
cause too much friction with too little gain.

Leave checking of the public include files since they are almost
documentation.

Closes #21048
2026-03-21 22:58:51 +01:00
Viktor Szakats
6c64d39dce
hostip: drop guard from Curl_resolver_error() definition
To sync with its declaration.

Fixing (seen when building trurl in curl-for-win):
```
ld.lld: error: undefined symbol: Curl_resolver_error
```
Ref: https://github.com/curl/curl-for-win/actions/runs/23388349475/job/68038915761#step:3:7469

Closes #21054
2026-03-21 22:42:38 +01:00
Viktor Szakats
3025c9778a
testcurl.pl: replace shell commands with Perl rmtree()
Ref: https://perldoc.perl.org/5.8.2/File::Path
Follow-up to e992aa6a54

Closes #21053
2026-03-21 22:42:38 +01:00
Harry Sintonen
e2186933c1
tool: add check for curlinfo->age when determining if ssh backend is libssh2
The code failed to check for the version, and could thus read memory
past the existing curl_version_info_data structure. This could lead to a
crash.

Closes #21050
2026-03-21 18:54:23 +01:00
Viktor Szakats
8fce3e17e6
cmake: add CMake Config-based dependency detection
After limiting `find_package()`/`find_dependency()` calls to curl local
Find modules via the `MODULES` keyword, it became possible to detect
dependencies via CMake Configs from within those local Find modules, by
calling `find_package()` again with the `CONFIG` keyword. This patch
implements this. Then maps detection results to the result variables and
curl-specific imported targets the rest of the build expects.

Also honor recently introduced `*_USE_STATIC_LIBS` (experimental) flags
to map to the static target when requested.

This adds CMake Configs as an alternative to the existing `pkg-config`
and `find_path()`/`find_library()` auto-detection methods.

Enabled by default for MSVC, outside vcpkg and when not cross-building.
To enable for other cases, or override the default, you can use
`-DCURL_USE_CMAKECONFIG=ON` or `OFF`.

When enabled, Config detection happens after `pkg-config` and before
`find_path()`/`find_library()`. Using CMake's built-in options, you may
also manually point to the absolute directory holding Config files:

`Libssh2_DIR`, `MbedTLS_DIR`, `NGHTTP2_DIR`, `NGHTTP3_DIR`,
`NGTCP2_DIR` v1.19.0+ (with non-fork OpenSSL only), `Zstd_DIR` v1.4.5+

E.g. `-DMbedTLS_DIR=/path/to/mbedtls/lib/cmake/MbedTLS`

These dependencies typically need to be built with CMake to support
this.

Tagged as experimental.

Refs:
#20013 #19156 #19117
https://github.com/curl/curl/pull/20784#issuecomment-3984318492

Depends-on: fad1ebaecc #20840
Follow-up to 91e06fde1b #20784
Follow-up to 26c39d8df1 #20015

Closes #20814
2026-03-21 18:52:31 +01:00
Daniel Stenberg
aef8fd00c8
GHA: add NTLM to lots of builds 2026-03-21 15:30:04 +01:00
Daniel Stenberg
cc0c83c5f8
build: make NTLM disabled by default
NTLM has weak security and does not work over HTTP/2 or HTTP/3.

Enable in cmake or configure to get support for it.

Closes #20698
2026-03-21 15:30:03 +01:00
Daniel Stenberg
c247725b92
DEPRECATE: remove last empty line 2026-03-21 15:18:33 +01:00
Daniel Stenberg
ceae02db04
rtmp: drop support
- librtmp has no test cases, makes no proper releases and has not had a
  single commit within the last year

- librtmp parses the URL itself and requires non-compliant URLs for this

- we have no RTMP tests

- RTMP was used by 2.2% of curl users (self-identified in the 2025
  survey)

Closes #20673
2026-03-21 14:56:06 +01:00
Daniel Stenberg
ff28f67970
DEPRECATE: fix minor release number typo 2026-03-21 14:49:36 +01:00
Stefan Eissing
5649b21297
curlx_now(), prevent zero timestamp
As code checks `curltime` values for zero and interprets this
as not-initialized or "forever" in several places, make sure
`curlx_now()` never returns a zero timestamp.

Closes #21034
2026-03-21 14:47:36 +01:00
Daniel Stenberg
7e0a9b309c
CURLOPT_HAPROXY_CLIENT_IP.md: mention assuption on data format
The user is assumed to pass in correct data. I think we should start
clarifying this in more places.

Closes #21042
2026-03-21 14:46:55 +01:00
Stefan Eissing
82009c4220
share: concurrency handling, easy updates
Replace the `volatile int dirty` with a reference counter
protected by a mutex when available.

Solve the problem of when to call application's lock function
by adding a volatile flag that indicates a share has been added
to easy handles in its lifetime. That flag ever goes from
FALSE to TRUE, so volatile might work (in the absence of a mutex).

(The problem is that the lock/unlock functions need 2-3
`curl_share_setopt()` invocations to become usable and there
is no way of telling if the third will ever happen. Calling
the lock function before the 3rd setopt may crash the
application.)

When removing a share from an easy handle (or replacing it with
another share), detach the easy connection on a share with a
connection pool.

When cleaning up a share, allow this even if it is still used in
easy handles. It will be destroyed when the reference count
drops to 0.

Closes #20870
2026-03-21 14:42:49 +01:00
Stefan Eissing
745344ea4e
hostip: fix !no_signal mixup in resolve refaactor
When extracting the resolve case using alarm timers, the check for "we
are not allowed to use signals" was refactored wrong.

Follow-up to 96d5b5c688

Closes #21047
2026-03-21 14:28:54 +01:00
renovate[bot]
d560002551
GHA: update dependency rustls/rustls-ffi to v0.15.1
Closes #21044
2026-03-21 13:32:52 +01:00
Viktor Szakats
a8bc4cbcfe
build: assume snprintf() in mprintf, drop feature check
- it was already required for `curl_*printf()` float/double support.
- some curl tests always fail without it.
- it was already assumed to be present to build test servers.
  Source code did not check for `HAVE_SNPRINTF` detection variable.
- it was already required to build examples.

Windows builds stopped using this detection and the function via earlier
commits.

Follow-up to 64f28b8f88 #20765
Follow-up to 935b1bd454 #9570 #9569

Closes #20763
2026-03-21 13:30:37 +01:00
Viktor Szakats
89043ba906
cmake: drop support for CMake 3.17 and older
Require CMake 3.18 (2020-07-15) or newer, up from 3.7 (2016-11-11)
prior to this patch.

This requirement also applies to the distributed `curl-config.cmake`.

To allow dropping compatibility code maintained for old versions, and to
use features which were unpractical in separate code paths. Also to make
testing, documentation and development easier, CI builds faster due to
CMake performance improvements over time. (e.g. integration tests on
macOS run 8x faster (10 minutes is now under 1.5m) in CI, 2.5x faster on
Windows.)

CMake offers pre-built binaries for major platforms. They work without
an install step, just by unpacking and pointing the cmake command to
them. Making upgrades easy in many cases:
https://cmake.org/download/
https://cmake.org/files/
https://github.com/Kitware/CMake/releases

CMake 3.18 brings these feature as generally available when building or
consuming curl/libcurl:

LTO support, improved performance, `pkg-config` and interface target
support, `OBJECT` target (for faster libcurl builds), modern invocation
with `-S`/`-B` options, better support for custom linker options,
FetchContent, `GnuTLS::GnuTLS` target, `--verbose` and `--install`
options, `CMAKE_GENERATOR` env, last but not least unity mode and Ninja
generator.

For maximum build speed, use:
`-DCMAKE_UNITY_BUILD=ON -DCURL_DROP_UNUSED=ON`

As for deprecations, C++11 is required to build CMake itself, which may
be a limit on some platforms. autotools continues to cover them.

Follow-up to 9bcdfb3809 #20408
Follow-up to a7c974e038 #19902
Follow-up to dfbe035c8b #10161
Discussion: https://github.com/curl/curl/discussions/18704

Closes #20407
2026-03-21 13:24:47 +01:00
Viktor Szakats
d5014a2b95
scripts: drop redundant double-quotes: "$var" -> $var (Perl)
Closes #21009
2026-03-21 13:21:06 +01:00
Viktor Szakats
f45bf74b5a
curl/curl.h: replace recursive macros with C++-friendly method to enforce 3 args
Certain uses may still trigger a C compiler warning
`-Wdisabled-macro-expansion` after this, e.g. when the call is wrapped
in the `CURL_IGNORE_DEPRECATION()` macro as seen in docs/examples.

Suggested-by: Kai Pastor
Ref: https://github.com/curl/curl/issues/20682#issuecomment-3949788664

Follow-up to ee9b000438 #20686
Follow-up to daa6b27b4d #20597

Closes #20709
2026-03-21 13:21:06 +01:00
Viktor Szakats
c3c2bf5941
libtest: drop duplicate include
Include moved to `unitcheck.h` earlier.

Follow-up to 96d5b5c688 #20864
Ref: 8a1f361716 #21024

Closes #21046
2026-03-21 13:14:46 +01:00
Viktor Szakats
e0038e1096
tool_operhlp: propagate low-level OOM in add_file_name_to_url()
Bug: https://github.com/curl/curl/pull/21011#discussion_r2961678069

Closes #21043
2026-03-21 13:14:46 +01:00