]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
7 months agomulti: fix to build on IBMi
Andrew [Mon, 5 Jan 2026 18:26:27 +0000 (18:26 +0000)] 
multi: fix to build on IBMi

Sync function declaration with definition. Update related local vars.

Follow-up to 4701a6d2ae9f0b66a0feac4061868e944353449b #19695
Fixes #20190
Closes #20191

7 months agoldap: fix `Curl_ldap_version()` for IBMi/OS400
Andrew [Mon, 5 Jan 2026 18:00:20 +0000 (18:00 +0000)] 
ldap: fix `Curl_ldap_version()` for IBMi/OS400

- `LDAP_OPT_SUCCESS` (== 0) is missing from some LDAP implementations
  and documented to use `LDAP_SUCCESS` (== 0) instead. Use literal zero
  to avoid macro name differences.

- fix freeing `LDAP_OPT_API_INFO` buffers:
  - docs suggest `ldapai_vendor_name` on IBMi is `const char *`.
    Nothing in docs says it need to be freed.
  - `ldapai_extensions` need to be freed, according to docs.
    However, on IBMi there is `ldap_value_free()` function for it.
  Ref: https://www.ibm.com/docs/en/svd/10.0.3?topic=settings-ldap-opt-api-info

Fixing, on OS400 (V7R4M0):
```
CZM1003:  LDAP__819.c, 1028.56: CZM0045(30) Undeclared identifier LDAP_OPT_SUCCESS.
CZM1003:  LDAP__819.c, 1036.21: CZM0280(30) Function argument assignment between types "char*" and "const char*" is not allowed.
CZM1001:  LDAP__819.c, 1037.5: CZM0304(10) No function prototype given for "ber_memvfree".
...
CZS0601:  Module LDAP is not created because statement errors occurred.
```

Follow-up to 859ce48de12986f5bf846c2800dacab893ff12c1 #19832
Fixes #20188
Closes #20189

7 months agoGHA/macos: drop compiler matrix for macos jobs
Viktor Szakats [Mon, 5 Jan 2026 13:08:58 +0000 (14:08 +0100)] 
GHA/macos: drop compiler matrix for macos jobs

To reduce the number of jobs, and the time spent running macos runners.
The curl codebase has just a few Apple-specific parts, and they remain
well-covered after this patch.

Makes the number of jobs 24, down from 32.

Perhaps more jobs could be merged or dropped, and CPU use reduced by
moving some to cmake. Unique, but not Apple-specific jobs may also be
moved to Linux.

Follow-up to b869932392512d1c3a4d5396361f9acdd110ba4b #20178

Closes #20187

7 months agoGHA/macos: enable Apple IDN and SecTrust for combination jobs
Viktor Szakats [Mon, 5 Jan 2026 08:57:19 +0000 (09:57 +0100)] 
GHA/macos: enable Apple IDN and SecTrust for combination jobs

Closes #20185

7 months agomk-lib1521: make the test set each string option again
Daniel Stenberg [Sun, 4 Jan 2026 11:24:41 +0000 (12:24 +0100)] 
mk-lib1521: make the test set each string option again

In an attempt to make sure that setting it again does not leak memory.

The second string is set to `""`, which is done so that this now finds
the problem reported in #20179.

Ref: #20179
Closes #20181

7 months agoprogress: narrower time display, multiple fixes
Daniel Stenberg [Sat, 3 Jan 2026 11:16:06 +0000 (12:16 +0100)] 
progress: narrower time display, multiple fixes

