]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 months agoBUG-BOUNTY.md: minor rephrase to say there is no bug bounty
Daniel Stenberg [Tue, 10 Mar 2026 16:10:37 +0000 (17:10 +0100)] 
BUG-BOUNTY.md: minor rephrase to say there is no bug bounty

also add a brief mention to VULN-DISCLOSURE-POLICY.md

Closes #20878

2 months agoGHA: update awslabs/aws-lc to v1.69.0
renovate[bot] [Tue, 10 Mar 2026 01:19:20 +0000 (01:19 +0000)] 
GHA: update awslabs/aws-lc to v1.69.0

Closes #20876

2 months agobadwords: twice as fast
Stefan Eissing [Tue, 10 Mar 2026 13:48:49 +0000 (14:48 +0100)] 
badwords: twice as fast

...on my macOS machine, this version uses half the time when
scanning the source.

Closes #20877

2 months agodocs: fixup wording nits
Daniel Stenberg [Mon, 9 Mar 2026 15:31:37 +0000 (16:31 +0100)] 
docs: fixup wording nits

Mostly sentences starting with bad words

2 months agobadwords: move into ./scripts, speed up
Daniel Stenberg [Mon, 9 Mar 2026 12:32:14 +0000 (13:32 +0100)] 
badwords: move into ./scripts, speed up

- 'badwords' is now a target in Makefile.am

- change badwords.txt to specify plain "words" instead of regexes so the
  script can build single regexes when scanning, which makes the script
  perform much faster (~6 times faster)

Closes #20869

2 months agox509asn1: make encodeOID stop on too long input
Daniel Stenberg [Mon, 9 Mar 2026 19:16:32 +0000 (20:16 +0100)] 
x509asn1: make encodeOID stop on too long input

Plus a minor fixup.

Reported-by: John Rodriguez
Closes #20871

2 months agodocs: handle error in `curl_global_init*` examples
Viktor Szakats [Mon, 9 Mar 2026 10:04:24 +0000 (11:04 +0100)] 
docs: handle error in `curl_global_init*` examples

Also:
- call cleanup in `curl_global_init_mem()` example.

Closes #20866

2 months agoTHANKS-filter: update with a new entry
Viktor Szakats [Mon, 9 Mar 2026 01:14:04 +0000 (02:14 +0100)] 
THANKS-filter: update with a new entry

Closes #20861

2 months agorand: drop scan-build silencer
Viktor Szakats [Sun, 8 Mar 2026 20:03:37 +0000 (21:03 +0100)] 
rand: drop scan-build silencer

scan-build has been dropped in favor of clang-tidy and this false
positive no longer triggers with it.

Follow-up to ce4db9c2efca0bd89e556e231d940c988d84a606 #20751
Follow-up to 02f207a76b45129e4d033c099e6d17581801c76e

Closes #20860

2 months agorand: drop impossible preprocessor branches (wincrypt)
Viktor Szakats [Sun, 8 Mar 2026 18:55:14 +0000 (19:55 +0100)] 
rand: drop impossible preprocessor branches (wincrypt)

After targeting Vista as minimum, the non-bcrypt fallback code was
impossible to reach, because on UWP wincrypt is never available.

After this patch it's more obvious that no-SSL UWP builds only support
weak random source.

Follow-up to b17ef873ae2151263667f4b6fb6abfe337e687dc #18009

Closes #20859

2 months agoconfigure: drop always true `if` check (Windows)
Viktor Szakats [Sun, 8 Mar 2026 18:48:12 +0000 (19:48 +0100)] 
configure: drop always true `if` check (Windows)

Follow-up to c1bc090d65b8d7d14e811dd36f5e8674be43dff3 #12495

Closes #20858

2 months agoGHA/windows: pass preprocessor flags via `CPPFLAGS`
Viktor Szakats [Sun, 8 Mar 2026 18:45:03 +0000 (19:45 +0100)] 
GHA/windows: pass preprocessor flags via `CPPFLAGS`

To avoid potential warning with autotools when using `CFLAGS`. Existing
jobs are not affected.

Also:
- drop a redundant `export`.
- ensure not to overwrite per-job options with UWP ones.

Closes #20857

2 months agoconfig-win32.h: merge two `#if` branches
Viktor Szakats [Sun, 8 Mar 2026 18:11:07 +0000 (19:11 +0100)] 
config-win32.h: merge two `#if` branches

Closes #20856

2 months agowindows: determine `RtlVerifyVersionInfo` address on global init
Viktor Szakats [Sun, 8 Mar 2026 14:12:17 +0000 (15:12 +0100)] 
windows: determine `RtlVerifyVersionInfo` address on global init

Instead of the first internal call to `curlx_verify_windows_version()`.

To avoid the chance of a race, potentially resulting in initializing
this address twice. AFAICT it could not cause an issue before this
patch.

Reported by Codex Security

Follow-up to b17ef873ae2151263667f4b6fb6abfe337e687dc #18009

Closes #20853

2 months agotidy-up: miscellaneous
Viktor Szakats [Thu, 26 Feb 2026 02:13:56 +0000 (03:13 +0100)] 
tidy-up: miscellaneous

Closes #20851

2 months agodigest: fix memory leak in auth_create_digest_http_message()
huanghuihui0904 [Mon, 9 Mar 2026 06:39:44 +0000 (14:39 +0800)] 
digest: fix memory leak in auth_create_digest_http_message()

Signed-off-by: huanghuihui0904 <625173@qq.com>
Closes #20862

2 months agoRELEASE-NOTES: synced
Daniel Stenberg [Sun, 8 Mar 2026 22:08:05 +0000 (23:08 +0100)] 
RELEASE-NOTES: synced

