]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
2 weeks agohttp: add asserts for null terminator for input strings
Daniel Stenberg [Fri, 28 Nov 2025 08:43:27 +0000 (09:43 +0100)] 
http: add asserts for null terminator for input strings

http_rw_hd() assumes the null terminator is present. These asserts make
sure this remains true.

Closes #19741

2 weeks agoGHA/linux-old: add support for using custom CMake versions
Viktor Szakats [Fri, 28 Nov 2025 00:23:57 +0000 (01:23 +0100)] 
GHA/linux-old: add support for using custom CMake versions

Install CMake from the Kitware GitHub release archive. To allow choosing
its version independently from the OS.

Switch to 3.7.0 (from 3.7.2) to test the earliest supported version.
Also tested OK with 3.18.4 and 3.7.2.

The download and install step takes 1-2 seconds.

Follow-up to c9e50e9e393508c6a28c695abcf62980b3c1b023 #19737

Closes #19738

2 weeks agoGHA: update dependency pyspelling to v2.12.1
renovate[bot] [Thu, 27 Nov 2025 01:01:01 +0000 (01:01 +0000)] 
GHA: update dependency pyspelling to v2.12.1

Closes #19712

2 weeks agoGHA: update dependency google/boringssl to v0.20251124.0
renovate[bot] [Wed, 26 Nov 2025 01:19:06 +0000 (01:19 +0000)] 
GHA: update dependency google/boringssl to v0.20251124.0

Closes #19685

2 weeks agoGHA/linux-old: stop installing `groff`, it is unused
Viktor Szakats [Fri, 28 Nov 2025 01:40:19 +0000 (02:40 +0100)] 
GHA/linux-old: stop installing `groff`, it is unused

2 weeks agoappveyor: add support for using custom CMake versions
Viktor Szakats [Thu, 27 Nov 2025 22:23:18 +0000 (23:23 +0100)] 
appveyor: add support for using custom CMake versions

To allow more flexibility and not be limited by defaults offered by
the runner machines:
- Visual Studio 2013: CMake 3.12.2
- Visual Studio 2015, 2017: CMake 3.16.2
Ref: https://www.appveyor.com/docs/windows-images-software/

Start using 3.18.4, 3.19.8, 3.20.6 in older VS jobs to add variations.

Time cost is a couple of seconds per job.

Ref: #18704 (Discussion)
Ref: #16973

Closes #19737

2 weeks agounit1653: replace local macro with `Curl_safefree()`
Viktor Szakats [Thu, 27 Nov 2025 19:48:43 +0000 (20:48 +0100)] 
unit1653: replace local macro with `Curl_safefree()`

Cherry-picked from #19626
Closes #19736

2 weeks agomemdebug: replace `(fwrite)` with `fwrite`
Viktor Szakats [Thu, 20 Nov 2025 02:57:45 +0000 (03:57 +0100)] 
memdebug: replace `(fwrite)` with `fwrite`

Cherry-picked from #19626
Closes #19735

2 weeks agocurl_setup.h: drop superfluous parenthesis from `Curl_safefree` macro
Viktor Szakats [Thu, 27 Nov 2025 19:08:43 +0000 (20:08 +0100)] 
curl_setup.h: drop superfluous parenthesis from `Curl_safefree` macro

Cherry-picked from #19626
Closes #19734

2 weeks agoCODE_STYLE.md: sync banned function list with checksrc.pl
Viktor Szakats [Thu, 27 Nov 2025 17:32:35 +0000 (18:32 +0100)] 
CODE_STYLE.md: sync banned function list with checksrc.pl

Also alpha sort the list in checksrc.pl.

Closes #19733

2 weeks agombedtls_threadlock: avoid calloc, use array
Daniel Stenberg [Thu, 27 Nov 2025 16:42:55 +0000 (17:42 +0100)] 
mbedtls_threadlock: avoid calloc, use array

Closes #19732

2 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 27 Nov 2025 15:14:37 +0000 (16:14 +0100)] 
RELEASE-NOTES: synced

2 weeks agotests: allow 2500-2503 to use ~2MB malloc
Daniel Stenberg [Thu, 27 Nov 2025 14:55:47 +0000 (15:55 +0100)] 
tests: allow 2500-2503 to use ~2MB malloc

On Linux using UDP_GRO, curl might allocate a (single) 1.5MB buffer for
maximum performance.

Fixes #19716
Closes #19731

2 weeks agoGHA/http3-linux: add H3 valgrind tests
Viktor Szakats [Thu, 27 Nov 2025 11:17:27 +0000 (12:17 +0100)] 
GHA/http3-linux: add H3 valgrind tests

Ref: #19714
Ref: #19717

Closes #19719

2 weeks agocfilter: send uint8_t bytes
Stefan Eissing [Thu, 27 Nov 2025 14:13:11 +0000 (15:13 +0100)] 
cfilter: send uint8_t bytes

Change the send parameter from `const void *` to `const uint8_t *` and
adapt calling code. Several had already unsigned chars and were casting.

Closes #19729

2 weeks agongtcp2: remove the unused Curl_conn_is_ngtcp2 function
Daniel Stenberg [Thu, 27 Nov 2025 13:19:34 +0000 (14:19 +0100)] 
ngtcp2: remove the unused Curl_conn_is_ngtcp2 function

Closes #19725

2 weeks agocfilters: make conn_forget_socket a private libssh function
Daniel Stenberg [Thu, 27 Nov 2025 13:25:43 +0000 (14:25 +0100)] 
cfilters: make conn_forget_socket a private libssh function

It is only used for (old) libssh builds.

Closes #19727

2 weeks agoGHA/http3-linux: fix broken h3 server in non-openssl jobs, for more pytests
Viktor Szakats [Thu, 27 Nov 2025 12:44:27 +0000 (13:44 +0100)] 
GHA/http3-linux: fix broken h3 server in non-openssl jobs, for more pytests