- Each time field is now 7 characters wide, so that the total width
  never exceeds 79 columns so that it works correctly also in Windows
  terminals. The title lines are adjusted accordingly.

  This is accomplished by using h:mm:ss style up to 10 hours, and for
  longer periods switch to "nnX nnY" style output. For hours, days,
  months and years.

  For less than one hour, the hour field is now dropped.

  When no time info is provided, the field is now space-only. No more
  `-:--:--`.

  Also fixed the output for really long times which previously was
  completely broken. The largest time now shows as ">99999y". (Becase
  I can't figure out a better way).

- For sizes, the widths are now properly fixed to 6 characters. When
  displaying a unit with less than 3 digits, it shows two decimal
  precision like "16777215 => 15.99M" and one decmal otherwise: "262143
  => 255.9k"

  Also fixes the decimal math. 131071 is 127.9k, which it previously did
  not show.

- The time and size field outputs are now properly verified in test
  1636.

Fixes #20122
Closes #20173

fixup use only space when no time exists

Drop the hour from the display when zero

7 months agosetopt: free the previous STRING_ENCODING before storing the new
Daniel Stenberg [Sun, 4 Jan 2026 10:54:18 +0000 (11:54 +0100)] 
setopt: free the previous STRING_ENCODING before storing the new

Follow-up to 6b9c75e219cdcfd3e17e7858

Fixes #20179
Reported-by: correctmost on github
Closes #20180

7 months agotool_doswin: remove the max length check
Daniel Stenberg [Thu, 1 Jan 2026 17:23:39 +0000 (18:23 +0100)] 
tool_doswin: remove the max length check

A too long name is likely to cause a problem later anyway and get
reported there. We don't enforce file name lengths for any other
systems.

Assisted-by: Jay Satiro
Assisted-by: Viktor Szakats
Closes #20143

7 months agoGHA/macos: reduce number of combination jobs
Viktor Szakats [Sun, 4 Jan 2026 00:15:50 +0000 (01:15 +0100)] 
GHA/macos: reduce number of combination jobs

- drop autotools (except one) from combination jobs.
  They seem to add little value over cmake ones, yet take a lot of time
  even after restricting them to shared libs.

  20-25s to install autotools via Homebrew, for each 11 jobs. autoreconf
  taking 10s, configure 25s, build 30-35s. A total of 1m30s to 1m45s per
  job. Sometimes jumping up to 2-4 minutes.

  Compare this to 20-25s total job times with cmake.

  Keep one job with an indentical cmake pair to help detecting
  build-tool-specific fallouts.

- drop more combination jobs.
  To avoid overlap with main build jobs.

Reducing number of jobs to 9, from 22 (-13),
total job time to 5.5 minutes, from 25 (-20m).

Before: https://github.com/curl/curl/actions/runs/20637652089
After: https://github.com/curl/curl/actions/runs/20686390641?pr=20178

Considering the small amount of Apple-specific code in curl since
dropping Secure Transport, and that most combination issue were in
the toolchains, not curl, there is likely more room to avoid wasting
cycles (at 41 macOS + 3 iOS jobs after this patch).

Follow-up to d057b705fdb44b2df99ce6fc6ffb8f2a3530755a #20167

Closes #20178

7 months agotool_progress: fix large time outputs and decimal size display
Daniel Stenberg [Sat, 3 Jan 2026 16:50:26 +0000 (17:50 +0100)] 
tool_progress: fix large time outputs and decimal size display

Time output:

- was broken for really large times

- now uses spaces instead of --:--:--

- >99999y is now the largest shown time

- show HH:MM:SS as long as hours are fewer than 100

Size:

- made the decimal output always only use a single decimal

Test:

- Add test 1622 to verify these functions

Closes #20177

7 months agodocs: add a note about --compressed to note about binary output
Tobias Zimmermann [Fri, 2 Jan 2026 17:12:03 +0000 (18:12 +0100)] 
docs: add a note about --compressed to note about binary output

Closes #20168

7 months agotool_getparam: use UNITTEST not, ifdef
Daniel Stenberg [Sat, 3 Jan 2026 16:28:25 +0000 (17:28 +0100)] 
tool_getparam: use UNITTEST not, ifdef

Closes #20174

7 months agoservers.pm: say the protocol when http server failed to start
Viktor Szakats [Sat, 3 Jan 2026 17:44:00 +0000 (18:44 +0100)] 
servers.pm: say the protocol when http server failed to start

To serve as possibly more signal to see when/why the http server fails
to start in some random cases (on Windows).

Seen it happen in the 'mingw, CM clang-x86_64 gnutls libss' CI job:
https://github.com/curl/curl/pull/20163#issuecomment-3705572750
https://github.com/curl/curl/pull/20163#issuecomment-3707231458

Closes #20176

7 months agopytest: test 16_01 stabilize
Stefan Eissing [Fri, 2 Jan 2026 13:08:21 +0000 (14:08 +0100)] 
pytest: test 16_01 stabilize

When checking the reported times of a transfer, do not exptect
the 'queue' time to be in any relation to others. 'queue' uses its own
start timestamp and the reported duration is thereofore independant.

Ref: #20112
Closes #20163

7 months agoGHA: restore `--shallow` value for some torture tests
Viktor Szakats [Fri, 2 Jan 2026 23:14:20 +0000 (00:14 +0100)] 
GHA: restore `--shallow` value for some torture tests

It also means that now all torture test-pairs use the same shallowness,
while earlier FTP used 20.

Also:
- This made macOS torture jobs slow enough to split them into 3 jobs.

Follow-up to 2cbcde90e7a5eb7144079dcacc21393322b1daf7 #20153

Closes #20172

7 months agopytest: test 07_22 stabilize
Stefan Eissing [Fri, 2 Jan 2026 13:23:21 +0000 (14:23 +0100)] 
pytest: test 07_22 stabilize

Do not generate a 400 response code, but use a 200 one. The upload needs
to fail on sending, not on seeing a 400 response. Seeing a 400 before
the sending fails (when CI timings shift) will expose the wrong error
code.

Ref: #20112
Closes #20164

7 months agopytest: test 07_70 stabilize (curl_ngtcp2)
Stefan Eissing [Fri, 2 Jan 2026 11:46:35 +0000 (12:46 +0100)] 
pytest: test 07_70 stabilize (curl_ngtcp2)

We recently allowed a larger send buffer in ngtcp2 streams. This allowed
curl to send more early data then previously when the server was slow in
performing the handshake. This led to flaky test failures when the
amount of early data was larger than expected.

Change test expectations to allow for varying amount of early data.

Ref: #20112
Closes #20161

7 months agopytest: test 03_02 stabilize (curl_ngtcp2)
Stefan Eissing [Fri, 2 Jan 2026 12:14:12 +0000 (13:14 +0100)] 
pytest: test 03_02 stabilize (curl_ngtcp2)

The special handling for draining server connections during a connect
attempt was only done on CURLE_RECV_ERROR. But it may also happen when
ngtcp2 errors on writing data. Check for CURLE_SEND_ERROR also.

Ref: #20112
Closes #20162

7 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 2 Jan 2026 22:53:33 +0000 (23:53 +0100)] 
RELEASE-NOTES: synced

7 months agoaltsvc: accept ma/persist per alternative entry
Daniel Stenberg [Thu, 1 Jan 2026 16:46:04 +0000 (17:46 +0100)] 
altsvc: accept ma/persist per alternative entry

The 'ma' and 'persist' keywords should be considered per list entry, not
once per header.

Expand test 1654 to verify such headers

Reported-by: Hunt Darlener
Closes #20160