2 months agotest1850: verify the SMB request path use for two transfers
Daniel Stenberg [Sun, 8 Mar 2026 13:53:43 +0000 (14:53 +0100)] 
test1850: verify the SMB request path use for two transfers

2 months agosmb: free the path in the request struct properly
Stefan Eissing [Sun, 8 Mar 2026 13:30:00 +0000 (14:30 +0100)] 
smb: free the path in the request struct properly

Closes #20854

2 months agotests/server: drop unused `curlx/version_win32.c`
Viktor Szakats [Sun, 8 Mar 2026 16:47:43 +0000 (17:47 +0100)] 
tests/server: drop unused `curlx/version_win32.c`

Previously used via `curlx/timeval.c`, but no longer after bumping
minimum target to Vista.

Follow-up to b17ef873ae2151263667f4b6fb6abfe337e687dc #18009

Closes #20855

2 months agosystem_win32: replace manual init code with `curlx_now_init()` call
Viktor Szakats [Sun, 8 Mar 2026 14:26:21 +0000 (15:26 +0100)] 
system_win32: replace manual init code with `curlx_now_init()` call

The code actual init code remains identical after this patch. To make it
clearer where this initialization is called from, and to dedupe code.

Follow-up to b17ef873ae2151263667f4b6fb6abfe337e687dc #18009

Closes #20852

2 months agodocs: replace instances of the vague qualifier 'quite'
dbalsom [Fri, 6 Mar 2026 17:58:44 +0000 (12:58 -0500)] 
docs: replace instances of the vague qualifier 'quite'

in documentation and comments

Closes #20841

2 months agodocs: avoid starting sentences with However,
Daniel Stenberg [Fri, 6 Mar 2026 10:30:20 +0000 (11:30 +0100)] 
docs: avoid starting sentences with However,

An unnecessary filling word

Closes #20834

2 months agoquiche: use PRIu64 for outputting the stream id
Daniel Stenberg [Sat, 7 Mar 2026 22:17:53 +0000 (23:17 +0100)] 
quiche: use PRIu64 for outputting the stream id

The 'id' struct field in 'struct h3_stream_ctx' is a uint64_t type so
should be output with PRIu64 - and it makes sense to be consistent.

Note that the field with the same name in the ngtcp2 version of this
struct is a *signed* 64-bit variable.

Reported by Codex Security

Closes #20849

2 months agoDEPRECATE.md: SMB and NTLM become build-time opt-in
Daniel Stenberg [Sat, 7 Mar 2026 13:44:17 +0000 (14:44 +0100)] 
DEPRECATE.md: SMB and NTLM become build-time opt-in

Closes #20847

2 months agotests/FILEFORMAT.md: the <server> section is NOT mandatory
Daniel Stenberg [Sat, 7 Mar 2026 12:44:33 +0000 (13:44 +0100)] 
tests/FILEFORMAT.md: the <server> section is NOT mandatory

It can be left out if no servers are necessary.

Closes #20845

2 months agotest1849: reuse a proxy with different credentials
Daniel Stenberg [Fri, 6 Mar 2026 22:08:31 +0000 (23:08 +0100)] 
test1849: reuse a proxy with different credentials

Closes #20842

2 months agocf-socket: ignore SOCK_CLOEXEC etc for socktype equality checks
Daniel Stenberg [Sat, 7 Mar 2026 10:24:18 +0000 (11:24 +0100)] 
cf-socket: ignore SOCK_CLOEXEC etc for socktype equality checks

As the SOCK_CLOEXEC and SOCK_NONBLOCK get ORed to the socktype, this
introduces the cf_socktype() function to use when checking for the
specific socket type: DGRAM or STREAM. The function filters off the
non-type related bits to enable the comparison.

Follow-up to 05367694ecf24a5d39f

Closes #20808

2 months agohttp: only send bearer if auth is allowed
Daniel Stenberg [Fri, 6 Mar 2026 22:13:07 +0000 (23:13 +0100)] 
http: only send bearer if auth is allowed

Verify with test 2006

Closes #20843

2 months agodocs: drop basically
Daniel Stenberg [Fri, 6 Mar 2026 10:37:33 +0000 (11:37 +0100)] 
docs: drop basically

Another filler word

Closes #20835

2 months agoFAQ: syntax improvements
Andrei Rybak [Wed, 4 Mar 2026 09:11:58 +0000 (10:11 +0100)] 
FAQ: syntax improvements

During conversion of `docs/FAQ` into Markdown, 'man ld' has incorrectly
kept one of its quotes when it was surrounded by backticks for inline
code formatting.  A space on the left of it was lost as well.

Fix the formatting in the new `docs/FAQ.md`.

Closes #20812

2 months agomqtt: fix EOF handling
Stefan Eissing [Fri, 6 Mar 2026 07:38:03 +0000 (08:38 +0100)] 
mqtt: fix EOF handling

In mqtt_recv_atleast(), recognize an EOF as error.

Fixes #20815
Reported-by: Max Dymond
Closes #20830

2 months agoproxy-auth: additional tests
Stefan Eissing [Fri, 6 Mar 2026 13:54:09 +0000 (14:54 +0100)] 
proxy-auth: additional tests

Also eliminate the special handling for socks proxy match.

Closes #20837

2 months agosocketpair: clear 'err' when retrying due to EINTR
Daniel Stenberg [Tue, 3 Mar 2026 22:50:08 +0000 (23:50 +0100)] 
socketpair: clear 'err' when retrying due to EINTR

If the first write was interrupted by a signal and a subsequent write
succeeds, the function would still erroneously return EINTR.

Found by Codex Security
Closes #20809