It also revealed 3 failing earlydata tests with two backends on Linux,
seen earlier on macOS:
```
LibreSSL     before: 571 passed, 141 skipped in 45.34s
LibreSSL      after: 736 passed,  95 skipped in 68.08s

aws-lc       before: 571 passed, 141 skipped in 78.87s
aws-lc        after: 736 passed,  95 skipped in 66.71s

BoringSSL    before: 511 passed, 201 skipped in 46.47s
BoringSSL     after: 676 passed, 155 skipped in 63.96s

GnuTLS       before: 515 passed, 197 skipped in 48.31s
GnuTLS        after: 688 passed, 140 skipped in 67.79s (3 failed)

wolfSSL      before: 541 passed, 171 skipped in 52.49s
wolfSSL       after: 714 passed, 114 skipped in 83.84s (3 failed)

OpenSSL      before: 757 passed,  74 skipped in 65.43s
OpenSSL       after: 757 passed,  74 skipped in 65.06s

OpenSSL-quic before: 741 passed,  90 skipped in 62.85s
OpenSSL-quic  after: 741 passed,  90 skipped in 57.20s

quiche       before: 511 passed, 201 skipped in 45.94s
quiche        after: 664 passed, 167 skipped in 59.57s
```
Before: https://github.com/curl/curl/actions/runs/19734972379
After: https://github.com/curl/curl/actions/runs/19736703398?pr=19723

Failures address via: 0081c5b12627ddfb5d6e71198475dc9f95c0a53e #19730

Ref: #19724

Closes #19723

2 weeks agopytest: disable two H3 earlydata tests for all platforms (was: macOS)
Viktor Szakats [Thu, 27 Nov 2025 14:37:19 +0000 (15:37 +0100)] 
pytest: disable two H3 earlydata tests for all platforms (was: macOS)

Follow-up to 692c7f133e6f9a5053a87b1fffbf3c41697a7742 #19252
Follow-up to eefd03c572996e5de4dec4fe295ad6f103e0eefc #18703

Ref: #19719
Ref: #19723

Fixes #19724
Closes #19730

2 weeks agobadwords: make some words match case-insensitively
Viktor Szakats [Fri, 21 Nov 2025 12:46:53 +0000 (13:46 +0100)] 
badwords: make some words match case-insensitively

Also:
- wcurl.md: sync with upstream to pass the badwords check.

Ref: https://github.com/curl/wcurl/commit/11f840cddd840e03b4281cb7408b246c0d09da0f
Ref: https://github.com/curl/wcurl/pull/79

Closes #19713

2 weeks agoruntests: fix showing `nghttpx-h3` in the `Env:` log when detected
Viktor Szakats [Thu, 27 Nov 2025 12:02:49 +0000 (13:02 +0100)] 
runtests: fix showing `nghttpx-h3` in the `Env:` log when detected

Ref: #19723
Closes #19728

2 weeks agoGHA: add timeouts to mitigate hung brew install step
Viktor Szakats [Thu, 27 Nov 2025 13:19:48 +0000 (14:19 +0100)] 
GHA: add timeouts to mitigate hung brew install step

Ref: https://github.com/curl/curl/actions/runs/19736703410/job/56550251534?pr=19723

Closes #19726

2 weeks agocurlx_base64_encode: use uint8_t* for input
Stefan Eissing [Thu, 27 Nov 2025 12:18:09 +0000 (13:18 +0100)] 
curlx_base64_encode: use uint8_t* for input

Change `inputbuff` parameter from `const char *` to `const uint8_t *` to
reflect the binary nature of the input bytes. Half the code was casting
unsigned char to signed already in calling.

Closes #19722

2 weeks agows: use uint8_t
Stefan Eissing [Thu, 27 Nov 2025 11:50:04 +0000 (12:50 +0100)] 
ws: use uint8_t

Convert `unsigned char` use to `uint8_t`.

Closes #19721

2 weeks agoip_quadruple/proxy: make port uint16_t
Stefan Eissing [Wed, 26 Nov 2025 13:05:46 +0000 (14:05 +0100)] 
ip_quadruple/proxy: make port uint16_t

Make `port` member in these struct of type `uint16_t`.

