]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
4 weeks agolib: eliminate size_t casts
Stefan Eissing [Wed, 12 Nov 2025 14:58:49 +0000 (15:58 +0100)] 
lib: eliminate size_t casts

Add new functions in `curlx/warnless.h` for controlled type
conversions:

* curlx_uitouz, convert unsigned into to size_t (should always work)
* curlx_uztoso, convert size_t to curl_off_t, capping at CURL_OFF_T_MAX
* curlx_sztouz, convert ssize_t to size_t, return TRUE when ok
* curlx_sotouz_range, convert curl_off_t to size_t interval, capping
  values to interval bounds

Remove some unnecesary casts, convert some internal recv functions
to the "return result, have size_t* arg" pattern.

Closes #19495

4 weeks agolib: rename curlx_timediff to curlx_timeleft_ms
Stefan Eissing [Wed, 12 Nov 2025 11:15:42 +0000 (12:15 +0100)] 
lib: rename curlx_timediff to curlx_timeleft_ms

Rename `Curl_timeleft()` to `Curl_timeleft_ms()` to make the units in
the returned `timediff_t` clear. (We used to always have ms there, but
with QUIC started to sometimes calc ns as well).

Rename some assigned vars without `_ms` suffix for clarity as well.

Closes #19486

4 weeks agotests/data: add `%includetext`, dedupe XML payloads into external file
Viktor Szakats [Thu, 13 Nov 2025 01:11:48 +0000 (02:11 +0100)] 
tests/data: add `%includetext`, dedupe XML payloads into external file

To reduce duplication and to avoid keeping XML-like markup within XML
markup (`test*`), that was tripping `xmllint`.

Ref: #19470

Closes #19504

4 weeks agoRELEASE-NOTES: codespell
Viktor Szakats [Thu, 13 Nov 2025 10:46:13 +0000 (11:46 +0100)] 
RELEASE-NOTES: codespell

4 weeks agoruntests: add missing Perl semicolon
Viktor Szakats [Thu, 13 Nov 2025 03:44:15 +0000 (04:44 +0100)] 
runtests: add missing Perl semicolon

Follow-up to f477f3efc3ec58f7effc2aa01e7f4565b12be976 #19398

Closes #19507

4 weeks agolibtests: replace `atoi()` with `curlx_str_number()`
Viktor Szakats [Thu, 13 Nov 2025 02:40:42 +0000 (03:40 +0100)] 
libtests: replace `atoi()` with `curlx_str_number()`

Also:
- lib1568: fail in global initialization error.

Closes #19506

4 weeks agoFILEFORMAT.md: drop some text from the `command` section
Viktor Szakats [Wed, 12 Nov 2025 22:20:58 +0000 (23:20 +0100)] 
FILEFORMAT.md: drop some text from the `command` section

Special meanings of URLs became outdated, and it's also no longer
necessary to pass the test number via the URL or domain anymore.
Delete the text.

Follow-up to c6f1b0ff49268817101ac1734f43074fcc8775b2 #19429

Closes #19503

4 weeks agocookie: propagate errors better, cleanup the internal API
Daniel Stenberg [Wed, 12 Nov 2025 12:16:33 +0000 (13:16 +0100)] 
cookie: propagate errors better, cleanup the internal API

Overhaul of the internal cookie APIs and an attempt to better return
errors for OOM and similar critical problems, separate from ordinary and
benign parsing problems.

Closes #19493

4 weeks agoschannel: replace atoi() with curlx_str_number()
Daniel Stenberg [Wed, 12 Nov 2025 10:27:36 +0000 (11:27 +0100)] 
schannel: replace atoi() with curlx_str_number()

The last atoi() call removed from libcurl

Closes #19483

4 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 13 Nov 2025 07:49:49 +0000 (08:49 +0100)] 
RELEASE-NOTES: synced

curlver: 8.18.0 is the next planned release version

4 weeks agoruntests: allow `client/command` to span multiple lines, and use it
Viktor Szakats [Wed, 12 Nov 2025 16:26:27 +0000 (17:26 +0100)] 
runtests: allow `client/command` to span multiple lines, and use it

Some curl command-lines are long, often repetitive, and difficult
to read or write:

Before this patch (1 test == 1 line):
- <=78 characters: 1099 tests
- 79-132 characters: 500 tests
- 133+ characters: 217 tests: patch meant to help with some of these.

After this patch:
- <=78 characters: 1288 lines
- 79-132 characters: 526 lines
- 133+ characters: 190 lines

After this patch it's possible to fold long lines into multiple ones.
Folding can reduce greppability, thus this is primarily useful for cases
when the options are repetitive, e.g. a list of form options, headers,
mail parameters and the like.

Closes #19500

4 weeks agoOS400: fix build
Patrick Monnerat [Wed, 12 Nov 2025 14:45:59 +0000 (15:45 +0100)] 
OS400: fix build

- Fix failed build due to missing parameter.

Follow-up to 8c9946d3 from yesterday.

Closes https://github.com/curl/curl/pull/19494

4 weeks ago_PROGRESS.md: add the E unit, mention kibibyte
Daniel Stenberg [Wed, 12 Nov 2025 22:15:37 +0000 (23:15 +0100)] 
_PROGRESS.md: add the E unit, mention kibibyte

The suffixes used are not standard since we want them to be single
characters and the proper ones would be KiB, MiB etc.

Closes #19502