2 months agosynctime: fix use of uninitialized buffer on non-Windows
Daniel Stenberg [Tue, 3 Mar 2026 22:11:51 +0000 (23:11 +0100)] 
synctime: fix use of uninitialized buffer on non-Windows

Follow-up to: b714c674f3

Spotted by Codex Security
Closes #20806

2 months agocontent_encoding: return 'identity' if none other exists
Daniel Stenberg [Tue, 3 Mar 2026 22:06:24 +0000 (23:06 +0100)] 
content_encoding: return 'identity' if none other exists

This fixes a regression and accidental changed behavior shipped in
8.18.0 (via 6b9c75e219cdcfd3e17e78).

When the setopt is set to "" and curl is built without support for a
single compression algorithm, it used to use "identity" but recently did
not.

Spotted by Codex Security
Closes #20805

2 months agotool_doswin: avoid memory-leak with CURL_FN_SANITIZE_*
Daniel Stenberg [Tue, 3 Mar 2026 21:57:46 +0000 (22:57 +0100)] 
tool_doswin: avoid memory-leak with CURL_FN_SANITIZE_*

This is debug-only code

Follow-up to 20900e4a1e3

Found by Codex Security

Closes #20804

2 months agotool_operate: reset the URL --url-query between --next
Daniel Stenberg [Tue, 3 Mar 2026 17:50:20 +0000 (18:50 +0100)] 
tool_operate: reset the URL --url-query between --next

Pointed out by Codex Security

Verify in test 1624
Closes #20802

2 months agoopenssl+ech: workaround for insecure handshakes
Stefan Eissing [Thu, 5 Mar 2026 12:56:49 +0000 (13:56 +0100)] 
openssl+ech: workaround for insecure handshakes

OpenSSL 4.0.0-dev supports ECH with one flaw. If peer verification
is not enabled, it will report SSL_ECH_STATUS_BAD_NAME on the ECH
status.

Provide a workaround in libcurl that checks the inner name used in
ECH was the peer's hostname, both verify peer and host are disabled
and then accept the BAD_NAME without failing the connect.

Fixes #20655
Reported-by: Dexter Gerig
Closes #20821

2 months agoasync-ares: blocking resolve timeout handling, better
Stefan Eissing [Thu, 5 Mar 2026 09:20:58 +0000 (10:20 +0100)] 
async-ares: blocking resolve timeout handling, better

Perform the actual timeout calculation in the blocking resolv
loop each time in the same way, keeping the logic simpler.

The previous version calculated the timeout once, and then
reduced it by the elapsed time spent in polling/processing.
This is unnecessarily complicated.

Closes #20819

2 months agourldata: byebye `conn->hostname_resolve`
Stefan Eissing [Fri, 6 Mar 2026 10:09:29 +0000 (11:09 +0100)] 
urldata: byebye `conn->hostname_resolve`

The strdup() of the hostname to resolve is unnecessary as the sync
resolve code does not keep the string and the async code makes copies
already.

Remove the member from `connectdata`.

Closes #20833

2 months agocmake: fix `LOCATION` property access condition (debug)
Viktor Szakats [Fri, 6 Mar 2026 14:18:31 +0000 (15:18 +0100)] 
cmake: fix `LOCATION` property access condition (debug)

To match other parts of curl's CMake script and the CMake source.

Ref: https://gitlab.kitware.com/cmake/cmake/-/blob/v3.18.0/Source/cmTargetPropertyComputer.h?ref_type=tags#L68-101

Follow-up to c6cfb2a2f34df80c6d746d1cb07705d3fac7e67a #20828

Closes #20838

2 months agocmake: improve clang-tidy test command-line reproduction
Viktor Szakats [Fri, 6 Mar 2026 00:51:30 +0000 (01:51 +0100)] 
cmake: improve clang-tidy test command-line reproduction

- also query `INTERFACE_COMPILE_DEFINITIONS` and
  `INTERFACE_COMPILE_OPTIONS`.
  To further sync clang-tidy manual command-lines with the C compiler
  command-lines generated by CMake. In practice this adds `-I` options
  (via `INTERFACE_COMPILE_OPTIONS`) to the end of the command-line for
  dependency header directories. It does not change the outcome of
  clang-tidy runs.

- limit querying `COMPILE_DEFINITIONS` and `COMPILE_OPTIONS` to the top
  target, the test itself. To not include options such as
  `-DCURL_HIDDEN_SYMBOLS` and `-fvisibility=hidden` (when set) via
  the libcurl shared lib.
  To sync with the actual C compiler command-line.

- drop redundant `unset()`.

- rename local function to be more specific.

Follow-up to d9386a2f8ec3c4bd5ababc4eeb96ecd3e522b77c #20759

Closes #20829

2 months agocmake: fix `LOCATION` property read errors in target debug function
Viktor Szakats [Fri, 6 Mar 2026 02:42:41 +0000 (03:42 +0100)] 
cmake: fix `LOCATION` property read errors in target debug function

Exclude reading certain props for certain target types to avoid these errors:
```
CMake Error at CMake/Utilities.cmake:71 (get_property):
  The LOCATION property may not be read from target "...".  Use the target
  name directly with add_custom_command, or use the generator expression
  $<TARGET_FILE>, as appropriate.
```
(and the same in line 78.)

Follow-up to 855acb3bb07e0dd06b5722218eb5fded333f7ce0 #17701

Closes #20828

2 months agospelling: bump codespell to 2.4.2, fix fallouts
Viktor Szakats [Thu, 5 Mar 2026 23:22:13 +0000 (00:22 +0100)] 
spelling: bump codespell to 2.4.2, fix fallouts

