]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
6 weeks agotest1627: Curl_get_scheme unit test
Daniel Stenberg [Thu, 12 Mar 2026 10:07:05 +0000 (11:07 +0100)] 
test1627: Curl_get_scheme unit test

Closes #20904

6 weeks agotest1626: Curl_copy_header_value unit test
Daniel Stenberg [Thu, 12 Mar 2026 09:29:30 +0000 (10:29 +0100)] 
test1626: Curl_copy_header_value unit test

Closes #20903

6 weeks agoopenssl: trace count of found / imported Windows native CA roots
Viktor Szakats [Thu, 12 Mar 2026 01:38:07 +0000 (02:38 +0100)] 
openssl: trace count of found / imported Windows native CA roots

To help understanding what's happening on systems where native CA misses
to verify legitimate public websites.

Also:
- drop a superfluous, hanging, `else`.

Ref: #20897

Closes #20899

6 weeks agohttp: make Curl_compareheader handle multiple commas in header
Daniel Stenberg [Thu, 12 Mar 2026 09:02:29 +0000 (10:02 +0100)] 
http: make Curl_compareheader handle multiple commas in header

For robustness

6 weeks agotest1625: unit test for Curl_compareheader
Daniel Stenberg [Thu, 12 Mar 2026 08:36:41 +0000 (09:36 +0100)] 
test1625: unit test for Curl_compareheader

Follow-up to 2938cb72e5a7f0e661617b9bf6

Closes #20901

6 weeks agohostip: remove two zero assigns after memset clear
Daniel Stenberg [Thu, 12 Mar 2026 06:59:50 +0000 (07:59 +0100)] 
hostip: remove two zero assigns after memset clear

As the struct is now always unconditionally memset with zeros, we
can remove two zero assigns.

Follow-up to 015f1c7de40839b6681b7dde7

Pointed out by CodeSonar

Closes #20900

6 weeks agohttp: fix Curl_compareheader for multi value headers
Daniel Stenberg [Wed, 11 Mar 2026 21:50:56 +0000 (22:50 +0100)] 
http: fix Curl_compareheader for multi value headers

Follow-up to 04289c62dea22d28daa60. Regression shipped in 8.13.0.

- a logic error made it not loop and thus only match if the searched string
  was first

- it no longer matches a substring

Adjusted test 1 to use multiple values in the Connection: response
header. Adjusted test 1542 to have a "Connection: close-not" which
should not match.

Reported-by: Henrique Pereira
Closes #20894

6 weeks agoautotools: limit checksrc target to ignore non-repo test sources
Viktor Szakats [Thu, 12 Mar 2026 00:27:47 +0000 (01:27 +0100)] 
autotools: limit checksrc target to ignore non-repo test sources

Syncing tests with lib and src behavior.

Also:
- fix OS400 checksrc to find the per-directory `.checksrc` file.

Closes #20898

6 weeks agobuild: hook up badwords check to lint targets
Viktor Szakats [Wed, 11 Mar 2026 08:33:09 +0000 (09:33 +0100)] 
build: hook up badwords check to lint targets

Also:
- autotools: make `badwords` target honor `@PERL@`.

Suggested-by: Stefan Eissing
Closes #20884

6 weeks agoexamples: drop warning silencers no longer hit
Viktor Szakats [Wed, 11 Mar 2026 23:25:48 +0000 (00:25 +0100)] 
examples: drop warning silencers no longer hit

Also:
- scope clang `-Wcast-function-type-strict` silencing, add missed `pop`.

Follow-up to d06b49d8b2d42d477f7e78596035832727d6d5c9 #18260

Closes #20896

6 weeks agobadwords: rework exceptions, fix many of them
Viktor Szakats [Wed, 11 Mar 2026 09:17:10 +0000 (10:17 +0100)] 
badwords: rework exceptions, fix many of them

Also:
- support per-directory and per-upper-directory whitelist entries.
- convert badlist input grep tweak into the above format.
  (except for 'And' which had just a few hits.)
- fix many code exceptions, but do not enforce.
  (there also remain about 350 'will' uses in lib)
- fix badwords in example code, drop exceptions.
- badwords-all: convert to Perl.
  To make it usable from CMake.
- FAQ: reword to not use 'will'. Drop exception.

Closes #20886

6 weeks agourlapi: verify the last letter of a scheme when set explictly
Daniel Stenberg [Wed, 11 Mar 2026 21:36:24 +0000 (22:36 +0100)] 
urlapi: verify the last letter of a scheme when set explictly

A logic error made the function not check the last character, which thus
could make it accept invalid schemes.

Added test 1965 to verify

Reported-by: Otis Cui Lei
Closes #20893

6 weeks agovtls: ECH definitions cleanup
Stefan Eissing [Wed, 11 Mar 2026 13:16:31 +0000 (14:16 +0100)] 
vtls: ECH definitions cleanup

- Move ECH related defines to vtls.h
- Prefix all defines with `CURLECH_`
- Move base64.h include from vtls.h to implementations

Closes #20887

6 weeks agopingpong: cleanup timeleft handling
Stefan Eissing [Wed, 11 Mar 2026 13:43:14 +0000 (14:43 +0100)] 
pingpong: cleanup timeleft handling

- Move `RESP_TIMEOUT` from urldata.h to pingpong.h as
  `PINGPONG_TIMEOUT_MS`.