7 months agoGHA/non-native: reduce workflow timeouts
Viktor Szakats [Fri, 2 Jan 2026 22:21:59 +0000 (23:21 +0100)] 
GHA/non-native: reduce workflow timeouts

Closes #20171

7 months agoGHA/windows: reduce workflow timeouts
Viktor Szakats [Fri, 2 Jan 2026 21:50:34 +0000 (22:50 +0100)] 
GHA/windows: reduce workflow timeouts

From 15 to 10 minutes.

To reduce the idle wait for hung jobs from 20 to 15 minutes (hopefully),
so that the failed just can be restarted manually eariler. It appears
that GitHub Actions notices a hung job 5 minutes past the workflow
timeout (reason undiscovered).

Also: Leave extra time for torture and arm64 jobs.

Closes #20170

7 months agoGHA: disable autotools static libcurl in many jobs
Viktor Szakats [Fri, 2 Jan 2026 16:45:09 +0000 (17:45 +0100)] 
GHA: disable autotools static libcurl in many jobs

To avoid building libcurl in both static and shared flavor by default.
It results in 1.5-2.x speed-up for the curl build step in most jobs.
Saving a total of 6-7 minutes. In the Cygwin job alone it saves 1-1.5m.

Also:
- enable static + shared in a Windows job to keep testing this combo.

Follow-up to ff958fc4b2c606d70de8dbfe083bee98896c0072 #20159

Closes #20167

7 months agoGHA/linux: simplify configuring mbedTLS in two jobs
Viktor Szakats [Fri, 2 Jan 2026 15:23:17 +0000 (16:23 +0100)] 
GHA/linux: simplify configuring mbedTLS in two jobs

Closes #20165

7 months agoGHA/linux: split valgrind jobs to job-pairs for parallelism, to finish in 10m
Viktor Szakats [Fri, 2 Jan 2026 02:13:32 +0000 (03:13 +0100)] 
GHA/linux: split valgrind jobs to job-pairs for parallelism, to finish in 10m

To make CI turnaround time shorter, by cutting the longest running jobs.
After this patch all jobs should finish around 10-11 minutes. Down from
15-16 minutes before this patch.

Suggested-by: Stefan Eissing
The fuzzing workflow is now the slowest (with a 7-minute startup time
needed to build deps from source on each run), followed by macOS
and Windows torture tests (both split in two now). Without fuzzing, it's
under 10 minutes.

Notes:
- an extra cost with job-pairs is installing prereqs,
  configuring/building curl and tests twice. GitHub doesn't support
  making a matrix job a prereq for another workflow that may fix this:
    https://github.com/orgs/community/discussions/42335
  This overhead is significant on Windows: 11m20 -> 9m20 + 8m40
- job-pairs are annoying to maintain and keep in sync.
- splitting tests into halves is a manual process and needs to be
  revisited from time to time. Possibly something to automate with
  a runtests option, e.g. with `1 of 50%` and `2 of 50%`?

Also:
- split torture tests in two equal pieces, replacing the `FTP` + `!FTP`
  split used earlier.

Related perf improvements from today:
- make scan-build 2x fast:
  ff958fc4b2c606d70de8dbfe083bee98896c0072 #20159
- drop build-only Testi386 fuzz workflow (from curl), saving 9m per run:
  https://github.com/curl/curl-fuzzer/commit/0106023c1f2f0b9ff3aa86e19402b4a03e4f925c
  https://github.com/curl/curl-fuzzer/pull/236

Closes #20153

7 months agoGHA/linux: switch scan-build jobs to cmake (for 2x perf)
Viktor Szakats [Fri, 2 Jan 2026 10:03:12 +0000 (11:03 +0100)] 
GHA/linux: switch scan-build jobs to cmake (for 2x perf)

Somewhat unexpectedly, switching autotools jobs to identical (non-unity,
non-debug, same options) cmake ones, makes them complete 2x faster.
Most of it comes from cmake building shared libcurl only, while autotools
was using defaults and building both, in two separate passes. Thers is
about a minute (per job) of gain due to other reasons.

Before:
MultiSSL: 10m30: https://github.com/curl/curl/actions/runs/20656775456/job/59311070197
H3: 9m14s: https://github.com/curl/curl/actions/runs/20656775456/job/59311070204

After:
MultiSSL: 4m52s: https://github.com/curl/curl/actions/runs/20658343323/job/59315501903
H3: 4m7s: https://github.com/curl/curl/actions/runs/20658343323/job/59315501918
H3: 5m4s: https://github.com/curl/curl/actions/runs/20659294959/job/59318215987 (autotools shared only, for comparison, not merged)

Also:
- drop building examples with scan-build in the second (shorter) job.
  This offers no extra coverage over the long job that has both GnuTLS
  and OpenSSL. Saving an extra ~30s.

Closes #20159

7 months agoVULN-DISCLOSURE-POLICY.md: CRLF in data
Daniel Stenberg [Fri, 2 Jan 2026 09:54:47 +0000 (10:54 +0100)] 
VULN-DISCLOSURE-POLICY.md: CRLF in data

we reject the idea of *CRLF injection* by the user itself as a general
security problem

Closes #20157

7 months agoprogress: make it one column narrower
Daniel Stenberg [Fri, 2 Jan 2026 10:44:33 +0000 (11:44 +0100)] 
progress: make it one column narrower

To make it fit 80 columns appropriately

Reported-by: Jay Satiro
Fixes #20122
Closes #20124

7 months agobadwords.pl: don't mention the whitelisted finds
Daniel Stenberg [Fri, 2 Jan 2026 09:59:43 +0000 (10:59 +0100)] 
badwords.pl: don't mention the whitelisted finds