Closes #20825
Closes #20827

2 months agounit3205: drop `NOLINT`
Viktor Szakats [Wed, 4 Mar 2026 23:34:29 +0000 (00:34 +0100)] 
unit3205: drop `NOLINT`

In favor or a small code change the silences the clang-tidy warning.

Follow-up to b1f853a3849d0e8116ae4e2aedfb9ca65f92282d #20731

Closes #20820

2 months agocmake: mark two internal options as advanced
Viktor Szakats [Thu, 5 Mar 2026 01:30:06 +0000 (02:30 +0100)] 
cmake: mark two internal options as advanced

To omit them from CMake GUI option listings.

Follow-up to c37e06c642066b6cbf6b3c58278017ad40820bb3 #17962
Follow-up to 6ab1fa423bcc49a742b1cde2164ff981fdee38e8 #16278

Closes #20818

2 months agosocks: ensure DNS is freed in failure cases.
Max Dymond [Wed, 4 Mar 2026 10:24:15 +0000 (10:24 +0000)] 
socks: ensure DNS is freed in failure cases.

In several error cases in socks.c the DNS struct is not freed, which
leads to memory leaks.

Found by: OSS-Fuzz: 447858136

Closes #20813

2 months agoexamples: improve OpenSSL certificate examples
Viktor Szakats [Tue, 3 Mar 2026 17:44:29 +0000 (18:44 +0100)] 
examples: improve OpenSSL certificate examples

- add/fix/synchronize error messages and comments.
- consistently return error from the callback on failure.
- fix potential leaks on OpenSSL API failures.
- fix to not pass the nul-terminator to BIO read.
- scope a variable.
- sync code/formatting between the two examples.

Closes #20807

2 months agousercertinmem: use the correct cert BIO
Daniel Stenberg [Tue, 3 Mar 2026 17:21:16 +0000 (18:21 +0100)] 
usercertinmem: use the correct cert BIO

PEM_read_bio_PrivateKey() is called with the wrong BIO, so the private
key is not loaded.

Follow-up to 8494012196474ee0541

Pointed out by Codex Security
Closes #20800

2 months agocurl.h: remove CURLPROTO_MQTTS from the public header
Daniel Stenberg [Tue, 3 Mar 2026 16:55:37 +0000 (17:55 +0100)] 
curl.h: remove CURLPROTO_MQTTS from the public header

- the value collided with the internal one used for WebSocket
- we add all new ones as internal bits
- bump to 64-bit internal type
- introduce new define for setting all protocols (CURLPROTO_64ALL)

Reported by Codex Security

Closes #20798

2 months agoconfig2setopts: restore proper ignoring of CAINFO BLOB option errors
Daniel Stenberg [Tue, 3 Mar 2026 17:03:52 +0000 (18:03 +0100)] 
config2setopts: restore proper ignoring of CAINFO BLOB option errors

A regression from refactors

Spotted by Codex Security

Closes #20799

2 months agoschannel: fix UAF in client cert store thumbprint handling
Daniel Stenberg [Tue, 3 Mar 2026 17:38:19 +0000 (18:38 +0100)] 
schannel: fix UAF in client cert store thumbprint handling

Follow-up to 10bb489b22d1777f2984aa5

Found by Codex Security
Closes #20801

2 months agoopenssl: adapt to OpenSSL master adding const to more APIs
Daniel Stenberg [Tue, 3 Mar 2026 15:59:21 +0000 (16:59 +0100)] 
openssl: adapt to OpenSSL master adding const to more APIs

Closes #20797

2 months agocmake: fix building with `CMAKE_FIND_PACKAGE_PREFER_CONFIG=ON`
Viktor Szakats [Sun, 1 Mar 2026 15:19:33 +0000 (16:19 +0100)] 
cmake: fix building with `CMAKE_FIND_PACKAGE_PREFER_CONFIG=ON`

This CMake global custom option tells it to find dependencies as cmake
Configs first, and only then look for `Find*` modules. This may result
in `find_package()` succeeding, but without actually creating `CURL::*`
imported targets the curl build scripts are expecting.

For dependencies with curl-specific, local, `Find*` modules, we always
want to use them, via the module detection method, and never a
Config-based detection. Ensure this by passing the `MODULE` option to
`find_package()` and `find_dependency()` to make them use `Find*`
modules unconditionally, making them work as expected with the
`CMAKE_FIND_PACKAGE_PREFER_CONFIG=ON` option set.

curl uses local Find modules for all dependencies except OpenSSL and
ZLIB. The latter two keep using either CMake's built-in Find modules or
Config method as before this patch.

Also:

- apply the same change to `curl-config.cmake`. To fix consuming curl
  with this option set.
Authored-by: Valerie Snyder
  Ref: #20764
  Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973

- GHA/distcheck: add a job testing both building and consuming curl with
  this option set. (takes 15 seconds)
  Use custom NGHTTP2 configuration for an extra twist (not required
  to trigger this issue.)
  Follow-up to fcde8d7e3745df3b4d83c86d0a1f0caef398511b #20773

Reported-by: Valerie Snyder
Fixes #20729

Closes #20784

2 months agourlapi: use U_CURLU_URLDECODE when toggling it off unsigned
Daniel Stenberg [Sat, 28 Feb 2026 09:48:59 +0000 (10:48 +0100)] 
urlapi: use U_CURLU_URLDECODE when toggling it off unsigned

In this use case 'unsigned value &= ~DEFINE;

As otherwise the right side is treated as signed, which annoyingly
triggers UBSan. The U_* defines are local versions of the public define,
only typecast to unsigned.

Reported-by: xmoezzz on github
Fixes #20753
Closes #20769

