]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
3 days agotest568: fix codespell, catch it next time early in CI
Viktor Szakats [Fri, 12 Dec 2025 11:30:51 +0000 (12:30 +0100)] 
test568: fix codespell, catch it next time early in CI

Also:
- GHA/checksrc: do not exclude `tests/data/*` changes.

Follow-up to 407d2f3d574f68bfe986b621282a61016ca45c63 #19944

Closes #19945

3 days agocmake: update a comment
Viktor Szakats [Fri, 12 Dec 2025 12:09:37 +0000 (13:09 +0100)] 
cmake: update a comment

3 days agobuild: disable typecheck for analyzers and Fil-C
Viktor Szakats [Fri, 12 Dec 2025 00:05:21 +0000 (01:05 +0100)] 
build: disable typecheck for analyzers and Fil-C

- cmake: automatically disable typecheck when running clang-tidy,
  to avoid possible interference, and to improve performance.

- INSTALL-CMAKE: document both this, and unity=off for clang-tidy.

- GHA/linux: disable for some static analyzers CI jobs to avoid possible
  interference.

- GHA/linux: disable in Fil-C job to improve build performance.

Follow-up to 9e6f1c5efb7a70e1f33e467a738f3e3f652f3174 #19637
Follow-up to fd2ca2399e79e0b821af34c7c164c830c9c6574d #17955

Closes #19941

3 days agoruntests: add options to set minimum number of tests, use them
Viktor Szakats [Fri, 12 Dec 2025 00:55:30 +0000 (01:55 +0100)] 
runtests: add options to set minimum number of tests, use them

To detect mistakes made in the runtests framework that reduce
the number of test runs. Before this patch it could go undetected with
a green CI.

The minimum thresholds will need light maintenance going forward (either
bumping them periodically, or adjust if some may fell below minimums for
justified reasons). We may also make minimums tighter or looser, or more
job-specific.

Latest number of test runs for each job can be seen at Test Clutch:
https://testclutch.curl.se/static/reports/feature-matrix.html

Also:
- GHA: set minimums.

Assisted-by: Dan Fandrich
Follow-up to f2a75a14dd95e06cf9121c7d3bd5dc559748f350
Follow-up to bb1391f94394e635c1a5c58253e7a3d3b36bde57 #19510

Closes #19942

3 days agopytest: add tests using sshd
Stefan Eissing [Thu, 11 Dec 2025 15:02:41 +0000 (16:02 +0100)] 
pytest: add tests using sshd

With either /usr/sbin/sshd found or configured via --with-test-sshd=path
add tests for SCP down- and uploads, insecure, with known hosts or not,
with authorized user key or unauthorized one.

Working now with libssh and libssh2, using a hashed known_hosts file.

Closes #19934

3 days agotest568: remove what looks like an email and a URL
Daniel Stenberg [Fri, 12 Dec 2025 10:04:23 +0000 (11:04 +0100)] 
test568: remove what looks like an email and a URL

Closes #19944

3 days agotidy-up: miscellaneous
Viktor Szakats [Sun, 7 Dec 2025 15:49:55 +0000 (16:49 +0100)] 
tidy-up: miscellaneous

- drop stray duplicate empty lines in docs, scripts, test data, include,
  examples, tests.
- drop duplicate PP parenthesis.
- curl-functions.m4: move literals to the right side in if expressions,
  to match rest of the source code.
- FAQ.md: delete language designator from an URL.
- packages: apply clang-format (OS400, VMS).
- scripts/schemetable.c: apply clang-format.
- data320: delete duplicate empty line that doesn't change the outcome.
- spacecheck: extend to check for duplicate empty lines
  (with exceptions.)
- fix whitespace nits

Closes #19936

3 days agoGHA: update actions/cache action to v5
renovate[bot] [Thu, 11 Dec 2025 22:24:51 +0000 (22:24 +0000)] 
GHA: update actions/cache action to v5

Closes #19940

3 days agomdlinkcheck: only look for markdown links in markdown files
Daniel Stenberg [Thu, 11 Dec 2025 16:16:37 +0000 (17:16 +0100)] 
mdlinkcheck: only look for markdown links in markdown files

It finds debug outputs in source code otherwise.

Output the whitelist "warnings" to stderr to better allow us to count
URLs with `./mdlinkcheck --dry-run | wc -l`.

Closes #19938

3 days agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 11 Dec 2025 14:38:00 +0000 (15:38 +0100)] 
RELEASE-NOTES: synced

3 days agotransfer: remove @param for err for xfer_recv_resp function.
Christian Schmitz [Thu, 11 Dec 2025 13:37:13 +0000 (14:37 +0100)] 
transfer: remove @param for err for xfer_recv_resp function.

The err parameter in xfer_recv_resp doesn't exist anymore. Removed in
cb2bcb681fc9044d2a7adaaa621.

Closes #19937

4 days agoGHA/checkdocs: re-enable proselint, update setup, fix issues found
Viktor Szakats [Thu, 11 Dec 2025 01:46:24 +0000 (02:46 +0100)] 
GHA/checkdocs: re-enable proselint, update setup, fix issues found

- update configuration and invocation.
- install via pip.
- drop a file exception.
- alpha sort proselint settings.
- FILEFORMAT: update text about XML compliance.
- CI job takes 22 seconds total.

Ref: https://github.com/amperser/proselint/releases/tag/v0.16.0

Follow-up to 38bfe1c2aa2a6c8af29d525eb231ad66861199b1 #15314