add `uint8_t transport` to `struct ip_quadruple

Define TRNSPRT_NONE as 0. By assigning a valid transport only on a
successful connection, it is clear when the ip_quadruple members are
valid. Also, for transports not involving ports, the getinfos for
`CURLINFO_PRIMARY_PORT` and `CURLINFO_LOCAL_PORT` will now always return
-1.

Make all `transport` members and parameters of type `uint8_t`.

Document the return value of `CURLINFO_LOCAL_PORT` and
`CURLINFO_PRIMARY_PORT` in this regard. Add tests that writeout stats
report ports correctly.

Closes #19708

2 weeks agoconncontrol: reuse handling
Stefan Eissing [Mon, 3 Nov 2025 12:12:50 +0000 (13:12 +0100)] 
conncontrol: reuse handling

Add protocol handler flag `PROTOPT_CONN_REUSE` to indicate that the
protocol allows reusing connections for other tranfers. Add that
to all handlers that support it.

Create connections with `conn->bits.close = FALSE` and remove all
the `connkeep()` calls in protocol handlers setup/connect implementations.
`PROTOPT_CONN_REUSE` assures that the default behaviour applies
at the end of a transfer without need to juggle the close bit.

`conn->bits.close` now serves as an additional indication that a
connection cannot be reused. Only protocol handles that allow
reuse need to set it to override the default behaviour.

Remove all `connclose()` and `connkeep()` calls from connection
filters. Filters should not modify connection flags. They are
supposed to run in eyeballing situations where a filter is just
one of many determining the outcome.

Fix http response header handling to only honour `Connection: close`
for HTTP/1.x versions.

Closes #19333

2 weeks agovquic: do_sendmsg full init
Stefan Eissing [Thu, 27 Nov 2025 09:23:43 +0000 (10:23 +0100)] 
vquic: do_sendmsg full init

When passing a `msg_ctrl` to sendmsg() as part of GSO handling, zero the
complete array. This fixes any false positives by valgrind that complain
about uninitialised memory, even though the kernel only ever accesses
the first two bytes.

Reported-by: Aleksei Bavshin
Fixes #19714
Closes #19715

2 weeks agongtcp2+openssl: fix leak of session
Stefan Eissing [Thu, 27 Nov 2025 11:11:39 +0000 (12:11 +0100)] 
ngtcp2+openssl: fix leak of session

Fix return value indicating to OpenSSL if reference to session is kept
(it is not), so OpenSSL frees it.

Reported-by: Aleksei Bavshin
Fixes #19717
Closes #19718

2 weeks agotest433: verify "Note: Read config file from..."
Daniel Stenberg [Tue, 25 Nov 2025 15:14:43 +0000 (16:14 +0100)] 
test433: verify "Note: Read config file from..."

Which was added in fc09a2da4ad0595292

Closes #19699

2 weeks agodocs: add rustls to supported backends for CERT and KEY
Yedaya Katsman [Wed, 26 Nov 2025 13:58:40 +0000 (15:58 +0200)] 
docs: add rustls to supported backends for CERT and KEY

Followup to 1c8c93ae15c692c547e3238c4f067f76616a53e8

Closes #19709

2 weeks agotypes: remove curl_int64_t/curl_uint64_t
Stefan Eissing [Wed, 26 Nov 2025 11:02:02 +0000 (12:02 +0100)] 
types: remove curl_int64_t/curl_uint64_t

These types and the definitions surrounding them are no longer needed.

Closes #19706

2 weeks agoexamples/multi-uv: simplify passing `uv` struct
Viktor Szakats [Wed, 26 Nov 2025 11:56:44 +0000 (12:56 +0100)] 
examples/multi-uv: simplify passing `uv` struct

Reported-by: st751228051 on github
Follow-up to c722346518365c401b572f8dbe5fa6792ba923cd #19538 #19462
Closes #19707

2 weeks agoexamples/multi-uv: fix invalid req->data access
BANADDA [Sat, 15 Nov 2025 02:08:10 +0000 (02:08 +0000)] 
examples/multi-uv: fix invalid req->data access

The on_uv_timeout callback was trying to access req->data as
a curl_context pointer, but uv.timeout.data was never initialized,
making it always NULL. This rendered the code inside the if(context)
block unreachable.

Fixes #19462
Closes #19538

2 weeks agoautotools: add nettle library detection via pkg-config (for GnuTLS)
Viktor Szakats [Wed, 26 Nov 2025 01:03:29 +0000 (02:03 +0100)] 
autotools: add nettle library detection via pkg-config (for GnuTLS)

Also:
- fix to restore full state when gnutls canary function is not found.
- fix indentation.

Closes #19703

2 weeks agohttp: fix OOM exit in Curl_http_follow
Daniel Stenberg [Wed, 26 Nov 2025 10:01:09 +0000 (11:01 +0100)] 
http: fix OOM exit in Curl_http_follow

Spotted by "strict torture" tests.

Closes #19705

2 weeks agourlapi: handle OOM properly when setting URL
Daniel Stenberg [Wed, 26 Nov 2025 07:23:04 +0000 (08:23 +0100)] 
urlapi: handle OOM properly when setting URL

Closes #19704

2 weeks agodocs: spell it Rustls with a capital R
Daniel Stenberg [Tue, 25 Nov 2025 23:47:04 +0000 (00:47 +0100)] 
docs: spell it Rustls with a capital R

I believe this is how the project itself uses it.

Closes #19702

2 weeks agoGHA/http3-linux: build nettle manually for GnuTLS 3.8.11+
Viktor Szakats [Tue, 25 Nov 2025 01:34:26 +0000 (02:34 +0100)] 
GHA/http3-linux: build nettle manually for GnuTLS 3.8.11+

GnuTLS 3.8.11 started requiring a nettle version new enough to be
missing from Ubuntu LTS released a year ago. To keep up testing it,
build nettle from source. Besides the necessary one time effort this
has the downside that nettle updates now need to be done manually
a couple of times per year when renovate detects one. (if I got the
renovate formula correct to catch the tag format).

Also:
- switch the local GnuTLS build to use the release tarball instead of
  the Git repo and calling the script `bootstrap`. The script could
  potentially download source code using the cleartext `git:` protocol.
  It's also downloading lots of content, including a full OpenSSL repo.

Ref: https://github.com/gnutls/gnutls/blob/955f7a7fc223642d1ede6d55f094961cb97bfa68/NEWS#L41-L44
Follow-up to 905b718de3fb9287c7c0037b2737aa395f01ad3c #19642
Follow-up to a439fc0e372c3de7df3b8ae3ca7752bc3cbca826 #19613

Closes #19680

2 weeks agohostip: only store negative response for CURLE_COULDNT_RESOLVE_HOST
Daniel Stenberg [Tue, 25 Nov 2025 22:03:33 +0000 (23:03 +0100)] 
hostip: only store negative response for CURLE_COULDNT_RESOLVE_HOST

Follow-up from ce06fe77710525

This allows us to drop the 'keep_negative' variable completely.

Closes #19701

3 weeks agolib: change uint sets to operate on uint32_t
Stefan Eissing [Tue, 25 Nov 2025 10:33:38 +0000 (11:33 +0100)] 
lib: change uint sets to operate on uint32_t

- clarify names and change types
- make multi's `mid` a uint32_t
- update documentation

Closes #19695

3 weeks agoopenssl-quic: use stdint types
Stefan Eissing [Tue, 25 Nov 2025 12:39:35 +0000 (13:39 +0100)] 
openssl-quic: use stdint types

Use int64_t and uint64_t directly without needing to cast to
curl_int64_t and curl_uint64_t.

Closes #19698

3 weeks agoquiche: use stdint types
Stefan Eissing [Tue, 25 Nov 2025 12:21:25 +0000 (13:21 +0100)] 
quiche: use stdint types

Use int64_t and uint64_t directly without needing to cast to
curl_int64_t and curl_uint64_t.

Closes #19697

3 weeks agongtcp2: use stdint types
Stefan Eissing [Tue, 25 Nov 2025 12:03:04 +0000 (13:03 +0100)] 
ngtcp2: use stdint types

Use int64_t and uint64_t directly without needing to cast to
curl_int64_t and curl_uint64_t.

Closes #19696

3 weeks agobufq: use uint8_t
Stefan Eissing [Tue, 25 Nov 2025 09:24:14 +0000 (10:24 +0100)] 
bufq: use uint8_t

instead of unsigned char

Closes #19690

3 weeks agomulti: simplify admin handle processing
Stefan Eissing [Wed, 19 Nov 2025 10:54:36 +0000 (11:54 +0100)] 
multi: simplify admin handle processing

Fold the special connection pool shutdown handling in multi the things
the admin handle cares about. Add the admin handle to the 'process'
bitset, deduce it from the 'running' count.

The admin handle is the processed like any other transfer, but has a
special case in `multi_runsingle()`. Simplifies all other multi
processing parts.

Closes #19604

3 weeks agolib: timer stats improvements
Stefan Eissing [Tue, 25 Nov 2025 09:00:23 +0000 (10:00 +0100)] 
lib: timer stats improvements

* move the TIMER_POSTQUEUE to the time a connection is chosen,
  so that TIMER_NAMELOOKUP always happens afterwards
* client writer: do not trigger TIMER_STARTTRANSFER on CLIENTWRITE_INFO
  as ftp and other pingpong protocols write that before starting anything
  that is the tranfer itself
* Elimnating debug trancing of "closed stream/connection - bailing"
  as confusing, as connection is not really closed on most cases.
* Setting 'data->req.upload_done` correctly, so that no "abort upload"
  is happening at the end of a perfectly fine download.