2 months agodocs: avoid using the word 'magic'
Daniel Stenberg [Tue, 3 Mar 2026 12:53:36 +0000 (13:53 +0100)] 
docs: avoid using the word 'magic'

It's never actually magic.

Closes #20796

2 months agostop using the word 'just'
Daniel Stenberg [Mon, 2 Mar 2026 22:41:35 +0000 (23:41 +0100)] 
stop using the word 'just'

Everywhere. In documentation and code comments.

It is almost never a good word and almost always a filler that should be
avoided.

Closes #20793

2 months agoDockerfile: update debian:bookworm-slim digest to 74d56e3
renovate[bot] [Tue, 24 Feb 2026 21:28:38 +0000 (21:28 +0000)] 
Dockerfile: update debian:bookworm-slim digest to 74d56e3

Closes #20714

2 months agocmake: stop disabling C4774 after replacing `snprintf()`, update comment (MSVC)
Viktor Szakats [Mon, 2 Mar 2026 21:47:06 +0000 (22:47 +0100)] 
cmake: stop disabling C4774 after replacing `snprintf()`, update comment (MSVC)

- update comment for `-wd4710` option.
  Ref: https://ci.appveyor.com/project/curlorg/curl/builds/53627545
- stop suppressing C4774. Not triggered by the replacement call
  `vsnprintf()`, as also confirmed by local tests.
  Follow-up to https://github.com/curl/curl/commit/192b9214a7cf9082665ce460617308cb4836850b
  Ref: https://devblogs.microsoft.com/cppblog/format-specifiers-checking/
  Ref: https://learn.microsoft.com/cpp/error-messages/compiler-warnings/compiler-warnings-c4600-through-c4799

Follow-up to 64f28b8f8859fc80816f7db3b5c4b6f2fd84bd27 #20765

Closes #20792

2 months agombedtls: guard TLS 1.3 + session tickets usage inside ifdef
Daniel Díaz [Fri, 27 Feb 2026 21:07:01 +0000 (15:07 -0600)] 
mbedtls: guard TLS 1.3 + session tickets usage inside ifdef

If TLS 1.3 is not supported, the call to
`mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets()` fails
during compilation:
```
curl-8.18.0/lib/vtls/mbedtls.c: In function 'mbed_connect_step1':
curl-8.18.0/lib/vtls/mbedtls.c:809:3: error: implicit declaration of function 'mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets' [-Werror=implicit-function-declaration]
   mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets(&backend->config,
   ^
curl-8.18.0/lib/vtls/mbedtls.c:809:3: warning: nested extern declaration of 'mbedtls_ssl_conf_tls13_enable_signal_new_session_tickets' [-Wnested-externs]
```

Protect this call inside the `#ifdef` block by making sure that support
for TLS 1.3 is defined.

Closes #20789

2 months agobuild: drop unused `snprintf()` feature check on Windows
Viktor Szakats [Mon, 2 Mar 2026 20:47:38 +0000 (21:47 +0100)] 
build: drop unused `snprintf()` feature check on Windows

Follow-up to 64f28b8f8859fc80816f7db3b5c4b6f2fd84bd27 #20765

Closes #20790

2 months agomprintf: silence clang-tidy `readability-suspicious-call-argument`
Viktor Szakats [Mon, 2 Mar 2026 20:56:05 +0000 (21:56 +0100)] 
mprintf: silence clang-tidy `readability-suspicious-call-argument`

Follow-up to 64f28b8f8859fc80816f7db3b5c4b6f2fd84bd27 #20765

Closes #20791

2 months agocurlx: add local `snprintf()` helper that always nul-terminates (Windows)
Viktor Szakats [Fri, 27 Feb 2026 15:43:16 +0000 (16:43 +0100)] 
curlx: add local `snprintf()` helper that always nul-terminates (Windows)

Make the helper use `vsnprintf()` internally on all supported Windows
toolchains (dropping `_snprintf()` and `snprintf()`), ensure to
nul-terminate. Omit the return value to avoid complexity.

Use the helper from `mprintf.c` / `out_double()`, from tests/server code
and the tests/server-specific build of `curlx_inet_ntop()`,
`curlx_strerror()` functions. In the single call (in tests) where the
returned length was used previously, determine it with `strlen()`.

Refs:
https://github.com/libssh2/libssh2/blob/libssh2-1.11.1/src/misc.c#L57-L79
https://learn.microsoft.com/cpp/c-runtime-library/reference/snprintf-snprintf-snprintf-l-snwprintf-snwprintf-l
https://learn.microsoft.com/cpp/c-runtime-library/reference/vsnprintf-vsnprintf-vsnprintf-l-vsnwprintf-vsnwprintf-l

Assisted-by: Jay Satiro
Follow-up to fa8bd1cc09125b368d4295c19331bf33e2d0c602 #20761
Follow-up to 8ab468c8aa2e3b7b2354f0e9545859ca631f4457 #15997

Closes #20765

2 months agomulti: fix unreachable code compiler warning
Viktor Szakats [Sat, 28 Feb 2026 21:43:19 +0000 (22:43 +0100)] 
multi: fix unreachable code compiler warning

```
lib/multi.c:305:5: error: code will never be executed [clang-diagnostic-unreachable-code]
  305 |     goto error;
      |     ^~~~~~~~~~
```

Cherry-picked from #20774

Closes #20788

2 months agoclang-tidy: fix `readability-suspicious-call-argument`
Viktor Szakats [Wed, 18 Feb 2026 13:24:00 +0000 (14:24 +0100)] 
clang-tidy: fix `readability-suspicious-call-argument`

Also:
- curlx/strerr: avoid a false positive by dropping an interim variable.
- enable this check.