4 weeks agotest716: use `repeat` macro
Viktor Szakats [Wed, 12 Nov 2025 19:34:53 +0000 (20:34 +0100)] 
test716: use `repeat` macro

Closes #19501

4 weeks agotests/data: use more `repeat` macro
Viktor Szakats [Wed, 12 Nov 2025 17:16:55 +0000 (18:16 +0100)] 
tests/data: use more `repeat` macro

Found in `client/command` sections.

Closes #19499

4 weeks agotest2045: replace HTML multi-line comment markup with `#` comments
Viktor Szakats [Wed, 12 Nov 2025 16:41:54 +0000 (17:41 +0100)] 
test2045: replace HTML multi-line comment markup with `#` comments

As used everywhere else in tests/data. To play nice with XML.

Follow-up to 9756d1da7637d1913b7ca2b589e4635f32ed3e00

Closes #19498

4 weeks agotest1404, 1547: replace `&` char in comment and name for XML-friendliness
Viktor Szakats [Wed, 12 Nov 2025 15:36:14 +0000 (16:36 +0100)] 
test1404, 1547: replace `&` char in comment and name for XML-friendliness

Closes #19497

4 weeks agotest1554: make test output XML-friendly
Viktor Szakats [Wed, 12 Nov 2025 15:05:52 +0000 (16:05 +0100)] 
test1554: make test output XML-friendly

Meaning no `<` and `>` characters.
Reducing the number of `xmllint` failures by 1.

Closes #19496

4 weeks agotest557: avoid `&` symbol in test output to be XML-friendly
Viktor Szakats [Tue, 11 Nov 2025 20:51:06 +0000 (21:51 +0100)] 
test557: avoid `&` symbol in test output to be XML-friendly

Closes #19492

4 weeks agotest363: delete stray character (typo) from a section tag
Viktor Szakats [Wed, 12 Nov 2025 14:21:27 +0000 (15:21 +0100)] 
test363: delete stray character (typo) from a section tag

Did not cause an issue in runtests. Caught by `xmllint`.

Follow-up to 63e9721b63d01518db83a664bc1e8373c352879e #19313

Closes #19490

4 weeks agotests/data: avoid tag markup in comments
Viktor Szakats [Wed, 12 Nov 2025 14:40:44 +0000 (15:40 +0100)] 
tests/data: avoid tag markup in comments

To avoid confusing `xmllint`, and reducing the number of files failing
`xmllint --format` from 169 to 144.

Closes #19491

4 weeks agotest2405: split off H2 tests to new test 2407, fix callback prototype
Viktor Szakats [Wed, 12 Nov 2025 09:27:36 +0000 (10:27 +0100)] 
test2405: split off H2 tests to new test 2407, fix callback prototype

To untangle the different curl/server requirements of these tests.
Also to make this test run for non-H2 builds. Searching the cause of
the flakiness documented in #19481.

Also:
- fix the callback function prototype. Detected by ASAN with this patch,
  though the issue was pre-existing.
  ```
  lib/cw-out.c:211:14: runtime error: call to function emptyWriteFunc
    through pointer to incorrect function type
    'unsigned long (*)(char *, unsigned long, unsigned long, void *)'
  tests/libtest/lib2405.c:72: note: emptyWriteFunc defined here
  SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior lib/cw-out.c:211:14
  ```
  Ref: https://github.com/curl/curl/actions/runs/19296686908/job/55180334364?pr=19487#step:44:3768

Follow-up to 96a5ce5a82eb0f08650649ffafb7bb4e51fc4444 #19481

Closes #19487

4 weeks agolib1509: make callbacks static
Viktor Szakats [Wed, 12 Nov 2025 12:30:12 +0000 (13:30 +0100)] 
lib1509: make callbacks static

Closes #19488

4 weeks agotest2405: report `fd_count*` variables on failure
Viktor Szakats [Wed, 12 Nov 2025 09:17:48 +0000 (10:17 +0100)] 
test2405: report `fd_count*` variables on failure

This test is frequently failing in macOS !ssl jobs:

"curl_multi_waitfds() should return at least the number of fds needed":
https://github.com/curl/curl/actions/runs/19290229745/job/55159015942 AM clang !ssl !debug brotli zstd
https://github.com/curl/curl/actions/runs/19289578332/job/55157058146 AM clang !ssl !debug brotli zstd
https://github.com/curl/curl/actions/runs/19188515879/job/54859474947 AM clang !ssl
https://github.com/curl/curl/actions/runs/19165077858/job/54783776869 AM clang !ssl libssh2 AppleIDN
https://github.com/curl/curl/actions/runs/19046554157/job/54396096298 AM gcc-12 !ssl !debug

"curl_multi_waitfds() should return the amount of fds needed if enough isn't passed in":
https://github.com/curl/curl/actions/runs/19184546172/job/54848549080 AM gcc-13 !ssl !debug

Also high on the test clutch list:
2405 FAIL times: 165
Ref: https://testclutch.curl.se/static/reports/results-count.html

```
libtests returned 44, when expecting 0

FAIL 2405: 'checking curl_multi_waitfds functionality' multi, HTTP, HTTP/2
```
44 = `CURLE_OBSOLETE44` = `TEST_ERR_FAILURE`

Also: fix a newline in log output.

Follow-up to c78044c07e97cb720049579f4fe3cab33a7ea8d3 #15146 #15155

Closes #19481