They obscure the real finds

Closes #20158

7 months agovtls: drop unused `use_alpn` from `ssl_connect_data` struct
Viktor Szakats [Fri, 2 Jan 2026 02:27:27 +0000 (03:27 +0100)] 
vtls: drop unused `use_alpn` from `ssl_connect_data` struct

Closes #20154

7 months agosrc: drop redundant definition of `BIT()`
Viktor Szakats [Fri, 2 Jan 2026 01:51:12 +0000 (02:51 +0100)] 
src: drop redundant definition of `BIT()`

It's defined in `lib/curl_setup_once.h` which is always included before
the duplicate definition in `src/tool_cfgable.h`. Delete the latter.

Follow-up to 06bb1587373dcc42ffbe104b214c900936acfb3c #16211

Closes #20152

7 months agows: replace a cast by matching the format string
Viktor Szakats [Thu, 1 Jan 2026 18:59:21 +0000 (19:59 +0100)] 
ws: replace a cast by matching the format string

Closes #20151

7 months agocmake: set found status to OFF when not found (for compression deps)
Joshua VandaĆ«le [Thu, 1 Jan 2026 21:54:14 +0000 (22:54 +0100)] 
cmake: set found status to OFF when not found (for compression deps)

This fixes curl using libraries if `CURL_{BROTLI|ZLIB|ZSTD}` is set to
`OFF` but the library was found in a parent project that includes curl.

Closes #20147

7 months agopytest: replace allowlist with feature check to enable OCSP test 17_08
Viktor Szakats [Wed, 31 Dec 2025 17:15:17 +0000 (18:15 +0100)] 
pytest: replace allowlist with feature check to enable OCSP test 17_08

Add a `cert-status` feature flag to `curlinfo`, based on the conditions
used in `lib/vtls` sources.

To:
- fix disabling this test when using OpenSSL (or fork) built with
  the `no-ocsp` option.
- enable this test for AWS-LC in CI.

Note:
- BoringSSL (and quiche) has OSCP disabled by default.
- MultiSSL dynamic selection continues to confuse this test.
  (To fix it, support would need to be detected by querying libcurl
  via curl. Probably overkill given that OCSP is on its way out.)

Follow-up to f2c765028fcf91c4f7bf15eeb0249d525e13ac8f #20149

Closes #20133

7 months agopytest: enable OCSP test 17_08 for LibreSSL
Viktor Szakats [Thu, 1 Jan 2026 22:19:07 +0000 (23:19 +0100)] 
pytest: enable OCSP test 17_08 for LibreSSL

Before: 735 passed, 115 skipped
After: 738 passed, 112 skipped

Closes #20149

7 months agomqtt: return error when a too large packet is decoded
Daniel Stenberg [Thu, 1 Jan 2026 22:07:53 +0000 (23:07 +0100)] 
mqtt: return error when a too large packet is decoded

Closes #20148

7 months agoGHA/non-native: stop building examples in a cross-job
Viktor Szakats [Thu, 1 Jan 2026 21:47:18 +0000 (22:47 +0100)] 
GHA/non-native: stop building examples in a cross-job

To make the longest running FreeBSD job finish 1.5 minutes faster
(9.5m -> 8m).

Examples are still built with both autotools and cmake, one on Intel and
one on ARM.

Closes #20146

7 months agoGHA: bump pip-dependencies
dependabot[bot] [Thu, 1 Jan 2026 14:27:11 +0000 (14:27 +0000)] 
GHA: bump pip-dependencies

- update `ruff` from 0.14.9 to 0.14.10
- update `psutil` from 7.1.3 to 7.2.0

Closes #20141

7 months agoGHA: bump gha-dependencies
dependabot[bot] [Thu, 1 Jan 2026 14:06:15 +0000 (14:06 +0000)] 
GHA: bump gha-dependencies

- update `github/codeql-action` from 4.31.8 to 4.31.9
- update `cross-platform-actions/action` from 0.30.0 to 0.32.0
  - support for OmniOS and FreeBSD 15.0
  - releases are now immutable

Closes #20140

7 months agoinet_ntop: avoid the strlen()
Daniel Stenberg [Thu, 1 Jan 2026 11:45:45 +0000 (12:45 +0100)] 
inet_ntop: avoid the strlen()

Also, skip adding the terminating null that is not used.

Closes #20139

7 months agosource: misc typos
Daniel Stenberg [Thu, 1 Jan 2026 11:18:39 +0000 (12:18 +0100)] 
source: misc typos

Found by typos-cli

Closes #20138

7 months agotool_getparam: simplify the --rate parser
Daniel Stenberg [Tue, 30 Dec 2025 22:45:23 +0000 (23:45 +0100)] 
tool_getparam: simplify the --rate parser

Avoids a memcpy()

Closes #20119

7 months agoCHANGES: fix typo in filename
Stuart Henderson [Thu, 1 Jan 2026 10:43:36 +0000 (10:43 +0000)] 
CHANGES: fix typo in filename

Closes #20137

7 months agotool_paramhlp: simplify number parsing
Daniel Stenberg [Wed, 31 Dec 2025 17:17:15 +0000 (18:17 +0100)] 
tool_paramhlp: simplify number parsing

Closes #20134

7 months agotests: drop redundant parenthesis from two macro expressions
Viktor Szakats [Wed, 31 Dec 2025 16:12:16 +0000 (17:12 +0100)] 
tests: drop redundant parenthesis from two macro expressions

Closes #20136