* Adding test cases with up-/download of 0-length files.
* pytest: add a "timeline" of timer value checks to Resulst in curl.py,
  so that this can be used in several test cases, replacing the local
  stuff in test_16
* add timeline checks to ftp test cases

Closes #19269

3 weeks agotool: log when loading .curlrc in verbose mode
Yedaya Katsman [Sun, 23 Nov 2025 19:29:46 +0000 (21:29 +0200)] 
tool: log when loading .curlrc in verbose mode

Inspired by @vszakats in
https://github.com/curl/curl/pull/19631#issuecomment-3560803674

Closes #19663

3 weeks agoratelimit: remove a debug mprintf
Stefan Eissing [Tue, 25 Nov 2025 10:39:04 +0000 (11:39 +0100)] 
ratelimit: remove a debug mprintf

Follow-up to 24b36fdd1585ea22e5e

Closes #19694

3 weeks agoINTERNALS.md: add more dependency versions and dates
Viktor Szakats [Tue, 25 Nov 2025 09:42:07 +0000 (10:42 +0100)] 
INTERNALS.md: add more dependency versions and dates

Closes #19691

3 weeks agocurlx: replace `sprintf` with `snprintf`
Viktor Szakats [Tue, 25 Nov 2025 02:35:40 +0000 (03:35 +0100)] 
curlx: replace `sprintf` with `snprintf`

To avoid using a deprecated function on Windows.

Also: de-dupe `SNPRINTF` definition in curlx.

Closes #19681

3 weeks agoslist: constify Curl_slist_append_nodup() string argument
Patrick Monnerat [Mon, 24 Nov 2025 13:57:38 +0000 (14:57 +0100)] 
slist: constify Curl_slist_append_nodup() string argument

Although finally stored as a non-const pointer, the string is intended
to be left unchanged.

This change allows using the function without the need of a cast for
const pointers.

Closes #19692

3 weeks agodoc: some returned in-memory data may not be altered
Patrick Monnerat [Mon, 24 Nov 2025 18:50:26 +0000 (19:50 +0100)] 
doc: some returned in-memory data may not be altered

Some public prototypes do not declare return values or out parameters as
const where they should be. Avoid changing the public interface, but
document those values as read-only.

Closes #19692

3 weeks agospeedlimit: also reset on send unpausing
Stefan Eissing [Tue, 25 Nov 2025 08:30:34 +0000 (09:30 +0100)] 
speedlimit: also reset on send unpausing

The low speedlimit currently counts both up- and download speed
accumulated. So, when unpausing upload, also reset the counter.

Closes #19687

3 weeks agotool_doswin: clear pointer when thread takes ownership
Daniel Stenberg [Tue, 25 Nov 2025 09:14:28 +0000 (10:14 +0100)] 
tool_doswin: clear pointer when thread takes ownership

Attempt to address #19675
Closes #19689

3 weeks agoasyn-ares: handle Curl_dnscache_mk_entry() OOM error
Daniel Stenberg [Tue, 25 Nov 2025 09:07:30 +0000 (10:07 +0100)] 
asyn-ares: handle Curl_dnscache_mk_entry() OOM error

To avoid leaking memory.

Follow-up to ce06fe7771052549ff430
Closes #19688

3 weeks agoprogress: remove two redundant variable checks
Daniel Stenberg [Tue, 25 Nov 2025 08:09:50 +0000 (09:09 +0100)] 
progress: remove two redundant variable checks