4 weeks agohostip: don't store negative lookup on OOM
Daniel Stenberg [Wed, 12 Nov 2025 10:59:25 +0000 (11:59 +0100)] 
hostip: don't store negative lookup on OOM

When convert_ipaddr_direct() returns error due to OOM, it must not be
stored as a negative cache result.

Closes #19484

4 weeks agoOS400/makefile.sh: fix shellcheck warning SC2038 differently
Viktor Szakats [Wed, 12 Nov 2025 08:50:10 +0000 (09:50 +0100)] 
OS400/makefile.sh: fix shellcheck warning SC2038 differently

Reported-by: Patrick Monnerat
Bug: https://github.com/curl/curl/pull/19451#discussion_r2517335957
Follow-up to af5a1647afa8aaf7cafc1e87af529a4cd48cb240 #19451

Closes #19482

4 weeks agolibssh2: replace atoi() in ssh_force_knownhost_key_type
Daniel Stenberg [Wed, 12 Nov 2025 07:49:13 +0000 (08:49 +0100)] 
libssh2: replace atoi() in ssh_force_knownhost_key_type

Closes #19479

4 weeks agolibssh2: cleanup ssh_force_knownhost_key_type
Daniel Stenberg [Wed, 12 Nov 2025 07:45:56 +0000 (08:45 +0100)] 
libssh2: cleanup ssh_force_knownhost_key_type

- Use arrays instead pointers
- Narrow variable scopes

Closes #19479

4 weeks agohttp: replace atoi use in Curl_http_follow with curlx_str_number
Daniel Stenberg [Wed, 12 Nov 2025 07:38:45 +0000 (08:38 +0100)] 
http: replace atoi use in Curl_http_follow with curlx_str_number

In an attempt to weed out atoi() use all over.

Closes #19478

4 weeks agotelnet: replace atoi for BINARY handling with curlx_str_number
Daniel Stenberg [Wed, 12 Nov 2025 07:32:31 +0000 (08:32 +0100)] 
telnet: replace atoi for BINARY handling with curlx_str_number

Also, only consider 0 to be a valid switch-off. Previously any value
except 1 had the same effect.

Closes #19477

4 weeks agonoproxy: replace atoi with curlx_str_number
Daniel Stenberg [Wed, 12 Nov 2025 07:17:48 +0000 (08:17 +0100)] 
noproxy: replace atoi with curlx_str_number

To better reject junk and detect overflows. There were already
additional precautions and protections in place, but this is cleaner.

Extended the 1614 unit tests with some more bad syntax cases.

Closes #19475

4 weeks agosrc/checksrc: ban atoi use
Daniel Stenberg [Wed, 12 Nov 2025 08:31:48 +0000 (09:31 +0100)] 
src/checksrc: ban atoi use

4 weeks agotool_operate: use curlx_str_number intead of atoi
Daniel Stenberg [Wed, 12 Nov 2025 08:30:37 +0000 (09:30 +0100)] 
tool_operate: use curlx_str_number intead of atoi

For consistency. This instance is for debug-only code and is not
important.

Closes #19480

4 weeks agobadwords: re-sync with curl-www, fix issues found
Viktor Szakats [Tue, 11 Nov 2025 16:43:06 +0000 (17:43 +0100)] 
badwords: re-sync with curl-www, fix issues found

Also:
- replace `manpage` with `man page`, add to `badwords.txt`.
- badwords.pl: import `-w` feature from curl-www, syncing the two
  scripts fully.
- badwords.txt: import missing items from curl-www, syncing the two
  files fully.
- pyspelling.words: drop `cURL` allowed word.

Closes #19468

4 weeks agoautotools: drop autoconf <2.59 compatibility code (zz60-xc-ovr)
Viktor Szakats [Tue, 11 Nov 2025 14:28:36 +0000 (15:28 +0100)] 
autotools: drop autoconf <2.59 compatibility code (zz60-xc-ovr)

The minimum required autoconf is 2.59, since curl 7.76.0 (2021).

Follow-up to a59f04611629f0db9ad8e768b9def73b9b4d9423 #6748

Closes #19464

4 weeks agomk-ca-bundle.pl: use `open()` with argument list to replace backticks
Viktor Szakats [Tue, 11 Nov 2025 10:09:36 +0000 (11:09 +0100)] 
mk-ca-bundle.pl: use `open()` with argument list to replace backticks

On Windows this requires Perl 5.22 from year 2015.

Also:
- mdlinkcheck: delete redundant error handling logic.
  Follow-up to 77be4a7ab2b5a0c633b9107fd286bda1f57e4725 #19437

Closes #19461

4 weeks agodocs: Line endings are no longer significant in test files 19469/head
Dan Fandrich [Tue, 11 Nov 2025 08:50:52 +0000 (00:50 -0800)] 
docs: Line endings are no longer significant in test files

Since commit f477f3efc, CR/LF characters in test files are no longer
significant, making the files a little more XML-like.

Closes #19469

4 weeks agocf-socket: split out the MTU and GRO setopts into sep functions
Daniel Stenberg [Tue, 11 Nov 2025 15:41:57 +0000 (16:41 +0100)] 
cf-socket: split out the MTU and GRO setopts into sep functions

It simplifies the #ifdefs and declaring of local variables slightly.

Closes #19467

4 weeks agoccsidcurl: make curl_mime_data_ccsid() use the converted size
Daniel Stenberg [Tue, 11 Nov 2025 14:53:07 +0000 (15:53 +0100)] 
ccsidcurl: make curl_mime_data_ccsid() use the converted size