- Rename `Curl_pp_state_timeout()` to `Curl_pp_state_timeleft_ms()` as
  the function returns the time left, not the timout..
- Update implementation comments and variable names

Closes #20888

6 weeks agoconnection_check, simplified
Stefan Eissing [Wed, 11 Mar 2026 14:25:45 +0000 (15:25 +0100)] 
connection_check, simplified

The protocol handler method `connection_check` allowed to variable
operations to trigger with variable result bits. Only the `CONNCHECK_ISDEAD`
and `CONNRESULT_DEAD` were in use. Transform the function into
`connection_is_dead` without extra parameter and a bool result.

- Remove defines for `CONNCHECK_*` and `CONNRESULT_*`
- Rename protocol function in handler comments
- Change RTSP implementation (only protocol that uses this)

Closes #20890

6 weeks agohostip: clear the sockaddr_in6 structure before use
Vladimír Marek [Wed, 11 Mar 2026 09:46:51 +0000 (10:46 +0100)] 
hostip: clear the sockaddr_in6 structure before use

On Solaris this was causing intermittent issues when the private
structure member __sin6_src_id had unexpectedly some value. connect(2)
would then fail with EADDRNOTAVAIL.

Closes #20885

6 weeks agolibssh2: fix error handling on quote errors
Daniel Stenberg [Wed, 11 Mar 2026 07:33:58 +0000 (08:33 +0100)] 
libssh2: fix error handling on quote errors

Previously it lacked the actual return. libssh.c uses the same function
name.

Verified by test 2007.

Reported-by: m777m0 on hackerone
Follow-up to 578706addec3d41cb5db64160d23795a95ca11d9

Closes #20883

6 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 11 Mar 2026 07:49:39 +0000 (08:49 +0100)] 
RELEASE-NOTES: synced

Bumped curlver as well

6 weeks agodocs: minor wording tweaks
Daniel Stenberg [Tue, 10 Mar 2026 17:05:34 +0000 (18:05 +0100)] 
docs: minor wording tweaks

found when improving the badwords whitelisting logic

6 weeks agobadwords: combine the whitelisting into a single regex
Daniel Stenberg [Tue, 10 Mar 2026 17:04:31 +0000 (18:04 +0100)] 
badwords: combine the whitelisting into a single regex

Also: make the whitelist matches case insensitve

Takes the script execution time down from 3.6 seconds to 1.1 on my
machine.

Closes #20880

6 weeks agoRELEASE-NOTES: synced curl-8_19_0
Daniel Stenberg [Wed, 11 Mar 2026 06:46:12 +0000 (07:46 +0100)] 
RELEASE-NOTES: synced

curl 8.19.0

6 weeks agoVERSIONS: add 8.19.0
Daniel Stenberg [Wed, 11 Mar 2026 06:46:12 +0000 (07:46 +0100)] 
VERSIONS: add 8.19.0

6 weeks agoTHANKS: add contributors from 8.19.0 release
Daniel Stenberg [Wed, 11 Mar 2026 06:46:12 +0000 (07:46 +0100)] 
THANKS: add contributors from 8.19.0 release

7 weeks agoFAQ.md: point codeproject.com URL to archive.org copy
Viktor Szakats [Wed, 11 Mar 2026 00:09:40 +0000 (01:09 +0100)] 
FAQ.md: point codeproject.com URL to archive.org copy

The original server closed down, linked page last seen on 2026-02-16.

Refs:
https://github.com/curl/curl/actions/runs/22051494128
https://web.archive.org/web/20250818150617/www.codeproject.com/info/Changes.aspx

Closes #20882

7 weeks agobadwords: avoid 'simply'
Felipe Mesquita [Thu, 5 Mar 2026 13:40:16 +0000 (10:40 -0300)] 
badwords: avoid 'simply'

It's mostly a filler word. I've read through each use of it in the code
base and did minor rephrasings when "simply" carried some meaning. The
overwhelming majority of cases, removing it improved the text
significantly. Inspired by #20793.

Closes #20822

7 weeks agobadwords: fix showing alternative for case-insensitive hits
Viktor Szakats [Tue, 10 Mar 2026 16:59:22 +0000 (17:59 +0100)] 
badwords: fix showing alternative for case-insensitive hits

Fixing:
```
Use of uninitialized value $alt{"Simply"} in printf at scripts/badwords line 109, <F> line 34.
 maybe use "" instead?
```

Closes #20879

7 weeks agoGHA: drop installing impacket for curl built without SMB support
Viktor Szakats [Mon, 9 Mar 2026 12:15:59 +0000 (13:15 +0100)] 
GHA: drop installing impacket for curl built without SMB support

Ref: #20846

Closes #20868

7 weeks agobadwords: dedupe invocation into a runnable script
Viktor Szakats [Tue, 10 Mar 2026 00:42:40 +0000 (01:42 +0100)] 
badwords: dedupe invocation into a runnable script

Also:
- GHA/checksrc: merge two badwords CI jobs into a single one.
- re-add the more common bitness entries.

Closes #20874

7 weeks agospacecheck: find double newlines in `tests/data/test*`
Viktor Szakats [Mon, 9 Mar 2026 19:36:01 +0000 (20:36 +0100)] 
spacecheck: find double newlines in `tests/data/test*`

Closes #20872

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

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

Closes #20851

7 weeks 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

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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

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

Another filler word

Closes #20835

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

7 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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

8 weeks 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