The entry condition in the function already exits early if either
low_speed_time or low_speed_limit is not set.

Pointed out by CodeSonar

Closes #19686

3 weeks agosendf: fix uninitialized variable in trace output
Daniel Stenberg [Tue, 25 Nov 2025 07:53:59 +0000 (08:53 +0100)] 
sendf: fix uninitialized variable in trace output

Initialize *nread early on.

Pointed out by CodeSonar

Closes #19684

3 weeks agohostip: make more functions return CURLcode
Daniel Stenberg [Mon, 24 Nov 2025 13:00:09 +0000 (14:00 +0100)] 
hostip: make more functions return CURLcode

- Curl_async_getaddrinfo() always returned NULL so it was pointless.
  Return proper curlcode instead to distinguish between errors. Same for
  Curl_doh().
- simplify the IP address handling
- make Curl_str2addr() function return CURLcode

Closes #19669

3 weeks agoexamples: fix minor typo
Sunny [Tue, 25 Nov 2025 07:29:32 +0000 (08:29 +0100)] 
examples: fix minor typo

Closes #19683

3 weeks agocurlx/fopen: replace open CRT functions their with `_s` counterparts (Windows)
Viktor Szakats [Tue, 18 Nov 2025 00:32:43 +0000 (01:32 +0100)] 
curlx/fopen: replace open CRT functions their with `_s` counterparts (Windows)

- `_wopen`        -> `_wsopen_s`
- `_open`, `open` -> `_sopen_s`
- `_wfopen`       -> `_wfopen_s`
- `fopen`         -> `fopen_s`
- `_wfreopen`     -> `_wfreopen_s`
- `freopen`       -> `freopen_s`

For better error handling and for using the CRT functions recommended
via warnings suppressed by `_CRT_SECURE_NO_WARNINGS`.

Also:
- add missing `freopen_s()` prototype when building with mingw-w64 <5.
  https://sourceforge.net/p/mingw-w64/mingw-w64/ci/a5d824654cdc57f6eac1bb581b078986f3eb6856/
- tests/server: replace `open()` in the signal handler with `_sopen_s()`
  on Windows.
- tests/server: reduce scope of a checksrc exception to a single line.
- checksrc: ban replaced functions.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/open-wopen
https://learn.microsoft.com/cpp/c-runtime-library/reference/sopen-s-wsopen-s
https://learn.microsoft.com/cpp/c-runtime-library/reference/freopen-wfreopen
https://learn.microsoft.com/cpp/c-runtime-library/reference/fopen-wfopen
https://learn.microsoft.com/cpp/c-runtime-library/reference/fopen-s-wfopen-s
https://learn.microsoft.com/cpp/c-runtime-library/reference/freopen-s-wfreopen-s

Closes #19643

3 weeks agotests/server: use curlx file open/close functions
Viktor Szakats [Mon, 24 Nov 2025 14:55:17 +0000 (15:55 +0100)] 
tests/server: use curlx file open/close functions

Replace:
- `open()` with `curlx_open()` (1 call).
- `fopen()` with `curlx_fopen()`.
- `fclose()` with `curlx_fclose()`.

To centralize interacting with the CRT in preparation for using "safe"
alternatives on Windows. This also adds long-filename and Unicode
support for these operations on Windows.

Keep using `open()` in the signal handler to avoid any issues with
calling code not allowed in signal handlers.

Cherry-picked from #19643
Closes #19679

3 weeks agoINTERNALS.md: add release dates to build dependencies
Viktor Szakats [Mon, 24 Nov 2025 22:55:57 +0000 (23:55 +0100)] 
INTERNALS.md: add release dates to build dependencies

Also:
- delete `roffit`, that's not used anymore.
  Follow-up to ea0b575dab86a3c44dd1d547dc500276266aa382 #12753

Follow-up to 92d9dbe4c008646dd467d23dea963fa32e16cf85 #19611

Closes #19677

3 weeks agolib: rename internal header `share.h` to `curl_share.h` to avoid collision
Viktor Szakats [Fri, 21 Nov 2025 19:36:26 +0000 (20:36 +0100)] 
lib: rename internal header `share.h` to `curl_share.h` to avoid collision

Windows CRTs have a `share.h`. Before this patch when trying to
`#include <share.h>` it, the compiler picked up curl's internal
`lib/share.h` instead. Rename it to avoid this issue.

CRT `share.h` has constants necessary for using safe open CRT functions.

Also rename `lib/share.c` to keep matching the header.

Ref: https://learn.microsoft.com/cpp/c-runtime-library/sharing-constants
Ref: 625f2c1644da58b9617479775badea21f125ce6d #16949 #16991
Cherry-picked from #19643
Closes #19676

3 weeks agomanage: expand the 'libcurl support required' message
Daniel Stenberg [Mon, 24 Nov 2025 11:46:01 +0000 (12:46 +0100)] 
manage: expand the 'libcurl support required' message

Example of old text:

 --dns-ipv4-addr requires that libcurl is built to support c-ares.

New version:

 For --dns-ipv4-addr to work, it requires that the underlying libcurl is
 built to support c-ares.

Closes #19665

3 weeks agoratelimit: redesign
Stefan Eissing [Tue, 11 Nov 2025 13:26:48 +0000 (14:26 +0100)] 
ratelimit: redesign

Description of how this works in `docs/internal/RATELIMITS.ms`.

Notable implementation changes:
- KEEP_SEND_PAUSE/KEEP_SEND_HOLD and KEEP_RECV_PAUSE/KEEP_RECV_HOLD
  no longer exist. Pausing is down via blocked the new rlimits.
- KEEP_SEND_TIMED no longer exists. Pausing "100-continue" transfers
  is done in the new `Curl_http_perform_pollset()` method.