7 months agolibssh: fix indent
Viktor Szakats [Mon, 29 Dec 2025 20:12:13 +0000 (21:12 +0100)] 
libssh: fix indent

Closes #20135

7 months agotool_paramhlp: remove a malloc+free from proto2num()
Daniel Stenberg [Tue, 30 Dec 2025 23:13:24 +0000 (00:13 +0100)] 
tool_paramhlp: remove a malloc+free from proto2num()

Closes #20120

7 months agotest1664: extend with more tests for curlx_str_quotedword
Daniel Stenberg [Wed, 31 Dec 2025 10:06:36 +0000 (11:06 +0100)] 
test1664: extend with more tests for curlx_str_quotedword

Closes #20123

7 months agohostip.h: drop redundant `setjmp.h` include
Viktor Szakats [Wed, 31 Dec 2025 15:20:32 +0000 (16:20 +0100)] 
hostip.h: drop redundant `setjmp.h` include

Already included directly via `hostip.c`, and other header users do not
use it.

Also add comment about why `setjmp.h` is used.

Cherry-picked from #20106

Closes #20132

7 months agotests: include headers only when used
Viktor Szakats [Mon, 29 Dec 2025 02:44:27 +0000 (03:44 +0100)] 
tests: include headers only when used

Cherry-picked from #20106

Closes #20131

7 months agoopenssl: stop checking for `OPENSSL_NO_SHA*` macros
Viktor Szakats [Wed, 31 Dec 2025 14:08:06 +0000 (15:08 +0100)] 
openssl: stop checking for `OPENSSL_NO_SHA*` macros

Macros have been deleted upstream and never defined in OpenSSL 1.1.0+:
https://github.com/openssl/openssl/commit/474e469bbd056aebcf7e7d3207ef820f2faed4ce

BoringSSL deleted the last internals uses in 2014:
https://github.com/google/boringssl/commit/457112e1973251a721ae419128d7108844d3c1a3

LibreSSL refers to them internally and in two public headers, but never
set them via `openssl/opensslfeatures.h` / `openssl/opensslconf.h`.

Follow-up to 69c89bf3d3137fcbb2b8bc57233182adcf1e2817 #18330

Closes #20130

7 months agoopenssl: stop checking for `OPENSSL_NO_TLSEXT` macro
Viktor Szakats [Wed, 31 Dec 2025 13:45:05 +0000 (14:45 +0100)] 
openssl: stop checking for `OPENSSL_NO_TLSEXT` macro

The macro has been deleted upstream and never defined in OpenSSL 1.1.0+:
https://github.com/openssl/openssl/commit/e481f9b90b164fd1053015d1c4e0a0d92076d7a8

BoringSSL and LibreSSL deleted the last uses in 2014:
https://github.com/google/boringssl/commit/6dbd73db5d58ec44304266012d23ff8d297eca55
https://github.com/libressl/openbsd/commit/7b2f3298f7eb7ce5cfd1c3eb55b1ecc89118f52c

Also:
- drop internal guard `HAS_ALPN_OPENSSL`. It's always set.

Follow-up to 69c89bf3d3137fcbb2b8bc57233182adcf1e2817 #18330

Closes #20129

7 months agolib: drop unused or duplicate `curlx/timeval.h` includes
Viktor Szakats [Wed, 31 Dec 2025 11:28:46 +0000 (12:28 +0100)] 
lib: drop unused or duplicate `curlx/timeval.h` includes

Note: This patch doesn't aim to add `timeval.h` includes missing from
local headers using `curltime` type. They remain relying on `urldata.h`
being included first. This patch also doesn't delete existing, used
includes already present in local headers (as internal users may rely
on them).

Ref: #20106
Closes #20126

7 months agoopenssl: fix building against no-ocsp openssl with Apple SecTrust
Viktor Szakats [Wed, 31 Dec 2025 13:35:20 +0000 (14:35 +0100)] 
openssl: fix building against no-ocsp openssl with Apple SecTrust

(Not tested in CI. Regression in 8.17.0.)

Fixing:
```
lib/vtls/openssl.c:4750:8: error: variable 'sectrust_verified' set but not used [-Werror,-Wunused-but-set-variable]
 4750 |   bool sectrust_verified = FALSE;
      |        ^
1 error generated.
```

Follow-up to b4630ed8faef1834e2b64f30acc24e5101d4d2fb #19308

Closes #20128

7 months agoopenssl: fix building against no-dsa openssl
Viktor Szakats [Wed, 31 Dec 2025 13:29:24 +0000 (14:29 +0100)] 
openssl: fix building against no-dsa openssl

(Not tested in CI. Regression within this release cycle.)

Fixing:
```
lib/vtls/openssl.c:304:48: error: unused parameter 'data' [-Werror,-Wunused-parameter]
  304 | static CURLcode get_pkey_dsa(struct Curl_easy *data,
      |                                                ^
lib/vtls/openssl.c:305:40: error: unused parameter 'pubkey' [-Werror,-Wunused-parameter]
  305 |                              EVP_PKEY *pubkey, BIO *mem, int i)
      |                                        ^
lib/vtls/openssl.c:305:53: error: unused parameter 'mem' [-Werror,-Wunused-parameter]
  305 |                              EVP_PKEY *pubkey, BIO *mem, int i)
      |                                                     ^
lib/vtls/openssl.c:305:62: error: unused parameter 'i' [-Werror,-Wunused-parameter]
  305 |                              EVP_PKEY *pubkey, BIO *mem, int i)
      |                                                              ^
```

Follow-up to 833efb437dd8fb8b3ff48274531b83a03798b24b #19471

Closes #20127