Closes #19931

4 days agodocs: fold long lines
Viktor Szakats [Thu, 11 Dec 2025 01:13:46 +0000 (02:13 +0100)] 
docs: fold long lines

Also:
- replace a 'will' found by badwords.
- drop duplicate empty lines.

Closes #19930

4 days agotest1165: drop reference to deleted `CURL_DISABLE_TESTS`
Viktor Szakats [Thu, 11 Dec 2025 00:52:58 +0000 (01:52 +0100)] 
test1165: drop reference to deleted `CURL_DISABLE_TESTS`

Follow-up to bf823397bad09791277e983e44e8f0edc3c089b2 #16134

Closes #19929

4 days agoautotools: drop reference to deleted `CURL_CHECK_CURLDEBUG`
Viktor Szakats [Thu, 11 Dec 2025 00:43:21 +0000 (01:43 +0100)] 
autotools: drop reference to deleted `CURL_CHECK_CURLDEBUG`

The referred function has been deleted earlier.

Also:
- drop commented reference to deleted `CURL_CHECK_OPTION_THREADS`.
  0d4fdbf15d8eec908b3e63b606f112b18a63015e #16054

Follow-up to 96a1a05f662677af64b16d862c4126ed52ea4b30 #14096

Closes #19928

4 days agotests: verify setting bearer and doing redirects
Daniel Stenberg [Wed, 10 Dec 2025 09:49:54 +0000 (10:49 +0100)] 
tests: verify setting bearer and doing redirects

Test 778, 779 and 795

4 days agocurl_sasl: if redirected, require permission to use bearer
Daniel Stenberg [Wed, 10 Dec 2025 10:40:47 +0000 (11:40 +0100)] 
curl_sasl: if redirected, require permission to use bearer

Closes #19933

4 days agotest3214: allow a larger struct Curl_easy
Daniel Stenberg [Thu, 11 Dec 2025 08:11:45 +0000 (09:11 +0100)] 
test3214: allow a larger struct Curl_easy

In my local build it is now 5840 bytes. Add a 10 byte margin.

Closes #19932

4 days agoruntests: drop `notxml` keyword, verify all test data files as XML
Viktor Szakats [Wed, 10 Dec 2025 22:44:43 +0000 (23:44 +0100)] 
runtests: drop `notxml` keyword, verify all test data files as XML

Follow-up to 7f3731ce142c1d74023abad183cc8ce0fd527fab #19595

Closes #19927

4 days agoruntests: add support for single-quoted attributes, use it
Viktor Szakats [Wed, 10 Dec 2025 22:21:10 +0000 (23:21 +0100)] 
runtests: add support for single-quoted attributes, use it

With this, all test data files are XML-compliant.

Also:
- test1158, test1186: use single quotes for the test filename attribute
  containing a double quote. For XML-compliance.
- drop support for unquoted attributes. For XML-compliance.

Closes #19926

4 days agotests/data: replace `<`, `>` with `%LT`, `%GT`
Viktor Szakats [Wed, 10 Dec 2025 22:07:50 +0000 (23:07 +0100)] 
tests/data: replace `<`, `>` with `%LT`, `%GT`

For XML-compliance.

Closes #19925

4 days agotests/data: replace `<` with `%LT`
Viktor Szakats [Wed, 10 Dec 2025 21:57:58 +0000 (22:57 +0100)] 
tests/data: replace `<` with `%LT`

For XML-compliance.

Closes #19924

4 days agotests/data: replace `&` with `%AMP`
Viktor Szakats [Wed, 10 Dec 2025 21:42:35 +0000 (22:42 +0100)] 
tests/data: replace `&` with `%AMP`

For XML-compliance.

Closes #19923

4 days agoautotools: tidy-up `if` expressions
Viktor Szakats [Tue, 5 Aug 2025 14:07:21 +0000 (16:07 +0200)] 
autotools: tidy-up `if` expressions

- drop x-hacks for curl internal variables and certain autotools ones
  that do not hold custom values.
- make x-hacks consistently use `"x$var" = "xval"` style.
- add a few x-hacks for input/external variables that may hold custom
  values.
- prefer `-z` and `-n` to test empty/non-empty.
  This also makes some x-hacks unnecessary.
- optimized negated test `-z` and `-n` options.
- prefer `&&` and `||` over `-a` and `-o`.
  For better POSIX compatibility:
  https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
- quote variables passed to `test`, where missing.
- quote string literals in comparisons.
- fix some indentation, whitespace.

Note that a few `case` statements also use the x-hack, which looks
unnecessary. This patch does not change them.