Ref: #20627 (initial attempt)

Closes #20777

2 months agocmake: minor improvements to integration test framework
Viktor Szakats [Sat, 28 Feb 2026 18:28:42 +0000 (19:28 +0100)] 
cmake: minor improvements to integration test framework

- add support for separate provider / consumer cmake options in
  `find_package` tests. To help test more integration scenarios.
  Refs: #20784 #20729 #20764

- dump generated curl config files in `find_package` tests.
  (cmake CONFIG source, `libcurl.pc`, `curl-config`.

- test.sh: use `sha256sum` (was: `openssl`).

Closes #20773

2 months agoclang-tidy: enable `clang-analyzer-*` checks explicitly, fix fallout
Viktor Szakats [Sun, 1 Mar 2026 03:03:15 +0000 (04:03 +0100)] 
clang-tidy: enable `clang-analyzer-*` checks explicitly, fix fallout

v22.1.0 disabled them by default.

Fix fallout:
- http: check NULL to silence false positives in `HD_VAL()`.

Ref: https://releases.llvm.org/22.1.0/tools/clang/tools/extra/docs/ReleaseNotes.html#improvements-to-clang-tidy

Follow-up to da6fbb12a6598a7c9e9e54d66e1454973ffc888e #20779
Follow-up to ce4db9c2efca0bd89e556e231d940c988d84a606 #20751

Closes #20778

2 months agohttp1: fix potential NULL dereference in `Curl_h1_req_parse_read()`
Viktor Szakats [Sun, 1 Mar 2026 03:46:39 +0000 (04:46 +0100)] 
http1: fix potential NULL dereference in `Curl_h1_req_parse_read()`

Reported by clang-tidy v22 with `clang-analyzer-*` explicitly enabled:

```
lib/http1.c:89:31: error: Subtraction of a non-null pointer
 (from variable 'line_end') and a null pointer (via field 'line')
 results in undefined behavior [clang-analyzer-core.NullPointerArithm]
   89 |   parser->line_len = line_end - parser->line + 1;
      |                               ^
```
Ref: https://github.com/curl/curl/actions/runs/22534731241/job/65279952830?pr=20778#step:11:85

Ref: #20778

Closes #20779

2 months agoTODO: drop the alt-svc fallback
Daniel Stenberg [Mon, 2 Mar 2026 08:09:10 +0000 (09:09 +0100)] 
TODO: drop the alt-svc fallback

Let's return to this subject if someone actually needs this for their
specific use case.

See #17152
Closes #20786

2 months agotest1637: verify --fail and --retry with 502 response code
Daniel Stenberg [Sun, 1 Mar 2026 12:21:11 +0000 (13:21 +0100)] 
test1637: verify --fail and --retry with 502 response code

It should exit with 22 after the second retry.

Ref: #20771
Cloes #20780

2 months agoHISTORY: mention that Rafael passed away much too early
Daniel Stenberg [Sun, 1 Mar 2026 12:40:06 +0000 (13:40 +0100)] 
HISTORY: mention that Rafael passed away much too early

Closes #20781

2 months agoGHA: bump actions and pip dependencies
dependabot[bot] [Sun, 1 Mar 2026 14:58:16 +0000 (14:58 +0000)] 
GHA: bump actions and pip dependencies

- update action `actions/cache` from 5.0.1 to 5.0.3
- update action `github/codeql-action` from 4.31.9 to 4.32.4
- update pip `filelock` from 3.20.3 to 3.24.3
- update pip `ruff` from 0.14.14 to 0.15.2

Closes #20782
Closes #20783

2 months agocmake: rename `testbins` target to `tt`, restore internal option
Viktor Szakats [Sat, 28 Feb 2026 00:33:05 +0000 (01:33 +0100)] 
cmake: rename `testbins` target to `tt`, restore internal option

To make it easy to type. The internal option is used in CI.

Follow-up to aae361242f30eafacf46085ed731b1524bfd3be9 #20708

Closes #20768

2 months agoGHA/windows: bump clang-tidy job to clang v20 (from v18)
Viktor Szakats [Sat, 28 Feb 2026 22:53:08 +0000 (23:53 +0100)] 
GHA/windows: bump clang-tidy job to clang v20 (from v18)

Adds 50 seconds to the 5m long build step. Also more prerequisites to
install, with no apparent effect on step time.

Follow-up to 9b52d516bb8990107f20c9786e09dbb6961c30b2 #20732

Closes #20775

2 months agoclang-tidy: fix issues found with build-fuzzing
Viktor Szakats [Sat, 28 Feb 2026 21:41:23 +0000 (22:41 +0100)] 
clang-tidy: fix issues found with build-fuzzing

- curl_sha512_256: add missing, drop redundant, parentheses.
- doh: drop redundant returns.
- url: add missing parentheses.
- vtls: fix unused const variables.
- tests/unit: fix missing header with clang-tidy and !threaded-resolver.
  Follow-up to 57ff2d6c918d0bb444e5a8a53405217aec116b1b #20106

Closes #20774

2 months agoclang-tidy: silence more minor issues found by v22
Viktor Szakats [Sat, 28 Feb 2026 10:29:16 +0000 (11:29 +0100)] 
clang-tidy: silence more minor issues found by v22

Also one found manually in lib/curl_sha512_256.c.

Follow-up to 7a08c5d820fcf237688562a237a05000214db789 #20762

Closes #20770

2 months agodocs: some nitpicks
Florian Imdahl [Thu, 26 Feb 2026 18:48:57 +0000 (19:48 +0100)] 
docs: some nitpicks

- replaced double spaces with single space where applicable
- replaced "favourite" with "favorite"
- added language identifiers to code blocks in markdown files
- added extra line after code blocks and after headings in markdown
  files

Cloes #20748

2 months agoINSTALL.md: fix typo
Daniel Stenberg [Fri, 27 Feb 2026 21:29:09 +0000 (22:29 +0100)] 
INSTALL.md: fix typo

Reported-by: Nathan-M-code on github
Fixes #20766
Closes #20767

2 months agoappveyor: minor improvements [ci skip]
Viktor Szakats [Thu, 26 Feb 2026 23:03:18 +0000 (00:03 +0100)] 
appveyor: minor improvements [ci skip]

- make per-job cmake options override default ones (as in GHA)
- also upload `.lib` artifacts (in commented code)

Cherry-picked from #20750

2 months agoldap: silence clang-tidy v22 warning
Viktor Szakats [Fri, 27 Feb 2026 14:03:28 +0000 (15:03 +0100)] 
ldap: silence clang-tidy v22 warning

Closes #20762

2 months agomprintf: use `_snprintf()` when compiled with VS2013 and older
Viktor Szakats [Thu, 26 Feb 2026 23:38:07 +0000 (00:38 +0100)] 
mprintf: use `_snprintf()` when compiled with VS2013 and older

To support floats and doubles when using these old compilers.

Before this patch, these tests most likely failed with them:
```
FAIL 557: 'curl_mprintf() testing' printf, unittest
FAIL 566: 'HTTP GET with CURLINFO_CONTENT_LENGTH_DOWNLOAD and 0 bytes transfer' HTTP, HTTP GET
FAIL 599: 'HTTP GET with progress callback and redirects changing content sizes' HTTP, HTTP POST, chunked Transfer-Encoding
FAIL 1148: 'progress-bar' HTTP, progressbar
```

Also:
- mention `_snprintf()` in the `_CRT_SECURE_NO_WARNINGS` comment.

Follow-up to 7de35515d90d364e851cdde712062b942d6bf36a #20218

Closes #20761

2 months agocmake: convert `curl_add_clang_tidy_test_target()` macro to function
Viktor Szakats [Fri, 27 Feb 2026 12:43:51 +0000 (13:43 +0100)] 
cmake: convert `curl_add_clang_tidy_test_target()` macro to function

I thought a macro is necessary to have `get_directory_property()` and
`CMAKE_CURRENT_SOURCE_DIR` work on the correct directory, but it turns
out they do work the same when used in a function.

Closes #20760

2 months agocmake: replace `list(FIND)` with `if(var IN_LIST list)`
Viktor Szakats [Fri, 27 Feb 2026 11:03:32 +0000 (12:03 +0100)] 
cmake: replace `list(FIND)` with `if(var IN_LIST list)`

Available since CMake v3.3.

Ref: https://cmake.org/cmake/help/latest/command/if.html#in-list

Closes #20758

2 months agoGHA/linux: replace scan-build with clang-tidy
Viktor Szakats [Fri, 27 Feb 2026 00:09:14 +0000 (01:09 +0100)] 
GHA/linux: replace scan-build with clang-tidy

`scan-build` is a (Perl) wrapper around clang's built-in `--analyze`
option. Which look similar or identical to clang-tidy checkers under
the `clang-analyzer-*` namespace:
https://clang.llvm.org/docs/ClangStaticAnalyzer.html

Unless somebody has other information, it appears redundant to run
scan-build in parallel with clang-tidy in CI, now that the latter is
working reliably and with good performance for all curl components.

Another scan-build issue is the lack of a markup to suppress false
positives. It ignores `NOLINT`, yet finds the same false positives as
clang-tidy. This happens with scan-build v20+. v18 is silent, but it's
a blocker to upgrade to a newer version.

scan-build may still be a useful when combined with autotools, where
clang-tidy support is incomplete, slow (no parallelism), and uses
a distinct make target, which does not build binaries in the same pass.
But, scan-build also lacks extra checkers that are now enabled for
clang-tidy.

The clang-tidy job is also 30-40s faster than the one it replaced.

Also:
- drop scan-build job configured the same way as a clang-tidy one.
  CI time saved: 6m30s
- bump to clang-20 (from 18) in the replacement job.
- build tests in the replacement job.
  To verify a cmake command-line reconstruction issue only hit in this
  job in CI.
  CI time cost: 1m40s
- replacement job caught a minor, new, issue.
  Ref: b2076d3c2f5386068d9b0199f25a81147784d8ac #20752
- drop unused scan-build logic.

Bug: https://github.com/curl/curl/pull/20732#issuecomment-3963873838
Ref: https://github.com/curl/curl/pull/20732#issuecomment-3967479228

Closes #20751

2 months agocmake: fix system include directory position for clang-tidy in tests
Viktor Szakats [Fri, 27 Feb 2026 03:08:06 +0000 (04:08 +0100)] 
cmake: fix system include directory position for clang-tidy in tests

To avoid a system include masking a custom directory, and e.g. picking
up system OpenSSL headers from `/usr/include` on Linux, instead of the
correct ones from a custom header directory, move system include
directories to the back of the header path list. Also to match what
CMake seems to be doing for the C compiler command-lines it generates.

CMake seems to use `-I`, while for these invocations we stick with
`-isystem` just in case.

This area remains fragile and likely not the final issue.

Fixing (seen in GHA/linux H3 c-ares):
```
Error while processing bld/tests/libtest/lib1521.c.
/usr/include/openssl/macros.h:147:4: error: "OPENSSL_API_COMPAT expresses an impossible API compatibility level" [clang-diagnostic-error]
Found compiler error(s).
  147 | #  error "OPENSSL_API_COMPAT expresses an impossible API compatibility level"
      |    ^
FAILED: [code=1] tests/libtest/CMakeFiles/libtests-clang-tidy
```
Ref: https://github.com/curl/curl/actions/runs/22468472670/job/65079885471?pr=20751

Bug: https://github.com/curl/curl/pull/20751#issuecomment-3970180687
Cherry-picked from #20751

Closes #20759

2 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 27 Feb 2026 08:37:29 +0000 (09:37 +0100)] 
RELEASE-NOTES: synced