7 months agoDockerfile: update debian:bookworm-slim Docker digest to d5d3f9c
renovate[bot] [Tue, 30 Dec 2025 05:08:30 +0000 (05:08 +0000)] 
Dockerfile: update debian:bookworm-slim Docker digest to d5d3f9c

Closes #20115

7 months agobadwords: add fist -> first, fix fallouts
Yedaya Katsman [Sun, 21 Dec 2025 19:53:58 +0000 (21:53 +0200)] 
badwords: add fist -> first, fix fallouts

There are still `curl_fistrgs` in packages/OS400/curl.inc.in but
I'm not sure what that's supposed to be exactly.

Closes #20066

7 months agotool_doswin: add debug envs to test filename sanitization failure modes
Viktor Szakats [Wed, 31 Dec 2025 10:21:18 +0000 (11:21 +0100)] 
tool_doswin: add debug envs to test filename sanitization failure modes

- `CURL_FN_SANITIZE_BAD=<any-value>` to simulate
  `SANITIZE_ERR_INVALID_PATH`.

- `CURL_FN_SANITIZE_OOM=<any-value>` to simulate
  `SANITIZE_ERR_OUT_OF_MEMORY`.

Both are Windows/MS-DOS-specific and require debug-enabled curl build.

Cherry-picked from #20116
Closes #20125

7 months agotool_getparam: use memdup0() instead of malloc + copy
Daniel Stenberg [Tue, 30 Dec 2025 22:19:01 +0000 (23:19 +0100)] 
tool_getparam: use memdup0() instead of malloc + copy

Closes #20118

7 months agodigest: fix OWS and escaped quote handling
trxvorr [Sun, 28 Dec 2025 18:28:18 +0000 (23:58 +0530)] 
digest: fix OWS and escaped quote handling

The migration to the strparse API introduced regressions in Digest
authentication parsing where Optional Whitespace (OWS) after commas was
not skipped, and escaped quotes in values were not correctly parsed.

This change ensures whitespace is skipped before key lookups and escaped
characters are properly handled and unescaped in quoted values.

Reported-by: herdiyanitdev on hackerone
Closes #20102

7 months agoRELEASE-NOTES: codespell
Viktor Szakats [Tue, 30 Dec 2025 16:35:00 +0000 (17:35 +0100)] 
RELEASE-NOTES: codespell

7 months agodelta: fix grep patterns after white space edits
Daniel Stenberg [Tue, 30 Dec 2025 13:04:10 +0000 (14:04 +0100)] 
delta: fix grep patterns after white space edits

To make the command line option counter work again

Follow-up to 308c347c8b

7 months agoRELEASE-NOTES: synced
Daniel Stenberg [Tue, 30 Dec 2025 13:02:03 +0000 (14:02 +0100)] 
RELEASE-NOTES: synced

7 months agolibcurl-errors: delete stray double quote
Viktor Szakats [Tue, 30 Dec 2025 10:45:15 +0000 (11:45 +0100)] 
libcurl-errors: delete stray double quote

Closes #20117

7 months agotool_doswin: increase allowable length of path sanitizer
Jay Satiro [Sat, 20 Dec 2025 09:08:09 +0000 (04:08 -0500)] 
tool_doswin: increase allowable length of path sanitizer

- Use 32767-1 instead of PATH_MAX-1 (260-1) as the maximum allowable
  length of a path in Windows.

Prior to this change the path sanitizer in Windows used 32767-1 as the
maximum length only for paths that had the "\\" prefix like
"\\?\longpath". Since then we added some workarounds to open longer
paths without "\\?\" prefix by normalizing the path and adding that
prefix, and the sanitizer is called before the prefix is added.

Bug: https://github.com/curl/curl/issues/20044
Reported-by: Viktor Szakats
Closes https://github.com/curl/curl/pull/20046

7 months agoratelimit blocking: fix busy loop
Stefan Eissing [Mon, 29 Dec 2025 10:21:31 +0000 (11:21 +0100)] 
ratelimit blocking: fix busy loop

Fix the pollset in perform state to not add sockets for directions
that are blocked. This otherwise will lead to busy loops for a
transfer that cannot be progressed.

Reported-by: Fizn-Ahmd on github
Fixes #20091
Closes #20109

7 months agolibssh: require private key or user-agent for public key auth
Harry Sintonen [Mon, 29 Dec 2025 15:56:39 +0000 (16:56 +0100)] 
libssh: require private key or user-agent for public key auth

Closes #20110

7 months agotelnet: abort on bad suboption sequence
Daniel Stenberg [Mon, 29 Dec 2025 09:11:20 +0000 (10:11 +0100)] 
telnet: abort on bad suboption sequence

Instead of trying to repair.

Reported-by: Huseyin Tintas
Closes #20108

7 months agourlapi: set uncondtional return code
Daniel Stenberg [Sun, 28 Dec 2025 21:40:47 +0000 (22:40 +0100)] 
urlapi: set uncondtional return code

Curl_parse_login_details() can only return a single return code so
adjust accordingly.

Pointed out by CodeSonar

Closes #20107

7 months agourl: return error at once when OOM in netrc handling
Daniel Stenberg [Sat, 27 Dec 2025 16:06:31 +0000 (17:06 +0100)] 
url: return error at once when OOM in netrc handling

Closes #20103

7 months agostrcopy: minor comment edit to avoid matching a grep for strcpy use
Daniel Stenberg [Sat, 27 Dec 2025 22:25:13 +0000 (23:25 +0100)] 
strcopy: minor comment edit to avoid matching a grep for strcpy use