Verified by comparing feature detection results with a reference CI run
from before this patch (PR #19922).

Refs:
https://www.shellcheck.net/wiki/SC2268
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/test.html
https://www.vidarholen.net/contents/blog/?p=1035
https://mywiki.wooledge.org/BashPitfalls#A.5B_.24foo_.3D_.22bar.22_.5D

Closes #18189

4 days agoautotools: fix LargeFile feature display on Windows (after prev patch)
Viktor Szakats [Wed, 10 Dec 2025 17:45:06 +0000 (18:45 +0100)] 
autotools: fix LargeFile feature display on Windows (after prev patch)

Always show it on Windows, regardless of the `--disable-largefile`
build option.

Follow-up to 163705db756557e6c07ac9386663f0576ebfd64e #19888
Closes #19922

4 days agoquiche: fix version for skip due to flakiness
Stefan Eissing [Wed, 10 Dec 2025 15:07:59 +0000 (16:07 +0100)] 
quiche: fix version for skip due to flakiness

0.24.6 is the quiche version without the fix for proper handling fo
RESET streams. Require a verion higher than that to run test_05_02.

Follow-up to 14478429e71ef0eee6d12b73113e9ff8e3ae9e75 #19916

Closes #19921

4 days agoconfig-win32.h: drop unused/obsolete `CURL_HAS_OPENLDAP_LDAPSDK`
Viktor Szakats [Wed, 10 Dec 2025 14:48:31 +0000 (15:48 +0100)] 
config-win32.h: drop unused/obsolete `CURL_HAS_OPENLDAP_LDAPSDK`

Meant for use from `Makefile.mk`. The suggested replacement is CMake or
autotools.

Follow-up to ba8752e5566076acc8bdec7ae4ec78901f7050f4 #12224

Closes #19920

4 days agoldap: drop PP logic for old, unsupported, Windows SDKs
Viktor Szakats [Wed, 10 Dec 2025 14:37:44 +0000 (15:37 +0100)] 
ldap: drop PP logic for old, unsupported, Windows SDKs

`LDAP_VENDOR_NAME` and `winber.h` are available in all supported
MS SDK and mingw-w64 versions. Stop checking for them.

Also drop redundant parenthesis in PP expression.

Closes #19918

4 days agopytest: quiche flakiness
Stefan Eissing [Wed, 10 Dec 2025 10:17:49 +0000 (11:17 +0100)] 
pytest: quiche flakiness

Let nghttpx only use http/1.1 to backend. This reproduces the bug in
quiche with higher frequency. Allow test_14_05 to now return a 400 in
addition to the 431 we get from a h2 backend to nghttpx.

Skip test_05_02 in h3 on quiche not newer than version 0.24.4 in which
its bug is fixed: https://github.com/cloudflare/quiche/pull/2278

Ref: https://github.com/cloudflare/quiche/issues/2277
Closes #19770 (original Issue)
Closes #19916

4 days agoGHA/checkurls: add dry run on push
Viktor Szakats [Wed, 10 Dec 2025 10:47:40 +0000 (11:47 +0100)] 
GHA/checkurls: add dry run on push

To verify if the basics work.

Downside is that the scheduled (live) runs are intermixed with the dry
runs and less obvious to find in the default list:
https://github.com/curl/curl/actions/workflows/checkurls.yml

This URL filters for scheduled runs only:
https://github.com/curl/curl/actions/workflows/checkurls.yml?query=event%3Aschedule

Seems fine, because we're only interested in red runs.

Closes #19917

5 days agomdlinkcheck: add --dry-run to only show all found URLs
Daniel Stenberg [Wed, 10 Dec 2025 07:45:34 +0000 (08:45 +0100)] 
mdlinkcheck: add --dry-run to only show all found URLs

- remove the debug tracing leftovers from d9d2e339ced3fa02 that made exit
  unconditonally

Closes #19914

5 days agoCURLOPT_FOLLOWLOCATION.md: s/Authentication:/Authorization:/
Daniel Stenberg [Wed, 10 Dec 2025 08:19:32 +0000 (09:19 +0100)] 
CURLOPT_FOLLOWLOCATION.md: s/Authentication:/Authorization:/

Closes #19915

5 days agotest318: tweak the name a little
Daniel Stenberg [Wed, 10 Dec 2025 08:29:43 +0000 (09:29 +0100)] 
test318: tweak the name a little

to make it properly differ from test 317

5 days agoGHA: update dependencies and actions
renovate[bot] [Wed, 10 Dec 2025 01:51:54 +0000 (01:51 +0000)] 
GHA: update dependencies and actions

- update dependency awslabs/aws-lc to v1.65.1
- update dependency pizlonator/fil-c to v0.676
- update github/codeql-action action to v4.31.7

Closes #19905
Closes #19912
Closes #19913

5 days agotidy-up: URLs (cont.) and mdlinkcheck
Viktor Szakats [Tue, 9 Dec 2025 20:24:28 +0000 (21:24 +0100)] 
tidy-up: URLs (cont.) and mdlinkcheck

- add missing ending slashes.
  To avoid duplicates and to use canonical URLs.
- reapply lost updates.
  Follow-up to 2ae983bf4ea5ef86f0e68ea0ff219a91b1aa3428 #19879
- mdlinkcheck: include the `include` directory.
- mdlinkcheck: show unused whitelist items.
- mdlinkcheck: improve debug output.
- mdlinkcheck: delete redundant whitelist items.
- examples/simplessl: lowercase the protocol part.
- BINDINGS: replace one remaining HTTP URL with HTTPS.
  Issue: https://github.com/pycurl/pycurl/issues/892
- BINDINGS: fix a broken link.
- BINDINGS: follow a refresh content redirect.
- KNOWN_BUGS: whitespace.

Closes #19911

5 days agomemdebug: fix realloc logging
Stefan Eissing [Tue, 9 Dec 2025 14:48:52 +0000 (15:48 +0100)] 
memdebug: fix realloc logging

Do the whole realloc and the subsequent logging under mutex lock. This
fixed log entries that state allocation a memory location before realloc
logs it as being freed.

Closes #19900

5 days agotest: increase altsvc test reliability
Stefan Eissing [Tue, 9 Dec 2025 16:00:52 +0000 (17:00 +0100)] 
test: increase altsvc test reliability

Move new tests from test_12 to test_06 (eyeballing) where they better
fit. Increase reliability by check Alt-Svc redirects from h3 to a lower
version for a port where no h3 is available.

Closes #19903

5 days agobuild: set `-Wno-format-signedness`
Viktor Szakats [Tue, 9 Dec 2025 19:06:33 +0000 (20:06 +0100)] 
build: set `-Wno-format-signedness`

Explicitly disable these warnings to allow using `-Weverything`.

There are around 600 of them across the codebase.

Silencing them has some drawbacks:
- enums (`CURLcode` mostly) would have to be cast to int to avoid
  different signedness depending on C compiler.
  (llvm/gcc: unsigned, MSVC/clang-cl: signed by default)
- hex masks need casts to unsigned to avoid the warning.
- fixing remaining warnings is annoying without fixing the above.
- without fixing all warnings the option cannot be enabled, to keep
  the codebase warning free.

Ref: #18343 (silenced all warnings, but without the enum cast)
Follow-up to 92f215fea1aa8bd5b1709d38f42aab77ab3fc662 #18477
Closes #19907

5 days agomdlinkcheck: do not pick up single quote and backslash after URLs
Viktor Szakats [Tue, 9 Dec 2025 22:27:34 +0000 (23:27 +0100)] 
mdlinkcheck: do not pick up single quote and backslash after URLs

Closes #19910

5 days agomdlinkcheck: exclude self from URL search
Viktor Szakats [Tue, 9 Dec 2025 21:26:41 +0000 (22:26 +0100)] 
mdlinkcheck: exclude self from URL search

To avoid picking up the whitelist.

Closes #19909

5 days agoDEPRECATE: add CMake <3.18 deprecation for April 2026
Viktor Szakats [Wed, 8 Oct 2025 14:20:54 +0000 (16:20 +0200)] 
DEPRECATE: add CMake <3.18 deprecation for April 2026

CMake 3.18 was released on 2020-07-15.

It enables using (and/or dropping workarounds) for these features:
LTO support, better performance and pkg-config support, `OBJECT` target,
`-S`, `-B`, `--verbose`, `--install` on the command-line, lib directory
support in interface targets, target_link_options(), LINK_OPTIONS,
FetchContent, `list(PREPEND ...)`, unity, Ninja, fixed imported global
issues.

Ref: https://github.com/curl/curl/discussions/18704

Closes #19902

5 days agowindows: assume `USE_WIN32_LARGE_FILES`
Viktor Szakats [Tue, 9 Dec 2025 09:31:20 +0000 (10:31 +0100)] 
windows: assume `USE_WIN32_LARGE_FILES`

All Windows platforms support it. It was permanently enabled with most
build methods. The exception is autotools where it is enabled by
default, with an option to disable it. It changed the build in a few
places for rarely tested code paths, but not bringing other advantages
(and used some 64-bit APIs anyway). This patch makes autotools'
`--disable-largefile` option a no-op for Windows.

Closes #19888

5 days agoGHA: make links get checked daily
Daniel Stenberg [Tue, 9 Dec 2025 13:39:16 +0000 (14:39 +0100)] 
GHA: make links get checked daily

Assisted-by: Viktor Szakats
Closes #19898

5 days agoconfigure: delete unused variable
Viktor Szakats [Tue, 9 Dec 2025 14:55:25 +0000 (15:55 +0100)] 
configure: delete unused variable

Follow-up to 4d73854462f30948acab12984b611e9e33ee41e6 #9044

Closes #19901

5 days agoconfig-win32.h: delete obsolete, non-Windows comments
Viktor Szakats [Tue, 9 Dec 2025 14:32:42 +0000 (15:32 +0100)] 
config-win32.h: delete obsolete, non-Windows comments

Closes #19899

5 days agopytest: socksd startup delay
Stefan Eissing [Tue, 9 Dec 2025 11:54:00 +0000 (12:54 +0100)] 
pytest: socksd startup delay

Add a small delay after the startup of the danted socks daemon to
give it more time to become responsive.

Closes #19895

5 days agomulti: remove MSTATE_TUNNELING
Stefan Eissing [Tue, 9 Dec 2025 11:51:17 +0000 (12:51 +0100)] 
multi: remove MSTATE_TUNNELING

MSTATE_TUNNELING is no longer in use now that we have proxy connection
filters. Remove the state.

Remove the http handler `connect_it` method as it was merely a NOP.

Closes #19894

5 days agoalt-svc: more flexibility on same destination
Stefan Eissing [Mon, 8 Dec 2025 12:36:19 +0000 (13:36 +0100)] 
alt-svc: more flexibility on same destination

When the Alt-Svc points to the same host and port, add the destination
ALPN to the `wanted` versions and set it also as the `preferred` version
in negotiations.

This allows Alt-Svc for h3 to point to h2 and have it tried first. Also,
this allows Alt-Svc to say http/1.1 is preferred and changes the ALPN
protocol ordering for the TLS handshake.

Add tests in various combination to verify this works.

Reported-by: yushicheng7788 on github
Fixes #19740
Closes #19874

6 days agoGHA/windows: re-enable `taskkill`
Viktor Szakats [Tue, 9 Dec 2025 13:27:44 +0000 (14:27 +0100)] 
GHA/windows: re-enable `taskkill`

Nothing conclusive for the last ~30 days when `taskkill` was made
a no-op. Jobs remained flaky with all known failure modes. Sometimes
they finish green on the first run, sometimes they fail. Hard to say
more without comparing detailed stats for this period and the
preceding (or upcoming) one.

In almost all runs, the PID to be killed did not exist at the time of
check.

Follow-up to 2701ac6a4d16a62130dad05be1c484903b8545c7 #19421
Closes #19897

6 days agogtls: Call keylog_close in cleanup
Yedaya Katsman [Tue, 2 Dec 2025 19:59:53 +0000 (21:59 +0200)] 
gtls: Call keylog_close in cleanup

6 days agotest: add test 2090 for SSLKEYLOGFILE structure
Yedaya Katsman [Tue, 2 Dec 2025 17:40:07 +0000 (19:40 +0200)] 
test: add test 2090 for SSLKEYLOGFILE structure

Only the TLS 1.2 structure for now since it's simpler, and only has a
single label type. This has the bonus of also testing libressl that only
supports logging keys in TLS 1.2

Closes #19816

6 days agoexamples: use 64-bit `fstat` on Windows
Viktor Szakats [Tue, 9 Dec 2025 11:55:26 +0000 (12:55 +0100)] 
examples: use 64-bit `fstat` on Windows

Closes #19896

6 days agoTODO: remove ancient entries no longer considered
Daniel Stenberg [Tue, 9 Dec 2025 10:53:45 +0000 (11:53 +0100)] 
TODO: remove ancient entries no longer considered

- TCP Fast Open support on Windows

TFO doesn't really work on the internet and isn't really used anywhere.
We use QUIC now.

- get rid of PATH_MAX

Not a priority and when using 3rd party libraries not really up to us.

- auto-detect proxy

A dream we can just stop having.

- config file parsing

Let's not do that in our library.

- add asynch getaddrinfo support

Let's not add a limited glibc specific backend with bad API

- FTP HOST

If we managed this far without name based vhost FTP, let's not.

Closes #19890

6 days agotest1025, 1221: fold long command-lines
Viktor Szakats [Tue, 9 Dec 2025 11:18:31 +0000 (12:18 +0100)] 
test1025, 1221: fold long command-lines

Closes #19893

6 days agotest1464: mark XML-compliant
Viktor Szakats [Tue, 9 Dec 2025 11:14:21 +0000 (12:14 +0100)] 
test1464: mark XML-compliant

Closes #19892

6 days agoDockerfile: update debian:bookworm-slim digest to e899040
renovate[bot] [Tue, 9 Dec 2025 11:03:54 +0000 (11:03 +0000)] 
Dockerfile: update debian:bookworm-slim digest to e899040

Closes #19891

6 days agoDockerfile: update debian:bookworm-slim digest to 1371f81
renovate[bot] [Tue, 9 Dec 2025 04:48:05 +0000 (04:48 +0000)] 
Dockerfile: update debian:bookworm-slim digest to 1371f81

Closes #19883

6 days agoFAQ: fix minor link syntax mistake
Daniel Stenberg [Tue, 9 Dec 2025 10:13:31 +0000 (11:13 +0100)] 
FAQ: fix minor link syntax mistake

6 days agoFAQ/TODO/KNOWN_BUGS: convert to markdown
Daniel Stenberg [Mon, 8 Dec 2025 12:07:49 +0000 (13:07 +0100)] 
FAQ/TODO/KNOWN_BUGS: convert to markdown

- convert to markdown
- auto-generate the TOCs on the website, remove them from the docs
- cleanups
- spellchecked
- updated links

Closes #19875

6 days agoimap: check buffer length before accessing it
Daniel Stenberg [Tue, 9 Dec 2025 09:04:34 +0000 (10:04 +0100)] 
imap: check buffer length before accessing it

Pointed out by ZeroPath

Closes #19887

6 days agoheaders: add length argument to Curl_headers_push()
Daniel Stenberg [Tue, 9 Dec 2025 08:58:48 +0000 (09:58 +0100)] 
headers: add length argument to Curl_headers_push()

- the length is already known by parent functions
- avoids strlen() calls
- avoids strchr() calls for trimming off newline characters

Closes #19886

6 days agotests/data: move section data to external files
Viktor Szakats [Tue, 9 Dec 2025 00:15:29 +0000 (01:15 +0100)] 
tests/data: move section data to external files

To make the test files XML-compliant, and the expected results
possibly easier to manage by keeping them in `.md`, `.html`, `.1`
and `.txt` files.

Non-XML-compliant files are down to 31 (1.6%) after this patch.

Closes #19882

6 days agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 9 Dec 2025 08:23:35 +0000 (09:23 +0100)] 
RELEASE-NOTES: synced