- HTTP/2 rate limiting implemented via window updates. When
  transfer initiaiting connection has a ratelimit, adjust the
  initial window size
- HTTP/3 ngtcp2 rate limitin implemnented via ack updates
- HTTP/3 quiche does not seem to support this via its API
- the default progress-meter has been improved for accuracy
  in "current speed" results.

pytest speed tests have been improved.

Closes #19384

3 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 24 Nov 2025 22:32:59 +0000 (23:32 +0100)] 
RELEASE-NOTES: synced

3 weeks agoINTERNALS.md: add brotli and zstd version info
Daniel Stenberg [Mon, 24 Nov 2025 17:45:53 +0000 (18:45 +0100)] 
INTERNALS.md: add brotli and zstd version info

And alpha-sort the dependency list

Closes #19672

3 weeks agocontent_encoding: drop a guard for brotli 1.0.0+ macro
Viktor Szakats [Mon, 24 Nov 2025 18:38:34 +0000 (19:38 +0100)] 
content_encoding: drop a guard for brotli 1.0.0+ macro

Also add comment with version requirement for the other guard.

Refs:
https://github.com/google/brotli/commit/19d86fb9a60aa7034d4981b69a5b656f5b90017e
https://github.com/google/brotli/commit/03739d2b113afe60638069c4e1604dc2ac27380d

Ref: #19672
Follow-up to e639d4ca4d794c222dde4680d9ff35053f501042
Closes #19673

3 weeks agotftpd: fix/tidy up `open()` mode flags
Viktor Szakats [Mon, 24 Nov 2025 13:51:18 +0000 (14:51 +0100)] 
tftpd: fix/tidy up `open()` mode flags

- replace 0777 with `S_I*` macros.
- fix to not pass invalid flags on Windows.

Follow-up to 537987d8c66aac6ec96cde098ab45525e156b54e #19645

Closes #19671

3 weeks agovquic: do not pass invalid mode flags to `open()` (Windows)
Viktor Szakats [Mon, 24 Nov 2025 13:43:49 +0000 (14:43 +0100)] 
vquic: do not pass invalid mode flags to `open()` (Windows)

Follow-up to 82013066a6149aa906b1fda3f8f1f27bd272a6c2 #19647

Closes #19670

3 weeks agoGHA: update dependency ngtcp2/nghttp3 to v1.13.1
renovate[bot] [Mon, 24 Nov 2025 10:43:14 +0000 (10:43 +0000)] 
GHA: update dependency ngtcp2/nghttp3 to v1.13.1

Closes #19664

3 weeks agocurlx/strerr: use `strerror_s()` on Windows
Viktor Szakats [Fri, 21 Nov 2025 14:55:33 +0000 (15:55 +0100)] 
curlx/strerr: use `strerror_s()` on Windows

To replace deprecated, unsafe `sys_nerr`, `sys_errlist` global
variables with the function suggested by the CRT warning silenced via
`_CRT_SECURE_NO_WARNINGS`:
```
lib/curlx/strerr.c(291): warning C4996: '__sys_nerr': This function or variable may be unsafe. Consider using strerror instead.
lib/curlx/strerr.c(292): warning C4996: '__sys_errlist': This function or variable may be unsafe. Consider using strerror instead.
```
(where `strerror` in turn suggests `strerror_s`...)

Upside: returns an error and has a Unicode variant. Downaside: happy
to return success when passing unrecognized error codes. Work it around
by looking for the string "Unknown error" returned in such cases and
falling back to other methods to retrieve a description.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/errno-doserrno-sys-errlist-and-sys-nerr
https://learn.microsoft.com/cpp/c-runtime-library/reference/strerror-s-strerror-s-wcserror-s-wcserror-s

Closes #19646

3 weeks agofile: do not pass invalid mode flags to `open()` on upload (Windows)
Viktor Szakats [Sat, 22 Nov 2025 00:42:15 +0000 (01:42 +0100)] 
file: do not pass invalid mode flags to `open()` on upload (Windows)

Ref: https://learn.microsoft.com/cpp/c-runtime-library/reference/open-wopen

Ref: #19645
Cherry-picked from #19643
Closes #19647

3 weeks agocurl_fopen: do not pass invalid mode flags to `open()` on Windows
Viktor Szakats [Sat, 22 Nov 2025 00:20:44 +0000 (01:20 +0100)] 
curl_fopen: do not pass invalid mode flags to `open()` on Windows

The safe (`_s`) variants of the Windows `open()` reject these flags,
while the classic ones silently accepted them.

Also:
- also drop the now unused `stat()` call on Windows.
- replace magic number with their equivalent Windows and Unix-specific
  `S_*` macros.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/open-wopen
https://learn.microsoft.com/cpp/c-runtime-library/reference/fstat-fstat32-fstat64-fstati64-fstat32i64-fstat64i32

Cherry-picked from #19643
Closes #19645

3 weeks agocmake: add support for libbacktrace, fix two build issues
Viktor Szakats [Mon, 24 Nov 2025 11:49:15 +0000 (12:49 +0100)] 
cmake: add support for libbacktrace, fix two build issues

Also:
- memdebug: fix symbol collision in unity builds.
- memdebug: fix compiler warning by making a variable static.

Follow-up to c77bed81a2e1325ffdebc223c27e3d1355147529 #19657

Closes #19666

3 weeks agotool_writeout: bail out proper on OOM
Daniel Stenberg [Mon, 24 Nov 2025 12:08:37 +0000 (13:08 +0100)] 
tool_writeout: bail out proper on OOM

Closes #19667

3 weeks agomemdebug: produce stack trace dump with libbacktrace
Daniel Stenberg [Tue, 18 Nov 2025 13:29:09 +0000 (14:29 +0100)] 
memdebug: produce stack trace dump with libbacktrace

Enable with "configure --enable-backtrace", inserts a backtrace in the
memdump log when a torture test limit is reached.