2 months agocfilter: move a debug-only check into ifdef DEBUGBUILD
Daniel Stenberg [Fri, 27 Feb 2026 06:59:10 +0000 (07:59 +0100)] 
cfilter: move a debug-only check into ifdef DEBUGBUILD

Pointed out by CodeSonar

Closes #20756

2 months agoftp: remove two redundant assignments
Daniel Stenberg [Fri, 27 Feb 2026 06:54:58 +0000 (07:54 +0100)] 
ftp: remove two redundant assignments

Follow-up to 29bca12978f3ad

Pointed out by CodeSonar

Closes #20755

2 months agovquic: fix unused variable warning reported by clang-tidy
Viktor Szakats [Fri, 27 Feb 2026 00:33:08 +0000 (01:33 +0100)] 
vquic: fix unused variable warning reported by clang-tidy

Silencing (seen in new GHA/Linux H3 v20 job):
```
lib/vquic/vquic.c:398:37: error: variable 'calls' set but not used [clang-diagnostic-unused-but-set-variable]
  398 |   size_t total_nread = 0, pkts = 0, calls = 0;
      |                                     ^
```

Cherry-picked from #20751

Closes #20752

2 months agoclang-tidy: add missing and delete redundant parentheses
Viktor Szakats [Thu, 26 Feb 2026 20:36:59 +0000 (21:36 +0100)] 
clang-tidy: add missing and delete redundant parentheses