dynconvert() now offers to return the size of the converted data as it
might be different that the provided input size.

Bonus: minor indent fixing of some closing braces.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19465

4 weeks agonoproxy: simplify Curl_check_noproxy
Daniel Stenberg [Tue, 11 Nov 2025 15:12:21 +0000 (16:12 +0100)] 
noproxy: simplify Curl_check_noproxy

By creating two separate matching functions for name and IP.

Closes #19466

4 weeks agoftp: remove #ifdef for define that is always defined
Daniel Stenberg [Tue, 11 Nov 2025 13:39:20 +0000 (14:39 +0100)] 
ftp: remove #ifdef for define that is always defined

The CURL_FTP_HTTPSTYLE_HEAD logic was added back in 2007 with the
intention to remove that logic one day, but since we never bump the
SONAME it is not likely to happen anytime soon. Remove again for
readability.

Follow-up to 3217809294b

Closes #19463

4 weeks agowolfssl: avoid NULL dereference in OOM situation
Daniel Stenberg [Tue, 11 Nov 2025 08:06:13 +0000 (09:06 +0100)] 
wolfssl: avoid NULL dereference in OOM situation

Verify that wolfSSL_BIO_meth_new() actually works and handle situations
where it returns NULL.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19459

4 weeks agoprogress: show fewer digits
Daniel Stenberg [Sun, 9 Nov 2025 23:46:53 +0000 (00:46 +0100)] 
progress: show fewer digits

Without unit, show up to 99999 "raw" (5 digits). After that, prefer to
show the number as less than 1000 per unit and use single decimal
fraction. Like '123.4M' (spending 6 characters).

This now makes the largest possible size to show 8.0E (exabytes).

Probably makes the output easier to read.

Fixes #19431
Reported-by: Fd929c2CE5fA on github
Closes #19433

4 weeks agocf-https-connect: allocate ctx at first in cf_hc_create()
x2018 [Mon, 10 Nov 2025 16:29:29 +0000 (00:29 +0800)] 
cf-https-connect: allocate ctx at first in cf_hc_create()

Closes #19454

4 weeks agokrb5_sspi: unify a part of error handling
x2018 [Mon, 10 Nov 2025 15:55:02 +0000 (23:55 +0800)] 
krb5_sspi: unify a part of error handling

Closes #19452

4 weeks agorustls: fix a potential memory issue
x2018 [Sun, 9 Nov 2025 16:24:10 +0000 (00:24 +0800)] 
rustls: fix a potential memory issue

Closes #19425

4 weeks agosftp: fix range downloads in both SSH backends
Daniel Stenberg [Tue, 11 Nov 2025 08:42:16 +0000 (09:42 +0100)] 
sftp: fix range downloads in both SSH backends

When asking for the last N bytes of a file, and that size was larger
than the file size, it would miss the first byte due to a logic error.

The fixed range parser is now made a common function in the file now
renamed to vssh.c (from curl_path.c) - used by both backends.

Unit test 2605 verifies the parser.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19460

5 weeks agoGHA/linux: build and enable nghttp2 for Fil-C job
Viktor Szakats [Mon, 10 Nov 2025 21:30:24 +0000 (22:30 +0100)] 
GHA/linux: build and enable nghttp2 for Fil-C job

pytests after: 527 passed, 286 skipped
pytests before: 392 passed, 423 skipped

runtests after: TESTDONE: 1646 tests out of 1646 reported OK: 100%
runtests before: TESTDONE: 1643 tests out of 1643 reported OK: 100%

Ref: b81d30ade314af7c3197dfcef2d978428b96b009 #19458

Closes #19457

5 weeks agopytest: fix conditions for test_02_28
Viktor Szakats [Mon, 10 Nov 2025 21:43:59 +0000 (22:43 +0100)] 
pytest: fix conditions for test_02_28

- allow 02_28 to run in HTTP/1.1 without H2 support again.
  Follow-up to 3752de465d70552106b2527fbf821aee525e53e2 #19412

- fix to skip 02_28 for all protocols for curl without compression
  support (either zlib, brotli or ztsd).

Closes #19458

5 weeks agoGHA/linux: disable test 776 in valgrind jobs to avoid delay
Viktor Szakats [Mon, 10 Nov 2025 20:26:25 +0000 (21:26 +0100)] 
GHA/linux: disable test 776 in valgrind jobs to avoid delay

Saving ~30 seconds in jobs affected.

Closes #19456

5 weeks agoOS400/makefile.sh: fix shellcheck warning SC2038
Viktor Szakats [Mon, 10 Nov 2025 15:54:57 +0000 (16:54 +0100)] 
OS400/makefile.sh: fix shellcheck warning SC2038

Also:
- OS400/makefile.sh: use end-of-options marker in xargs command.
- OS400/make-tests.sh: drop warning suppression.
  Seems to not trigger anymore as of shellcheck 0.11.0

Closes #19451

5 weeks agoscripts: use end-of-options marker in `find -exec` commands
Viktor Szakats [Mon, 10 Nov 2025 15:49:11 +0000 (16:49 +0100)] 
scripts: use end-of-options marker in `find -exec` commands

Closes #19450

5 weeks agoverify-release: update to avoid shellcheck warning SC2034
Viktor Szakats [Mon, 10 Nov 2025 14:08:19 +0000 (15:08 +0100)] 
verify-release: update to avoid shellcheck warning SC2034