7 months agocurl_quiche: refuse headers with CR, LF or null bytes
Daniel Stenberg [Sat, 27 Dec 2025 09:19:08 +0000 (10:19 +0100)] 
curl_quiche: refuse headers with CR, LF or null bytes

Also renamed the struct field to 'h1hdr' from 'scratch' to better say
what its purpose is.

Closes #20101

7 months agourlapi: return OOM correctly from parse_hostname_login()
Daniel Stenberg [Fri, 26 Dec 2025 12:05:20 +0000 (13:05 +0100)] 
urlapi: return OOM correctly from parse_hostname_login()

Closes #20100

7 months agoftp: return from ftp_state_use_port immediately on OOM
Daniel Stenberg [Fri, 26 Dec 2025 11:52:34 +0000 (12:52 +0100)] 
ftp: return from ftp_state_use_port immediately on OOM

Closes #20100

7 months agocf-socket: return OOM error if socket() failes due to OOM
Daniel Stenberg [Fri, 26 Dec 2025 10:00:00 +0000 (11:00 +0100)] 
cf-socket: return OOM error if socket() failes due to OOM

Closes #20100

7 months agotidy-up: miscellaneous
Viktor Szakats [Sat, 20 Dec 2025 13:32:49 +0000 (14:32 +0100)] 
tidy-up: miscellaneous

- asyn-thrdd.c: scope an include.
- apply more clang-format suggestions.
- tidy-up PP guard comments.
- delete empty line from the top of headers.
- add empty line after `curl_setup.h` include where missing.
- fix indent.
- CODE_STYLE.md: add `strcpy`.
  Follow-up to 8636ad55dfbdbcc2809a61e65c3511baf5e7b0e8 #20088
- lib1901.c: drop unnecessary line.
  Follow-up to 436e67f65b9dee1e80aa063c39450f0d1df6ac72 #20076

Closes #20070

7 months agoftp: return better on OOM in two places
Daniel Stenberg [Thu, 25 Dec 2025 22:17:24 +0000 (23:17 +0100)] 
ftp: return better on OOM in two places

Found with strict torture testing.

Closes #20099

7 months agomemdebug: stop tracking send and recv
Daniel Stenberg [Thu, 25 Dec 2025 22:21:34 +0000 (23:21 +0100)] 
memdebug: stop tracking send and recv

- they rarely catch any problems
- we have other ways to test different send/recv problems
- the number of such calls vary much more per invoke than others, making
  memdebugging harder
- reducing the total number of fallible functions per test is good
- they were not used as intended anyway

Closes #20097

7 months agocurl_threads: don't do another malloc if the first fails
Daniel Stenberg [Thu, 25 Dec 2025 17:06:37 +0000 (18:06 +0100)] 
curl_threads: don't do another malloc if the first fails

Closes #20095

7 months agosrc: drop unused includes
Viktor Szakats [Thu, 25 Dec 2025 17:05:53 +0000 (18:05 +0100)] 
src: drop unused includes

Also replace some indirect includes with direct ones.

Closes #20096

7 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 25 Dec 2025 11:13:55 +0000 (12:13 +0100)] 
RELEASE-NOTES: synced

7 months agocookie: flush better
Daniel Stenberg [Thu, 25 Dec 2025 09:53:11 +0000 (10:53 +0100)] 
cookie: flush better

The cookie flushing (saving to a cookie jar) should only be done if a
transfer has been started. This is now done by checking the
cookies->running field, which is not reset in curl_easy_reset() so the
saving works correctly even after a call to that.

Follow-up to fd6eb8d6e77d95e71c

Verified by test 1920

Reported-by: Alexander Batischev
Fixes #20090
Closes #20094

7 months agolib: drop unused protocol headers
Viktor Szakats [Wed, 24 Dec 2025 23:26:48 +0000 (00:26 +0100)] 
lib: drop unused protocol headers

- drop unused `http.h` includes.
- drop unused `http1.h` include.
- drop unused `http2.h` includes.
- vssh/ssh.h: drop unused `vssh.h` include.
- urldata.h: drop unused protocol includes.
- url: include `smtp.h` directly.
- rtsp.h: include directly where used.
- imap, smtp: drop redundant include, move another from .h to .c.

Verified with an all non-unity CI run.

Closes #20093

7 months agolibssh: set both knownhosts options to the same file
Daniel Stenberg [Wed, 24 Dec 2025 16:47:03 +0000 (17:47 +0100)] 
libssh: set both knownhosts options to the same file

Reported-by: Harry Sintonen
Closes #20092

7 months agoos400sys: replace `strcpy()` with `memcpy()`
Viktor Szakats [Wed, 24 Dec 2025 00:13:19 +0000 (01:13 +0100)] 
os400sys: replace `strcpy()` with `memcpy()`

Source and target are the same size, null-terminator is already present
in the target buffer.

Closes #20089

7 months agocurl_ntlm_core: fix DES_* symbols for some wolfSSL builds
Daniel Stenberg [Tue, 23 Dec 2025 21:22:37 +0000 (22:22 +0100)] 
curl_ntlm_core: fix DES_* symbols for some wolfSSL builds

Recent wolfSSL with OPENSSL_COEXIST enabled does not provide the DES_*
symbols, so we do.

Reported-by: Daniel Pouzzner
Closes #20083

7 months agoescape: add a length check in curl_easy_escape
Daniel Stenberg [Tue, 23 Dec 2025 23:09:37 +0000 (00:09 +0100)] 
escape: add a length check in curl_easy_escape

Only accept up to SIZE_MAX/16 input bytes. To avoid overflows, mistakes
and abuse.