Reported by clang-tidy v22.1.0.

Ref: https://releases.llvm.org/22.1.0/tools/clang/tools/extra/docs/ReleaseNotes.html

Closes #20749

2 months agomailmap: Hamza Bensliman
Daniel Stenberg [Thu, 26 Feb 2026 19:01:02 +0000 (20:01 +0100)] 
mailmap: Hamza Bensliman

2 months agocmake: fix confusing error when a dependency is undetected in `curl-config.cmake`
Viktor Szakats [Thu, 26 Feb 2026 11:35:51 +0000 (12:35 +0100)] 
cmake: fix confusing error when a dependency is undetected in `curl-config.cmake`

Fixing:
```
CMake Error at /path/to/CURL/CURLConfig.cmake:190 (get_target_property):
  get_target_property() called with non-existent target "CURL::libssh2".
```
and replacing it with the clearer message:
```
CMake Error at /path/to/CURL/CURLTargets.cmake:61 (set_target_properties):
  The link interface of target "CURL::libcurl_static" contains:

    CURL::libssh2

  but the target was not found.  Possible reasons include:
[...]
```

Reported-by: Val S.
Ref: #20729
Follow-up to 16f073ef49f94412000218c9f6ad04e3fd7e4d01 #16973

Closes #20737

2 months agoGHA/linux: delete unused autotools clang-tidy logic
Viktor Szakats [Thu, 26 Feb 2026 18:26:37 +0000 (19:26 +0100)] 
GHA/linux: delete unused autotools clang-tidy logic

Follow-up to 26eddf002f0d9e957ff21865bddfbdf25b4521f5 #20725

Closes #20747

2 months agoGHA/macos: bump runner to macos-26 in clang-tidy jobs
Viktor Szakats [Thu, 26 Feb 2026 17:28:30 +0000 (18:28 +0100)] 
GHA/macos: bump runner to macos-26 in clang-tidy jobs

Tiny difference in practice:
Apple clang 17.0.0.17000013 -> 17.0.0.17000603

To use the most recent tools for static analyses.

Closes #20745

2 months agoGHA/linux: enable clang-tidy for docs/examples
Viktor Szakats [Thu, 26 Feb 2026 16:17:19 +0000 (17:17 +0100)] 
GHA/linux: enable clang-tidy for docs/examples

Also:
- imap-append: silence false positive (seen on Linux only).
  Follow-up to b1f853a3849d0e8116ae4e2aedfb9ca65f92282d #20731
  Follow-up to 725c5609aef19ba53373a49386cd979006b590d6 #20723

Closes #20743

2 months agoGHA/macos: drop unused `install_step` values [ci skip]
Viktor Szakats [Thu, 26 Feb 2026 18:12:14 +0000 (19:12 +0100)] 
GHA/macos: drop unused `install_step` values [ci skip]

2 months agortsp: fix assertion failure on zero-length RTP payload
hamza [Thu, 26 Feb 2026 16:36:24 +0000 (16:36 +0000)] 
rtsp: fix assertion failure on zero-length RTP payload

Fixes #20735
Reported-by: David Korczynski
Closes #20744

2 months agoGHA: update ngtcp2/ngtcp2 to v1.21.0
renovate[bot] [Thu, 26 Feb 2026 12:40:43 +0000 (12:40 +0000)] 
GHA: update ngtcp2/ngtcp2 to v1.21.0

Closes #20738

2 months agomulti: avoid a theoretical 32-bit wrap
Daniel Stenberg [Thu, 26 Feb 2026 15:58:15 +0000 (16:58 +0100)] 
multi: avoid a theoretical 32-bit wrap

If Curl_uint32_tbl_count() at some future point actually can return
UINT_MAX, this fixes the math to not wrap.

Closes #20742