```
SC2034: dl appears unused
```

Also to shorten the code.

Closes #19449

5 weeks agomdlinkcheck: pass curl arguments to `open()` as list
Viktor Szakats [Mon, 10 Nov 2025 00:27:25 +0000 (01:27 +0100)] 
mdlinkcheck: pass curl arguments to `open()` as list

To prevent misinterpreting quotes or other special characters.

Requires Perl 5.22+ (2015-Jun-01) on Windows.

Ref: https://perldoc.perl.org/functions/open

Closes #19437

5 weeks agoscripts: fix shellcheck SC2046 warnings
Viktor Szakats [Sun, 9 Nov 2025 23:32:02 +0000 (00:32 +0100)] 
scripts: fix shellcheck SC2046 warnings

Fix SC2046: "Quote this to prevent word splitting."
Ref: https://www.shellcheck.net/wiki/SC2046

Also:
- shellcheck.sh: add `set -eu`.
- shellcheck.sh, yamlcheck.sh: always run from repo root.
- pass `--` before passing the list of files, where missing.
- badwords.pl, cleancmd.pl: rework to accept `git ls-files` arguments.
  Requires Perl 5.22+ (2015-Jun-01) on Windows.
  Ref: https://perldoc.perl.org/functions/open
- INTERNALS.md: require Perl 5.22 on Windows.
- spacecheck.pl: formatting.
- GHA/http3-linux: rework command to avoid SC2046.
- stop suppressing SC2046 warnings.

The yamlcheck.sh issue reported-by: Stanislav Fort (Aisle Research)
Ref: 20251109163515_6eb31da3-deb2-4f4d-8327-935904f27da5

Closes #19432

5 weeks agotests/data: support using native newlines on disk, drop `.gitattributes`
Viktor Szakats [Fri, 7 Nov 2025 15:39:29 +0000 (16:39 +0100)] 
tests/data: support using native newlines on disk, drop `.gitattributes`

Data files no longer depend on mixed newline styles. Before this
patch the harness still assumed data files to use LF newlines,
ensured by `.gitattribute` and distributing sources with LF newlines.

To allow using platform native newlines (CRLF on Windows typically),
update the test harness to support data files with any newline style
on disk. And delete `.gitattributes`.

Fix to:
- load original data files (from test/data) so that their newline-style
  doesn't matter on the checked out source repo, meaning it works
  when its CRLF on Windows, just like any other file.
  (if a BOM slips in, it's caught by `spacecheck.pl` as binary content.)
- do the same in `util.py` used by `smbserver.py` (for test 1451).
- also fix `util.py` to use us-ascii encoding for data files, replacing utf-8.

Also:
- runtests: rework the stray CR checker to allow full CRLF data files,
  and keep warning for mixed newlines.

Follow-up to 904e7ecb66519951681377758fe6b07dde28ce36 #19347

Closes #19398

5 weeks agoexamples/crawler: fix variable
Daniel Stenberg [Mon, 10 Nov 2025 12:17:37 +0000 (13:17 +0100)] 
examples/crawler: fix variable

A variable missed in the previous rename cleanup

Follow-up to 928363f28ca533d743adcb70597c3e30917
Reported-by: Gisle Vanem
Closes #19446

5 weeks agosocks_sspi: use free() not FreeContextBuffer()
Daniel Stenberg [Mon, 10 Nov 2025 10:08:26 +0000 (11:08 +0100)] 
socks_sspi: use free() not FreeContextBuffer()

The memory is allocated with malloc().

This reverts commit 1d01d4975f540f3a363b38e1296aead62130fc6d.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19445

5 weeks agoOS400/ccsidcurl: fix curl_easy_setopt_ccsid for non-converted blobs
Daniel Stenberg [Mon, 10 Nov 2025 09:26:19 +0000 (10:26 +0100)] 
OS400/ccsidcurl: fix curl_easy_setopt_ccsid for non-converted blobs

When a blob option is used and it does not convert, the code would
erroneously pass along an uninitialized stack struct.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19444

5 weeks agoRELEASE-NOTES: spellcheck
Daniel Stenberg [Mon, 10 Nov 2025 09:41:38 +0000 (10:41 +0100)] 
RELEASE-NOTES: spellcheck

5 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 10 Nov 2025 09:09:03 +0000 (10:09 +0100)] 
RELEASE-NOTES: synced

5 weeks agorenovate.json: drop parentheses from group names
Daniel Stenberg [Mon, 10 Nov 2025 08:23:56 +0000 (09:23 +0100)] 
renovate.json: drop parentheses from group names

They make git branch names using those parentheses, that need to be
quoted when used with git command lines. Avoid parentheses for easier to
use branch names.

Follow-up to f77c574445532e3c17e62

Closes #19441

5 weeks agoGHA: update awslabs/aws-lc to v1.63.0
renovate[bot] [Mon, 10 Nov 2025 01:01:14 +0000 (01:01 +0000)] 
GHA: update awslabs/aws-lc to v1.63.0

Closes #19435

5 weeks agodigest_sspi: properly free sspi identity
x2018 [Sun, 9 Nov 2025 17:44:27 +0000 (01:44 +0800)] 
digest_sspi: properly free sspi identity

Closes #19426

5 weeks agourlapi: fix mem-leaks in curl_url_get error paths
Daniel Stenberg [Mon, 10 Nov 2025 07:47:51 +0000 (08:47 +0100)] 
urlapi: fix mem-leaks in curl_url_get error paths