Closes #19657

3 weeks agospeedcheck: do not trigger low speed cancel on transfers with CURL_READFUNC_PAUSE
bttrfl on github [Sun, 23 Nov 2025 03:55:16 +0000 (06:55 +0300)] 
speedcheck: do not trigger low speed cancel on transfers with CURL_READFUNC_PAUSE

When a trasfer is paused from a read callback with a CURL_READFUNC_PAUSE
code, it should be excluded from the speedcheck. Currently only
transfers paused from write callbacks are excluded, because the code
only checks for "recv direction" of the transfer. This commit adds a
check for "send direction".

Issue similar to https://github.com/curl/curl/issues/6358

Closes #19653

3 weeks agoGHA: update ngtcp2/nghttp3 to v1.13.0 from v1.12.0
renovate[bot] [Sun, 23 Nov 2025 18:23:32 +0000 (18:23 +0000)] 
GHA: update ngtcp2/nghttp3 to v1.13.0 from v1.12.0

Closes #19654

3 weeks agoGHA: update ngtcp2/ngtcp2 to v1.18.0 from v1.17.0
renovate[bot] [Sun, 23 Nov 2025 09:37:41 +0000 (09:37 +0000)] 
GHA: update ngtcp2/ngtcp2 to v1.18.0 from v1.17.0

Closes #19655

3 weeks agowolfssl: fix cipher list, skip 5.8.4 regression
Stefan Eissing [Sun, 23 Nov 2025 15:59:40 +0000 (16:59 +0100)] 
wolfssl: fix cipher list, skip 5.8.4 regression

- adjust cipher list in infof() statement for min/max TLS version

- skip test_17_07 for wolfSSL 5.8.4 when CHACHA20 is negotiated
  due to regression with homebrew build on ARM systems.

Fixes #19644
Reported-by: Viktor Szakats
Closes #19662

3 weeks agoasyn-ares: remove hostname free on OOM
Daniel Stenberg [Sun, 23 Nov 2025 13:42:59 +0000 (14:42 +0100)] 
asyn-ares: remove hostname free on OOM

The freeing of the already allocated hostname is done by
Curl_async_shutdown(). This extra free in the RR code path made a
double-free.

Presumably not detected because the CI torture tests don't run HTTPS-RR
enabled?

Follow-up to 8d0bfe74fb
Closes #19658

3 weeks agotool_msgs: make voutf() use stack instead of heap
Daniel Stenberg [Sat, 22 Nov 2025 21:44:39 +0000 (22:44 +0100)] 
tool_msgs: make voutf() use stack instead of heap

For printf()ing the message to show.

Closes #19651

3 weeks agotool_operate: fix a case of ignoring return code in operate()
Daniel Stenberg [Sat, 22 Nov 2025 18:09:42 +0000 (19:09 +0100)] 
tool_operate: fix a case of ignoring return code in operate()

If get_args() returns error, do not overwrite the variable in the next
call.

Also, avoid allocating memory for the default user-agent.

Closes #19650

3 weeks agotool_operate: fix case of ignoring return code in single_transfer
Daniel Stenberg [Sat, 22 Nov 2025 17:03:40 +0000 (18:03 +0100)] 
tool_operate: fix case of ignoring return code in single_transfer

When glob_url() returns error, stop.

Closes #19649

3 weeks agoKNOWN_RISKS: known risks when running and using curl and libcurl
Daniel Stenberg [Thu, 20 Nov 2025 22:57:04 +0000 (23:57 +0100)] 
KNOWN_RISKS: known risks when running and using curl and libcurl

Closes #19631

3 weeks agoRevert "GHA: update gnutls/gnutls to 3.8.11 from 3.8.10"
Daniel Stenberg [Fri, 21 Nov 2025 15:53:51 +0000 (16:53 +0100)] 
Revert "GHA: update gnutls/gnutls to 3.8.11 from 3.8.10"

This reverts commit a439fc0e372c3de7df3b8ae3ca7752bc3cbca826.

It requires a version of libnettle that is not included in these Ubuntu
versions: "Libnettle 3.10 was not found"

Closes #19642

3 weeks agocurlx: replace `mbstowcs`/`wcstombs` with `_s` counterparts (Windows)
Viktor Szakats [Tue, 18 Nov 2025 00:48:04 +0000 (01:48 +0100)] 
curlx: replace `mbstowcs`/`wcstombs` with `_s` counterparts (Windows)

They are used in Windows-specific `fopen()`, `freopen`, `open()` and
`curlx_get_winapi_error()` calls, and in `fix_excessive_path()` in
Unicode builds.

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/mbstowcs-mbstowcs-l
https://learn.microsoft.com/cpp/c-runtime-library/reference/mbstowcs-s-mbstowcs-s-l
https://learn.microsoft.com/cpp/c-runtime-library/reference/wcstombs-wcstombs-l
https://learn.microsoft.com/cpp/c-runtime-library/reference/wcstombs-s-wcstombs-s-l

Also ban these functions via checksrc.

Co-authored-by: Jay Satiro
Closes #19581

3 weeks agochecksrc: ban `_tcsncpy`, `wcscpy`, `wcsncpy`
Viktor Szakats [Fri, 21 Nov 2025 14:57:17 +0000 (15:57 +0100)] 
checksrc: ban `_tcsncpy`, `wcscpy`, `wcsncpy`

Follow-up to eaa7651374898cef89e5783b0219bdffcc0eb60e #19589

Closes #19641

3 weeks agoGHA: update gnutls/gnutls to 3.8.11 from 3.8.10
renovate[bot] [Thu, 20 Nov 2025 05:59:59 +0000 (05:59 +0000)] 
GHA: update gnutls/gnutls to 3.8.11 from 3.8.10

Closes #19613