6 days agocurl_setup.h: fix `FMT_SOCKET_T` to be unsigned on Windows
Viktor Szakats [Thu, 21 Aug 2025 11:59:46 +0000 (13:59 +0200)] 
curl_setup.h: fix `FMT_SOCKET_T` to be unsigned on Windows

To match the Windows socket type.

Ref: https://learn.microsoft.com/windows/win32/winsock/socket-data-type-2

Cherry-picked from #18343
Closes #19881

6 days agotests/data: use more `%TESTNUMBER` macro for previous patch
Viktor Szakats [Tue, 9 Dec 2025 00:46:06 +0000 (01:46 +0100)] 
tests/data: use more `%TESTNUMBER` macro for previous patch

Follow-up to d75716e4e55c7074566f48d8c03bfd721461e105 #19799
Cherry-picked from #19882
Closes #19885

6 days agotests/data: move `--libcurl` output to external data files
Viktor Szakats [Mon, 1 Dec 2025 12:31:42 +0000 (13:31 +0100)] 
tests/data: move `--libcurl` output to external data files

To make the test files XML-compliant, and the expected results
possibly easier to manage by keeping them in `.c` files.

Non-XML-compliant files are down to 36 after this patch.

Also:
- make all macro expansions apply to `%includetext` contents.

Closes #19799