Reported-by: Stanislav Fort (Aisle Research)
Closes #19440

5 weeks agoschannel: fix potental memory leak of cert_store_path on four error paths
x2018 [Sun, 9 Nov 2025 14:20:24 +0000 (22:20 +0800)] 
schannel: fix potental memory leak of cert_store_path on four error paths

Closes #19423

5 weeks agomqtt: properly handle the message which exceeds maxsize
x2018 [Sun, 9 Nov 2025 11:19:13 +0000 (19:19 +0800)] 
mqtt: properly handle the message which exceeds maxsize

We should goto fail as topic is allocated.

Follow-up to 92fd791

Closes #19417

5 weeks agocshutdn: acknowledge FD_SETSIZE for shutdown descriptors
Stanislav Fort [Mon, 10 Nov 2025 07:18:53 +0000 (08:18 +0100)] 
cshutdn: acknowledge FD_SETSIZE for shutdown descriptors

In the logic called for curl_multi_fdset().

File descriptors larger than FD_SETSIZE size are simply ignored, which
of course will make things break but at least it does not trash memory.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19439

5 weeks agortmp: fix double-free on URL parse errors
Daniel Stenberg [Mon, 10 Nov 2025 07:11:30 +0000 (08:11 +0100)] 
rtmp: fix double-free on URL parse errors

Reported-by: Stanislav Fort (Aisle Research)
Closes #19438

5 weeks agowcurl: import v2025.11.09
Samuel Henrique [Sun, 9 Nov 2025 14:37:24 +0000 (06:37 -0800)] 
wcurl: import v2025.11.09

Closes #19430

5 weeks agosetopt: disable CURLOPT_HAPROXY_CLIENT_IP on NULL
Daniel Stenberg [Mon, 10 Nov 2025 00:02:37 +0000 (01:02 +0100)] 
setopt: disable CURLOPT_HAPROXY_CLIENT_IP on NULL

As documented.

Reported-by: Stanislav Fort (Aisle Research)
Closes #19434

5 weeks agoprocesshelp.pm: log taskkill pid info, add debug envs, enable in CI
Viktor Szakats [Sun, 9 Nov 2025 12:54:49 +0000 (13:54 +0100)] 
processhelp.pm: log taskkill pid info, add debug envs, enable in CI

To debug the Windows CI fails further. Acting on the suspicions that
`taskkill` may sometimes be applied to the wrong process.

- log task info, and task child info before calling `taskkill` on a PID.
  (on native Windows.)
  One of the calls needs PowerShell.

- add env `CURL_TEST_NO_TASKKILL` to disable using `taskkill`.

- add env `CURL_TEST_NO_TASKKILL_TREE` to use `taskkill` without
  `-t`, meaning to kill the process, but not child processes.

- GHA/windows: disable `taskkill` calls, to see what happens.
  I'll revert or tweak this in a future commit depending on results.

Ref: https://github.com/curl/curl/discussions/14854#discussioncomment-13062859
Ref: https://github.com/curl/curl/discussions/14854#discussioncomment-14913014

Closes #19421

5 weeks agotests/server: do not fall back to original data file in `test2fopen()`
Viktor Szakats [Sun, 9 Nov 2025 18:37:28 +0000 (19:37 +0100)] 
tests/server: do not fall back to original data file in `test2fopen()`

Before this patch servers were loading the original data source file
(from `tests/data/test*`) if they failed to open the preprocessed data
file.

It was causing issues in many (most?) tests, because original data files
are not preprocessed, thus may be incomplete and/or come with wrong
newline characters. It's also causing difficult to diagnose issues when
a test accidentally references another test's data, which by chance
makes the test pass initially, until either that or the executed test
data gets an update, and breaking it, as seen in #19329.

Historically, the fallback existed first, then the preprocessed copy.
The fallback is no longer used by tests (except by stray accidents).

Fix it by dropping the fallback logic and relying on the preprocessed
data file saved there by the runtests framework.

Also fix two remaining test data cross-references:
- test1565: reference own server input data instead of test1's.
- test3014: reference own server input data instead of test1439's.
  Ref: #19398

Follow-up to aaf9522a2c28e5142c7f5640da4e24b65b47dc53 #19329

Closes #19429

5 weeks agotests/data: replace hard-coded test numbers with `%TESTNUMBER`
Viktor Szakats [Sun, 9 Nov 2025 18:02:00 +0000 (19:02 +0100)] 
tests/data: replace hard-coded test numbers with `%TESTNUMBER`

Closes #19427

5 weeks agotests/data: delete stray space indentation from xml tags
Viktor Szakats [Tue, 4 Nov 2025 13:51:31 +0000 (14:51 +0100)] 
tests/data: delete stray space indentation from xml tags

Closes #19428

5 weeks agocmake: adjust defaults for target platforms not supporting shared libs
Viktor Szakats [Sat, 8 Nov 2025 01:27:23 +0000 (02:27 +0100)] 
cmake: adjust defaults for target platforms not supporting shared libs

If CMake reports the target platform not supporting shared libs, turn
`BUILD_SHARED_LIBS` off by default. CMake 3.30+ fails with an error
when trying to create a `SHARED` target for such platforms. Earlier
versions used a workaround that may or may not have worked in practice.

Ref: https://cmake.org/cmake/help/v3.30/policy/CMP0164.html

Seen this with a build setting `-DCMAKE_SYSTEM_NAME=Generic`, e.g.
AmigaOS.