3 weeks agomulti: make max_total_* members size_t
Stefan Eissing [Thu, 20 Nov 2025 09:58:54 +0000 (10:58 +0100)] 
multi: make max_total_* members size_t

Check size_t conversion on setting these members via CURLMIPT_*. Use
members without casting.

Closes #19618

3 weeks agosmb: fix a size check to be overflow safe
Daniel Stenberg [Fri, 21 Nov 2025 13:34:31 +0000 (14:34 +0100)] 
smb: fix a size check to be overflow safe

In smb_send_message, although it could never actually overflow it might
as well be done correctly. Also do the check earlier.

Closes #19640

3 weeks agoapple-sectrust: always ask when `native_ca_store` is in use
Stefan Eissing [Fri, 21 Nov 2025 12:06:00 +0000 (13:06 +0100)] 
apple-sectrust: always ask when `native_ca_store` is in use

When OpenSSL fails to verify the peer certificate, we checked for
one specific reason code and did not ask Apple SecTrust for any
other failure.

Always ask Apple SecTrust after OpenSSL fails when the `native_ca_store`
is enabled. If the user configures a CAfile or CApath, the native store
is disabled, so this does not affect use cases where users asks curl
to use a specific set of trust anchors.

Do the same for GnuTLS

Fixes #19636
Reported-by: ffath-vo on github
Closes #19638

3 weeks agobuild: add build-level `CURL_DISABLE_TYPECHECK` options
Viktor Szakats [Fri, 21 Nov 2025 11:43:54 +0000 (12:43 +0100)] 
build: add build-level `CURL_DISABLE_TYPECHECK` options

Usage:
- autotools: `--disable-typecheck` (or `--enable-typecheck` (default))
- cmake: `-DCURL_DISABLE_TYPECHECK=ON`.

To disable `curl_easy_setopt()`/`curl_easy_getinfo()` type checking with
supported (new) gcc and clang compilers. It is useful to improve build
performance for the `tests/libtest` target. In particular the CodeQL
analyzer may take above an hour to compile with type checking enabled,
and disabling it brings it down to seconds. On local machines it may
also cut build times in half when build testdeps, depending on platform
and compiler.

Other than these cases, we recommend leaving type checking enabled.

Ref: fdacf34aaeac79ad14fa48dcafae24a6de68823d #19632

Also:
- GHA/codeql: use it.
- test1165: check in `include/curl`.
- lib1912: delete stray todo comment.
- spelling and comment nits.

Closes #19637

3 weeks agolib: replace `_tcsncpy`/`wcsncpy`/`wcscpy` with `_s` counterparts (Windows)
Viktor Szakats [Mon, 17 Nov 2025 22:49:15 +0000 (23:49 +0100)] 
lib: replace `_tcsncpy`/`wcsncpy`/`wcscpy` with `_s` counterparts (Windows)

Replace:
- curl_sspi: macro `_tcsncpy()` with `_tcsncpy_s()`.
- curlx/fopen: `wcsncpy()` with `wcsncpy_s()`.
- curlx/fopen: `wcscpy()` with `wcscpy_s()`.

Use of the pre-existing functions were safe. This patch aims to use the
recommended Windows CRT functions. Handle errors returned by them. Also
to avoid the compiler warnings silenced via `_CRT_SECURE_NO_WARNINGS`:

```
lib/curl_sspi.c(152): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
lib/curlx/fopen.c(161): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
lib/curlx/fopen.c(162): warning C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
lib/curlx/fopen.c(174): warning C4996: 'wcsncpy': This function or variable may be unsafe. Consider using wcsncpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
lib/curlx/fopen.c(175): warning C4996: 'wcscpy': This function or variable may be unsafe. Consider using wcscpy_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS.
```

Refs:
https://learn.microsoft.com/cpp/c-runtime-library/reference/strncpy-strncpy-l-wcsncpy-wcsncpy-l-mbsncpy-mbsncpy-l
https://learn.microsoft.com/cpp/c-runtime-library/reference/strncpy-s-strncpy-s-l-wcsncpy-s-wcsncpy-s-l-mbsncpy-s-mbsncpy-s-l
https://learn.microsoft.com/cpp/c-runtime-library/security-features-in-the-crt

Cherry-picked from #19581 (in part)
Closes #19589

3 weeks agolib: cleanup some whitespace nits
x2018 [Wed, 19 Nov 2025 15:25:57 +0000 (23:25 +0800)] 
lib: cleanup some whitespace nits

Closes #19588

3 weeks agoopenssl: no verify failf message unless strict
Stefan Eissing [Thu, 20 Nov 2025 12:17:03 +0000 (13:17 +0100)] 
openssl: no verify failf message unless strict

If verifypeer and verifyhost are disabled, to not generate
a failf() message for failed verifications.

Fixes #19615
Reported-by: ncaklovic on github
Closes #19625

3 weeks agoGHA: disable TLS in the linux-old build
Daniel Stenberg [Fri, 21 Nov 2025 08:19:21 +0000 (09:19 +0100)] 
GHA: disable TLS in the linux-old build

There are no supported TLS libraries left in "stretch".

3 weeks agogtls: drop support for GnuTLS < 3.6.5
Daniel Stenberg [Wed, 19 Nov 2025 14:05:17 +0000 (15:05 +0100)] 
gtls: drop support for GnuTLS < 3.6.5

Release date 2018-12-01. Has TLS 1.3 support.

Closes #19609

3 weeks agognutls: implement CURLOPT_CAINFO_BLOB
Marc Aldorasi [Wed, 19 Nov 2025 16:12:31 +0000 (11:12 -0500)] 
gnutls: implement CURLOPT_CAINFO_BLOB

This adds support for in-memory CA certs using CURLOPT_CAINFO_BLOB to
the GnuTLS backend.

Closes #19612