6 days agotidy-up: URLs
Viktor Szakats [Mon, 8 Dec 2025 15:44:29 +0000 (16:44 +0100)] 
tidy-up: URLs

- to avoid dupes.
- missing slashes.
- drop `.git` suffix from GitHub git repo URLs for a few outliers.
- use short YouTube URL like curl-www does.
- sync two RFC doc URLs with others.

Closes #19879

6 days agomk-ca-bundle.md: the file format docs URL is permaredirected
Daniel Stenberg [Mon, 8 Dec 2025 14:50:48 +0000 (15:50 +0100)] 
mk-ca-bundle.md: the file format docs URL is permaredirected

Closes #19877

6 days agoKNOWN_BUGS: remove link to codepoints.net
Daniel Stenberg [Mon, 8 Dec 2025 14:54:38 +0000 (15:54 +0100)] 
KNOWN_BUGS: remove link to codepoints.net

The site is so slow it often triggers a failure for the link checker.

Closes #19878

6 days agoIPFS.md: wrap long lines
Viktor Szakats [Mon, 8 Dec 2025 16:02:26 +0000 (17:02 +0100)] 
IPFS.md: wrap long lines

Closes #19880

6 days agoGHA: bump pip-dependencies ruff, psutil, pytest
dependabot[bot] [Mon, 8 Dec 2025 14:20:54 +0000 (14:20 +0000)] 
GHA: bump pip-dependencies ruff, psutil, pytest