Note this may introduce incompatibility for "Generic" targets, which
support shared libs. If that's the case, set `BUILD_SHARED_LIBS=ON`
manually.

Also drop AmigaOS-specific logic handled automatically after this patch.

Ref: https://cmake.org/cmake/help/v3.7/command/get_property.html
Ref: https://cmake.org/cmake/help/v3.7/prop_gbl/TARGET_SUPPORTS_SHARED_LIBS.html

Closes #19420

5 weeks agotests/data: replace `%CR` with `crlf=headers` where possible
Viktor Szakats [Sun, 9 Nov 2025 14:54:11 +0000 (15:54 +0100)] 
tests/data: replace `%CR` with `crlf=headers` where possible

Missed them in previous rounds of updates:
test 433, 1375, 1376, 1377, 1429

Closes #19424

5 weeks agoINSTALL-CMAKE.md: document static option defaults more
Viktor Szakats [Sun, 9 Nov 2025 11:56:42 +0000 (12:56 +0100)] 
INSTALL-CMAKE.md: document static option defaults more

Closes #19419

5 weeks agoTODO: improve code for large MQTT payloads
Daniel Stenberg [Sun, 9 Nov 2025 10:45:03 +0000 (11:45 +0100)] 
TODO: improve code for large MQTT payloads

Closes #19416

5 weeks agomqtt: reject overly big messages
Daniel Stenberg [Sun, 9 Nov 2025 10:12:06 +0000 (11:12 +0100)] 
mqtt: reject overly big messages

Reported-by: Jiyong Yang
Closes #19415

5 weeks agoftp: refactor a piece of code by merging the repeated part
x2018 [Sat, 8 Nov 2025 17:54:51 +0000 (01:54 +0800)] 
ftp: refactor a piece of code by merging the repeated part

Closes #19411

5 weeks agoasyn-thrdd: release rrname if ares_init_options fails
x2018 [Sat, 8 Nov 2025 16:37:16 +0000 (00:37 +0800)] 
asyn-thrdd: release rrname if ares_init_options fails

Closes #19410

5 weeks agotftp: release filename if conn_get_remote_addr fails
x2018 [Sat, 8 Nov 2025 15:44:58 +0000 (23:44 +0800)] 
tftp: release filename if conn_get_remote_addr fails

Closes #19409

5 weeks agoopenssl: release ssl_session if sess_reuse_cb fails
x2018 [Sat, 8 Nov 2025 12:07:54 +0000 (20:07 +0800)] 
openssl: release ssl_session if sess_reuse_cb fails

Closes #19405

5 weeks agoGHA/linux: stop disabling TLS-SRP tests in event-based & duphandle jobs
Viktor Szakats [Sat, 8 Nov 2025 21:54:08 +0000 (22:54 +0100)] 
GHA/linux: stop disabling TLS-SRP tests in event-based & duphandle jobs

They were disabled since these jobs ran in Zuul. The tests are 320, 321,
322, 323, 324. Of which, 323 runs in CI, the rest needs `gnutls-serv`
with SRP enabled, which is not available in current jobs and no longer
offered by Ubuntu's `gnutls-bin` package. 324 doesn't appear as
a skipped test, 323 seems to be running fine, the rest are logged as
skipped. This suggests it's safe to drop the exceptions.

Closes #19413

5 weeks agoGHA/linux: build and test LibreSSL with Fil-C curl, enable pytests
Viktor Szakats [Sat, 8 Nov 2025 12:54:11 +0000 (13:54 +0100)] 
GHA/linux: build and test LibreSSL with Fil-C curl, enable pytests

Build and cache LibreSSL locally with Fil-C and enable it in the Fil-C
job.

Also:
- disable test 776 in the Fil-C job. It fails consistently, and due to
  flakiness seen earlier its result is disabled. In this job it seems to
  be adding 1 to 9 minues to the test run step and fails consistently.
- include Fil-C version in the LibreSSL cache key to prepare for Fil-C
  ABI changes.
- GHA/linux: fully quote `tflags` values to avoid breaking YAML.

Tested and confirmed working with OpenSSL too, but ended up with
LibreSSL for faster, smaller builds.

Closes #19407

5 weeks agopytest: skip H2 tests if feature missing from curl
Viktor Szakats [Sat, 8 Nov 2025 17:23:32 +0000 (18:23 +0100)] 
pytest: skip H2 tests if feature missing from curl

To allow running pytests on more curl configurations.

Also delete a redundant H3 feature check from test_17_14_expired_cert.

Cherry-picked from #19407
Closes #19412

5 weeks agoCURLOPT_SSH_KEYFUNCTION.md: fix minor indent mistake in example
Daniel Stenberg [Sat, 8 Nov 2025 16:49:30 +0000 (17:49 +0100)] 
CURLOPT_SSH_KEYFUNCTION.md: fix minor indent mistake in example

5 weeks agoCURLOPT_READFUNCTION.md: clarify the size of the buffer
Daniel Stenberg [Sat, 8 Nov 2025 11:43:24 +0000 (12:43 +0100)] 
CURLOPT_READFUNCTION.md: clarify the size of the buffer

No need to multiply with size as size is always 1 - and documented so.

Closes #19402

5 weeks agoCURLINFO_SCHEME/PROTOCOL: they return the "scheme" for a "transfer"
Daniel Stenberg [Sat, 8 Nov 2025 16:09:31 +0000 (17:09 +0100)] 
CURLINFO_SCHEME/PROTOCOL: they return the "scheme" for a "transfer"