Follow-up to 9bfc7f923479235b2fdf0e

Reported-by: Daniel Santos
Closes #20086

7 months agochecksrc: ban `strcpy`
Viktor Szakats [Wed, 24 Dec 2025 00:08:58 +0000 (01:08 +0100)] 
checksrc: ban `strcpy`

No longer used in the codebase. Replacement is `curlx_strcopy()`, possibly
`memcpy()` or dynbuf.

Also:
- OS400: allow three calls.

Closes #20088

7 months agobuild: stop disabling `strcpy` checks with clang-tidy
Viktor Szakats [Tue, 23 Dec 2025 11:16:52 +0000 (12:16 +0100)] 
build: stop disabling `strcpy` checks with clang-tidy

Follow-up to 436e67f65b9dee1e80aa063c39450f0d1df6ac72 #20076

Closes #20084

7 months agotests: replace `strcpy()` with `curlx_strcopy()`
Viktor Szakats [Tue, 23 Dec 2025 10:59:59 +0000 (11:59 +0100)] 
tests: replace `strcpy()` with `curlx_strcopy()`

Also:
- examples/hsts-preload: apply the same change as it's based on lib1915
  in tests. Make a local clone of `curlx_strcopy()`. Then drop the
  `_CRT_SECURE_NO_WARNINGS` hack, that's no longer necessary.
- curl_setup.h: delete `strcpy()` from the `_CRT_SECURE_NO_WARNINGS`
  list.

Closes #20076

7 months agolib547, 555: fix off-by-one null-terminator in read callback
Viktor Szakats [Tue, 23 Dec 2025 11:03:10 +0000 (12:03 +0100)] 
lib547, 555: fix off-by-one null-terminator in read callback

`strcpy()` wrote an unnecessary null-terminator past the available read
buffer.

test551 was also affected because it reuses lib547.

Cherry-picked from #20076
Closes #20082

7 months agocf-h1-proxy: support folded headers in CONNECT responses
Daniel Stenberg [Tue, 23 Dec 2025 12:54:12 +0000 (13:54 +0100)] 
cf-h1-proxy: support folded headers in CONNECT responses

Update test 1941 to verify this

Remove unused code from dynhds for handling folded headers, and the
associated unit tests of those functions in test 2602 and 2603.

Closes #20080

7 months agoGHA: update ngtcp2/nghttp3 to v1.14.0
renovate[bot] [Tue, 23 Dec 2025 12:35:07 +0000 (12:35 +0000)] 
GHA: update ngtcp2/nghttp3 to v1.14.0

Closes #20078

7 months agoGHA: update ngtcp2/ngtcp2 to v1.19.0
renovate[bot] [Tue, 23 Dec 2025 12:35:13 +0000 (12:35 +0000)] 
GHA: update ngtcp2/ngtcp2 to v1.19.0

Closes #20079

7 months agovquic: initialize new callback in nghttp3 1.14.0+
Viktor Szakats [Tue, 23 Dec 2025 11:24:30 +0000 (12:24 +0100)] 
vquic: initialize new callback in nghttp3 1.14.0+

Fixing (seen in curl-for-win production build):
```
lib/vquic/curl_ngtcp2.c:1257:1: error: missing field 'recv_settings2' initializer [-Werror,-Wmissing-field-initializers]
 1257 | };
      | ^
1 error generated.
```
Ref: https://ci.appveyor.com/project/curlorg/curl-for-win/builds/53281785#L6752
Ref: https://github.com/curl/curl/actions/runs/20459295003/job/58788229134#step:3:5513

Also:
- Mark previous callback deprecated.
- Document ngtcp2, nghttp3 versions for callback entry feature guards.

Refs:
https://github.com/ngtcp2/nghttp3/releases/tag/v1.14.0
https://github.com/ngtcp2/nghttp3/pull/432
https://github.com/ngtcp2/nghttp3/commit/1616ab835061d7cdd2ef114bc3ddb917ce269611

Closes #20077

7 months agocurlx: curlx_strcopy() instead of strcpy()
Daniel Stenberg [Sun, 21 Dec 2025 22:40:24 +0000 (23:40 +0100)] 
curlx: curlx_strcopy() instead of strcpy()

This function REQUIRES the size of the target buffer as well as the
length of the source string. Meant to make it harder to do a bad
strcpy().

Removes 23 calls to strcpy().

Closes #20067

7 months agoapple sectrust: fix ancient evaluation
Stefan Eissing [Wed, 17 Dec 2025 11:31:39 +0000 (12:31 +0100)] 
apple sectrust: fix ancient evaluation

On versions before macOS 10.14, ios 12 and watchos 5, check the
evaluation code to return the error from evaluation.

Reported-by: Stanislav Fort
Closes #20074

7 months agoCURLOPT_HAPROXY_CLIENT_IP.md: emphasize reused connection use
Daniel Stenberg [Mon, 22 Dec 2025 21:36:23 +0000 (22:36 +0100)] 
CURLOPT_HAPROXY_CLIENT_IP.md: emphasize reused connection use

Closes #20075

7 months agocontent_encoding: avoid strcpy
Daniel Stenberg [Mon, 22 Dec 2025 10:36:42 +0000 (11:36 +0100)] 
content_encoding: avoid strcpy

Build list with dynbuf.

Closes #20072

7 months agocurlx: rename `Curl_`-prefixed symbols to `curlx_`
Viktor Szakats [Sun, 21 Dec 2025 23:48:33 +0000 (00:48 +0100)] 
curlx: rename `Curl_`-prefixed symbols to `curlx_`

Closes #20069