- update `ruff` from 0.14.5 to 0.14.8
- update `psutil` from 7.1.2 to 7.1.3
- update `pytest` from 8.4.2 to 9.0.1

Closes #19876

7 days agoCI/windows: add torture tests with Schannel
Viktor Szakats [Sun, 7 Dec 2025 16:36:54 +0000 (17:36 +0100)] 
CI/windows: add torture tests with Schannel

With Schannel and Unicode, `-shallow=13`. It finishes in 12 minutes,
making it the slowest Windows job. It's still on par with torture jobs
on other platforms (though they manage to fit `-shallow=25`).

Also `-shallow=13` still caught leaks in multiple tests.

Also:
- test2300: exclude from CI Windows torture tests.
- experimental.

The downside of going with deeper torture tests, is that it requires
increasing the job timeout. This in turns means that a hung job takes
more minutes to be killed (due to GitHub bugs where a hung step does not
honor the per-step timeout on Windows, another bug where a hung job gets
killed +5 minutes above the workflow timeout, and another bug (or
feature?) where other failed/hung jobs in the the workflow cannot be
restarted till the last job finishes or gets killed. And all this
probably related to a Perl bug which makes it hang on fork errors, which
is turn related to Cygwin/MSYS2 runtime bugs which breaks fork in case
of curl's mixed MSYS2-Perl/native-curl-binaries environment.)
The end result in longer forced waits before being able to restart flaky
jobs, which slows down iterations and annoying.

Also tried:
- non-c-ares job: detected known issues much less often.
- replaced libidn2 with WinIDN: detected known issues much less often.
- runtests -j9-j20 values: did not make a difference.
- other `-shallow` values: 20 is the max feasible, but comes with the
  downside described above.

Ref: #19675 (reboot of)
Follow-up to f08417c4259a3b9a2e4d72a48fa02ce6502cb587 #19863

Closes #19865

7 days agodocs: switch more URLs to https://
Daniel Stenberg [Mon, 8 Dec 2025 10:11:02 +0000 (11:11 +0100)] 
docs: switch more URLs to https://

Normalize using https:// almost everywhere instead of http://

Closes #19872

7 days agomdlinkcheck: ignore IP numbers, allow '@' in raw URLs
Daniel Stenberg [Mon, 8 Dec 2025 10:16:18 +0000 (11:16 +0100)] 
mdlinkcheck: ignore IP numbers, allow '@' in raw URLs

7 days agoGHA/linux: update dependency pizlonator/fil-c to v0.675
renovate[bot] [Mon, 8 Dec 2025 11:07:26 +0000 (11:07 +0000)] 
GHA/linux: update dependency pizlonator/fil-c to v0.675

Closes #19873

7 days agoGHA/linux: blind try to make Renovate detect Fil-C releases
Viktor Szakats [Mon, 8 Dec 2025 10:06:49 +0000 (11:06 +0100)] 
GHA/linux: blind try to make Renovate detect Fil-C releases

0.675 has been out for 2 weeks, Renovate did not detect it with
`semver-partial`. Try with `semver-coerced`.

Refs:
https://docs.renovatebot.com/modules/versioning/semver-coerced/
https://docs.renovatebot.com/modules/versioning/semver-partial/

Follow-up to 16c6ea36cca6684aacbcb33578af61b28e3fee0d #19391

7 days agoDISTROS: fix a Mageia URL
Daniel Stenberg [Mon, 8 Dec 2025 10:43:12 +0000 (11:43 +0100)] 
DISTROS: fix a Mageia URL

Since we check the provided URLs now, use the direct, working URL.

7 days agognutls: add PROFILE_MEDIUM as default
Stefan Eissing [Fri, 5 Dec 2025 14:38:12 +0000 (15:38 +0100)] 
gnutls: add PROFILE_MEDIUM as default

Raise the default GnuTLS priority settings by adding PROFILE_MEDIUM for
more secure connection handling.

Reported-by: Harry Sintonen
Closes #19853

7 days agotest1475: consistently use %CR in headers
Fabian Keil [Sun, 7 Dec 2025 14:23:00 +0000 (15:23 +0100)] 
test1475: consistently use %CR in headers

Gets the test working when using Privoxy as proxy.

Closes #19870

7 days agohostcheck: fail wildcard match if host starts with a dot
Daniel Stenberg [Mon, 8 Dec 2025 09:20:04 +0000 (10:20 +0100)] 
hostcheck: fail wildcard match if host starts with a dot

A hostname cannot start with a dot when DNS is used, but there are other
ways.

Amend unit test 1397

Closes #19869

7 days agosspi: fix memory leaks on error paths in `Curl_create_sspi_identity()`
Viktor Szakats [Sun, 7 Dec 2025 19:03:38 +0000 (20:03 +0100)] 
sspi: fix memory leaks on error paths in `Curl_create_sspi_identity()`

Detected by Windows torture test 1072 (with `-shallow=20/13`),
test 579 (with `-shallow=18/14/13`), and test 1286 (with `-shallow=15`).

```
** MEMORY FAILURE
Leak detected: memory still allocated: 20 bytes
At 1a1e8136328, there is 18 bytes.
 allocated by D:/a/curl/curl/lib/curl_sspi.c:133
At 1a1e8139368, there is 2 bytes.
 allocated by D:/a/curl/curl/lib/curl_sspi.c:143
 1072: torture FAILED: function number 207 in test.
 invoke with "-t207" to repeat this single case.
Warning: http2 server unexpectedly alive
```
Ref: https://github.com/curl/curl/actions/runs/20008523913/job/57374427439?pr=19865

Also simplify the code a little.

Cherry-picked from #19865
Closes #19866

7 days agocookie: cleanups and improvements
Daniel Stenberg [Sun, 7 Dec 2025 22:44:31 +0000 (23:44 +0100)] 
cookie: cleanups and improvements

- Stricter cookie validation with earlier rejection of empty/invalid
  cookie names

- secure and httponly attributes no longer accept = with empty values
  (only bare keywords)

- Validation checks (length, TAB, prefixes) moved into the first
  name/value pair block for better code organization

- Deferred time(NULL) calls for better performance when expires/max-age
  aren't used

- Simplified loop control flow by removing done flag

- The cookie size restriction now only applies to name + value, not other
  parts of the header line.

- Fixed a gcc 4.8.1 quirk

Closes #19868

7 days agocookie: only keep and use the canonical cleaned up path
Daniel Stenberg [Sun, 7 Dec 2025 15:09:13 +0000 (16:09 +0100)] 
cookie: only keep and use the canonical cleaned up path

Instead of keeping both versions around.

Closes #19864

7 days agocookie: when parsing a cookie header, delay all allocations until okay
Daniel Stenberg [Sun, 7 Dec 2025 12:49:33 +0000 (13:49 +0100)] 
cookie: when parsing a cookie header, delay all allocations until okay

To avoid wasting time allocating data for incoming cookies that are
discarded for one reason or another, delay allocations until after
verifications are done.

Closes #19864

7 days agocookie: allocate the main struct once cookie is fine
Daniel Stenberg [Sun, 7 Dec 2025 12:17:24 +0000 (13:17 +0100)] 
cookie: allocate the main struct once cookie is fine

This delays the allocating of the cookie struct until after all the
checks have been done, as many cookies are received and discarded
instead of accepted and this then saves one allocation for every
discarded cookie.

Closes #19864

7 days agorunner.pm: run memanalyzer as a Perl module
Viktor Szakats [Sun, 7 Dec 2025 15:58:34 +0000 (16:58 +0100)] 
runner.pm: run memanalyzer as a Perl module

To improve performance of torture tests.

Also on Windows, where this patch may make those viable for CI.

Linux   !FTP    4m47 ->  4m24 (-shallow=25)
Linux    FTP    2m30 ->  2m23 (-shallow=25)
macOS   !FTP   14m30 -> 13m07 (-shallow=25)
macOS    FTP    3m57 ->  3m59 (-shallow=25)
Windows !FTP  >25m   ->  4m47 to 14m45 (-shallow=5 to 25) (not in CI)

Linux
Before: https://github.com/curl/curl/actions/runs/20006771767/job/57370205514
After: https://github.com/curl/curl/actions/runs/20006783210/job/57370236911?pr=19863

macOS:
Before: https://github.com/curl/curl/actions/runs/20006771786/job/57370205769
After: https://github.com/curl/curl/actions/runs/20006783177/job/57370236995?pr=19863

Windows:
Before: https://github.com/curl/curl/actions/runs/19667198537/job/56326962912?pr=19675
After: https://github.com/curl/curl/actions/runs/20007175773/job/57371768734?pr=19863
After shallow=25: https://github.com/curl/curl/actions/runs/20008523913/job/57374427449?pr=19865

Ref: #19675
Follow-up to 472bc9032374f98f48f7a2df6c644cff91fe142c #19821
Closes #19863

7 days agowolfssl: fix possible assert with `!HAVE_NO_EX` wolfSSL builds
Viktor Szakats [Fri, 5 Dec 2025 13:53:35 +0000 (14:53 +0100)] 
wolfssl: fix possible assert with `!HAVE_NO_EX` wolfSSL builds

Without this option `wolfSSL_get_app_data()` always returns NULL.
Disable codepaths using it (and its `set` pair) when curl is built
against a wolfSSL library with this option missing.

Fixing:
```
curl: ../../lib/vtls/wolfssl.c:486: wssl_vtls_new_session_cb: Assertion `cf != ((void *)0)' failed.
```

wolfSSL can be built with the `--enable-context-extra-user-data` or
`-DWOLFSSL_EX_DATA` option to enable this feature. Some higher-level
features also enable it automatically like QUIC, ASIO.

Reported-by: Yedaya Katsman
Bug: https://github.com/curl/curl/pull/19816#issuecomment-3606447845
Ref: https://github.com/curl/curl/actions/runs/19871780796/job/56949160740

Closes #19852

8 days agohttp: return OOM errors from hsts properly
Daniel Stenberg [Sun, 7 Dec 2025 11:35:42 +0000 (12:35 +0100)] 
http: return OOM errors from hsts properly

When Curl_hsts_parse() fails with out of memory, return it to parent.

Closes #19862

8 days agohsts: use one malloc instead of two per entry
Daniel Stenberg [Sun, 7 Dec 2025 11:24:33 +0000 (12:24 +0100)] 
hsts: use one malloc instead of two per entry

Closes #19861

8 days agonoproxy: fix build on systems without IPv6
Daniel Stenberg [Sat, 6 Dec 2025 23:03:56 +0000 (00:03 +0100)] 
noproxy: fix build on systems without IPv6

Follow-up to ff2aaed9ba6f186feb57f89fc6854
Reported-by: Harry Sintonen
Closes #19860

8 days agoasyn-thrdd: fix Curl_async_getaddrinfo() on systems without getaddrinfo
Daniel Stenberg [Sat, 6 Dec 2025 22:45:06 +0000 (23:45 +0100)] 
asyn-thrdd: fix Curl_async_getaddrinfo() on systems without getaddrinfo

Follow-up to ce06fe77710525
Bug: https://github.com/curl/curl/commit/ce06fe7771052549ff430c86173b2eaca91f8a9c#r172215567
Reported-by: Harry Sintonen
Closes #19859

8 days agoaltsvc: make it one malloc instead of three per entry
Daniel Stenberg [Sat, 6 Dec 2025 17:01:09 +0000 (18:01 +0100)] 
altsvc: make it one malloc instead of three per entry

Also return OOM correctly.

Closes #19857

8 days agoformdata: validate callback is non-NULL before use
Robert W. Van Kirk [Sat, 6 Dec 2025 18:00:00 +0000 (12:00 -0600)] 
formdata: validate callback is non-NULL before use

curl_formget() accepts a user-provided callback function but does not
validate it is non-NULL before calling it. If a caller passes NULL,
the function will crash with SIGSEGV.

Add NULL check at the start of the function to return an appropriate
error code instead of crashing.

Signed-off-by: Robert W. Van Kirk <robert@rwvk.tech>
Closes #19858

8 days agoftp: make EPRT connections non-blocking
Stefan Eissing [Fri, 5 Dec 2025 13:12:47 +0000 (14:12 +0100)] 
ftp: make EPRT connections non-blocking

On platforms where neither accept4 nor fcntl was available, an
EPRT connection did not send the accepted socket as non-blocking.

This became apparent when TLS was in use and the test receive
on shutdown did simply hang.

Reported-by: Denis Goleshchikhin
Fixes #19753
Closes #19851

9 days agoRELEASE-NOTES: synced rc-8_18_0-1
Daniel Stenberg [Fri, 5 Dec 2025 22:51:47 +0000 (23:51 +0100)] 
RELEASE-NOTES: synced

9 days agomdlinkcheck: detect and check "raw" links
Daniel Stenberg [Fri, 5 Dec 2025 10:45:35 +0000 (11:45 +0100)] 
mdlinkcheck: detect and check "raw" links

- URLs specified outside of the markdown []() are now extracted and
  checked

- also check TODO, FAQ and KNOWN_BUGS

- more aggressive avoiding to check github.com/curl/curl, all uses of
  example domains and some more established URLs on the curl.se site

- list all errors in the end to make them easier to spot in CI logs

Closes #19848

9 days agoDISTROS: remove broken URLs for buildroot
Daniel Stenberg [Fri, 5 Dec 2025 13:11:39 +0000 (14:11 +0100)] 
DISTROS: remove broken URLs for buildroot

9 days agoFAQ: fix hackerone URL
Daniel Stenberg [Fri, 5 Dec 2025 13:04:25 +0000 (14:04 +0100)] 
FAQ: fix hackerone URL

9 days agodocs: use .example URLs for proxies
Daniel Stenberg [Fri, 5 Dec 2025 12:33:02 +0000 (13:33 +0100)] 
docs: use .example URLs for proxies

9 days agodocs: remove dead URLs
Daniel Stenberg [Fri, 5 Dec 2025 12:17:11 +0000 (13:17 +0100)] 
docs: remove dead URLs

- KNOWN_BUGS: remove dead URL
- ECH: remove two dead URLs
- MAIL-ETIQUETTE: remove dead URL