Not protocol. Not for connection.

Closes #19403

5 weeks agoCURLINFO_TLS_SSL_PTR.md: remove CURLINFO_TLS_SESSION text
Daniel Stenberg [Sat, 8 Nov 2025 11:58:13 +0000 (12:58 +0100)] 
CURLINFO_TLS_SSL_PTR.md: remove CURLINFO_TLS_SESSION text

That option is properly documented in its own page.

Closes #19404

5 weeks agoCURLINFO: remove 'get' and 'get the' from each short desc
Daniel Stenberg [Sat, 8 Nov 2025 12:09:50 +0000 (13:09 +0100)] 
CURLINFO: remove 'get' and 'get the' from each short desc

The short descriptions describe the data each info retrieves. The info
itself does not 'get' the data.

This simplifies and shortens the descriptions and make them more
consistent.

Closes #19406

5 weeks agovtls: fix CURLOPT_CAPATH use
Stefan Eissing [Sat, 8 Nov 2025 13:28:38 +0000 (14:28 +0100)] 
vtls: fix CURLOPT_CAPATH use

A regression in curl 8.17.0 led to a customer CAPATH set by the
application (or the curl command) to be ignored unless licurl was built
with a default CAPATH.

Add test cases using `--capath` on the custom pytest CA, generated with
the help of the openssl command when available.

Fixes #19401
Reported-by: Brad King
Closes #19308

5 weeks agoGHA/linux: add minimal Fil-C build with tests
Viktor Szakats [Thu, 6 Nov 2025 22:59:16 +0000 (23:59 +0100)] 
GHA/linux: add minimal Fil-C build with tests

Requirements for Fil-C:
- not to accidentally pick up system headers. E.g. from `/usr/include`
  on Linux. It can happen when any dependency is auto-detected on this
  header path. This makes Fil-C find the wrong system headers, which
  in turn breaks the configuration step in subtle ways (with CMake) and
  less subtle ways (autotools). Then CMake ends up running into an error
  while compiling.
- build all dependencies with Fil-C too.
  (this patch doesn't build any dependencies yet.)
- "unity" mode disabled. It should work, but needs a lot of memory and
  slower than a standard compiler, or a Fil-C non-unity build.
- x86_64 Linux host platform when using the pre-built toolchain.

Observations on a minimal, static build made with no dependencies and
Fil-C 0.674 (based on clang 20.1.8).
- curl tool sizes:
  - cmake, default, w/o -O: 30 MB (gcc 14.2.0: 1.7 MB)
  - cmake, default, w/o -O, stripped: 29.6 MB (gcc: 1.4 MB)
  - cmake, Release, -O3: 7.2 MB (gcc: 1 MB)
  - cmake, Release, -O3, stripped: 6.8 MB (gcc: 0.93 MB)
  - autotools, default, -O2: 7 MB
- libcurl.a size is 32 MB (cmake, default, w/o -O) (gcc: 2.7 MB)
- build times 3-3.5x longer (compared to system gcc 14.2.0):
- all runtests available pass OK.
- all pytests skipped due to missing features/dependencies.
- shared libcurl builds also work (cmake, default: 25 MB libcurl.so and
  5.75 MB (5.6 stripped) curl tool)
- autotools works fine too, with dependencies disabled or set to avoid
  `/usr/include`.

Closes #19391

5 weeks agovtls: handle possible malicious certs_num from peer
x2018 [Fri, 7 Nov 2025 12:51:22 +0000 (20:51 +0800)] 
vtls: handle possible malicious certs_num from peer

For GnuTLS, mbedTLS, Rustls, Schannel and wolfSSL

This check was previously added for OpenSSL in 3df71e6dc23e80466c2d448

Closes #19397

5 weeks agortmp: precaution for a potential integer truncation
x2018 [Fri, 7 Nov 2025 16:43:51 +0000 (00:43 +0800)] 
rtmp: precaution for a potential integer truncation

On some platforms, socket descriptors may use types larger than int.
When these values exceed INT_MAX, conversion to int can truncate to
negative values causing RTMP connection failures, and even accidentally
affect other socket when high-value descriptors map to existing
lower-value sockets after integer conversion. This check ensures socket
values are within the safe range before passing them to the RTMP
library.

Closes #19399

5 weeks agolib: fix gssapi.h include on IBMi
Andrew [Mon, 3 Nov 2025 13:53:00 +0000 (13:53 +0000)] 
lib: fix gssapi.h include on IBMi

Fixes #19336
Closes #19337

5 weeks agogtls: skip session resumption when verifystatus is set
Daniel Stenberg [Fri, 7 Nov 2025 12:10:48 +0000 (13:10 +0100)] 
gtls: skip session resumption when verifystatus is set

Resumed TLS sessions skip OCSP stapled-response verification. Force a
full handshake so verifystatus() runs.

Follow-up to 4bfd7a961521e1fd6aab7610e931d82a342781

Pointed out by ZeroPath

5 weeks agodocs: mention umask need when curl creates files
Daniel Stenberg [Fri, 7 Nov 2025 12:42:36 +0000 (13:42 +0100)] 
docs: mention umask need when curl creates files

for cookies, alt-svc and HSTS, command line and library

Closes #19396

5 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 7 Nov 2025 12:06:28 +0000 (13:06 +0100)] 
RELEASE-NOTES: synced