]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
4 weeks agoasyn-ares: use the duped hostname pointer for all calls
Daniel Stenberg [Thu, 9 Oct 2025 15:23:56 +0000 (17:23 +0200)] 
asyn-ares: use the duped hostname pointer for all calls

In one c-ares call the passed in pointer was used and not the new
duplicated one. This is probably fine but might as well use the new
pointer as all the other calls do, which will survive longer.

Reported-by: Joshua Rogers
Closes #18980

4 weeks agoCurl_resolv: fix comment. 'entry' argument is not optional
Daniel Stenberg [Thu, 9 Oct 2025 15:17:31 +0000 (17:17 +0200)] 
Curl_resolv: fix comment. 'entry' argument is not optional

Reported-by: Joshua Rogers
Closes #18979

4 weeks agokrb5_gssapi: fix memory leak on error path
Daniel Stenberg [Thu, 9 Oct 2025 14:51:55 +0000 (16:51 +0200)] 
krb5_gssapi: fix memory leak on error path

If a non-compliant amount of bytes is received, the function would
return error without free.

Reported-by: Joshua Rogers
Closes #18976

4 weeks agovauth/digest: improve the digest parser
Daniel Stenberg [Thu, 9 Oct 2025 14:35:39 +0000 (16:35 +0200)] 
vauth/digest: improve the digest parser

Previously, if for example the nonce would end with "realm=" etc it
would get the wrong piece, due to the naive parser.

Reported-by: Joshua Rogers
Closes #18975

4 weeks agoschannel_verify: fix mem-leak in Curl_verify_host
Daniel Stenberg [Thu, 9 Oct 2025 11:18:05 +0000 (13:18 +0200)] 
schannel_verify: fix mem-leak in Curl_verify_host

Reported-by: Stanislav Fort
Closes #18972

4 weeks agoexamples: add an example for logging failed transfers
Jay Satiro [Sat, 20 Sep 2025 02:12:05 +0000 (22:12 -0400)] 
examples: add an example for logging failed transfers

- Add an example that demonstrates per-transfer verbose logging to
  memory.

The transfer's log is written to disk only if the transfer fails.

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

4 weeks agotool_operate: keep failed partial download for retry auto-resume
Jay Satiro [Fri, 18 Oct 2024 18:12:31 +0000 (14:12 -0400)] 
tool_operate: keep failed partial download for retry auto-resume

- Keep data from a failed download instead of discarding it on retry in
  some limited cases when we know it's ok (currently only HTTP 200/206).

Prior to this change on failed transfer the tool truncated any outfile
data written before retrying the transfer. This change adds an exception
for HTTP downloads when the user requested auto-resume, because in that
case we can keep the outfile data and resume from the new position.

Reported-by: tkzv@users.noreply.github.com
Fixes https://github.com/curl/curl/issues/18035
Closes https://github.com/curl/curl/pull/18665

4 weeks agoopenssl: add comments regarding OCSP verification
Stefan Eissing [Thu, 9 Oct 2025 08:26:30 +0000 (10:26 +0200)] 
openssl: add comments regarding OCSP verification

To allow future reviewers of "security" reports to more easily find out
why code is this way.

Closes #18962

4 weeks agomemdup0: handle edge case
Stefan Eissing [Thu, 9 Oct 2025 09:42:43 +0000 (11:42 +0200)] 
memdup0: handle edge case

When length is already SIZE_MAX, fail without allocating.

Reported-by: Joshua Rogers
Closes #18966

4 weeks agorustls: pass the correct result to rustls_failf
Stefan Eissing [Thu, 9 Oct 2025 07:55:38 +0000 (09:55 +0200)] 
rustls: pass the correct result to rustls_failf

Reported-by: Joshua Rogers
Closes #18961

4 weeks agoGHA: rename config files to match pyspelling
Viktor Szakats [Thu, 9 Oct 2025 11:48:06 +0000 (13:48 +0200)] 
GHA: rename config files to match pyspelling

To make it more obvious what needs to be looked at when pyspelling is
reporting an issue.

Follow-up to 95e50ad69473d8229b85478a3f2138b7e632fbe8 #18756
Closes #18974

4 weeks agoexamples: update `.gitignore`
Viktor Szakats [Thu, 9 Oct 2025 10:54:17 +0000 (12:54 +0200)] 
examples: update `.gitignore`

Follow-up to f6f62933e917b8b5c9a9394907ce4b69600214b4 #18264
Closes #18971

4 weeks agoexamples: allow `vsnprintf` again
Viktor Szakats [Thu, 9 Oct 2025 10:51:08 +0000 (12:51 +0200)] 
examples: allow `vsnprintf` again

Ref: https://github.com/curl/curl/pull/18668#issuecomment-3383422410
Follow-up to b12da22db1f11da51082977dc21a7edee7858911 #18866
Closes #18970

4 weeks agoexamples/sessioninfo: do not disable security
Viktor Szakats [Thu, 9 Oct 2025 10:36:43 +0000 (12:36 +0200)] 
examples/sessioninfo: do not disable security

Also make it return the curl result code.

Follow-up to df70a68984308952dcacf33d11593cb22ad80464 #18909
Closes #18969

4 weeks agohostip: don't store negative resolves due unrelated errors
Daniel Stenberg [Thu, 9 Oct 2025 07:07:27 +0000 (09:07 +0200)] 
hostip: don't store negative resolves due unrelated errors

Like for:

- OOM
- resolver_start() returns error
- DoH has problems

Fixes #18953
Fixes #18954
Reported-by: Joshua Rogers
Closes #18958

4 weeks agomk-lib1521: verify the setopt options that accept -1
Daniel Stenberg [Thu, 9 Oct 2025 08:15:41 +0000 (10:15 +0200)] 
mk-lib1521: verify the setopt options that accept -1

4 weeks agosetopt: allow CURLOPT_DNS_CACHE_TIMEOUT set to -1
Daniel Stenberg [Thu, 9 Oct 2025 07:50:20 +0000 (09:50 +0200)] 
setopt: allow CURLOPT_DNS_CACHE_TIMEOUT set to -1

It is documented as valid. Regression from commit b059f7deaf3 shipped in
8.16.0

Reported-by: Andrei Kurushin
Fixes #18959
Closes #18960

4 weeks agotest1582: verify the TLS channel binding cert memory leak fix
Daniel Stenberg [Tue, 7 Oct 2025 07:22:05 +0000 (09:22 +0200)] 
test1582: verify the TLS channel binding cert memory leak fix

4 weeks agoopenssl: fix peer certificate leak in channel binding
Daniel Stenberg [Tue, 7 Oct 2025 05:49:00 +0000 (07:49 +0200)] 
openssl: fix peer certificate leak in channel binding

Reported-by: Stanislav Fort
Bug: https://hackerone.com/reports/3373640
Closes #18917

4 weeks agohttp2: ingress handling edge cases
Stefan Eissing [Wed, 8 Oct 2025 11:06:48 +0000 (13:06 +0200)] 
http2: ingress handling edge cases

Fix some edge cases around the `data_max_bytes` handling when
processing ingress.

Reported-by: Joshua Rogers
Closes #18933

4 weeks agohttp2: cleanup pushed newhandle on fail
Stefan Eissing [Wed, 8 Oct 2025 10:28:14 +0000 (12:28 +0200)] 
http2: cleanup pushed newhandle on fail

When nghttp2_session_set_stream_user_data() fails, clean up the
new handle.

Reported-by: Joshua Rogers
Closes #18931

4 weeks agohttp2: check push header names by length first
Stefan Eissing [Wed, 8 Oct 2025 10:22:22 +0000 (12:22 +0200)] 
http2: check push header names by length first

Reported-by: Joshua Rogers
Closes #18930

4 weeks agolibssh2/sftp: fix resume corruption by avoiding O_APPEND with rresume
Joshua Rogers [Wed, 8 Oct 2025 22:06:40 +0000 (06:06 +0800)] 
libssh2/sftp: fix resume corruption by avoiding O_APPEND with rresume

Opening the remote file with O_APPEND while attempting to resume causes
all writes to be forced to EOF on servers/implementations where O_APPEND
semantics override a prior seek(). As a result, sftp_seek64() is ignored
and the resumed data is appended, duplicating/corrupting the file.

Fix by:
- Using O_WRONLY (without O_APPEND) when resume_from > 0.
- Skipping the seek entirely if remote_append mode is requested.

Closes #18952

4 weeks agolibssh/sftp: fix resume corruption by avoiding O_APPEND with rresume
Joshua Rogers [Wed, 8 Oct 2025 22:03:08 +0000 (06:03 +0800)] 
libssh/sftp: fix resume corruption by avoiding O_APPEND with rresume

Opening the remote file with O_APPEND while attempting to resume causes
all writes to be forced to EOF on servers/implementations where O_APPEND
semantics override a prior seek(). As a result, sftp_seek64() is ignored
and the resumed data is appended, duplicating/corrupting the file.

Fix by:
- Using O_WRONLY (without O_APPEND) when resume_from > 0.
- Skipping the seek entirely if remote_append mode is requested.

Closes #18952

4 weeks agosocks: deny server basic-auth if not configured
Stefan Eissing [Wed, 8 Oct 2025 12:06:55 +0000 (14:06 +0200)] 
socks: deny server basic-auth if not configured

When the server proposes BASIC authentication and curl does
not have that configured, fail right away.

Reported-by: Joshua Rogers
Closes #18937

4 weeks agovquic: sending non-gso packets fix for EAGAIN
Stefan Eissing [Wed, 8 Oct 2025 11:44:32 +0000 (13:44 +0200)] 
vquic: sending non-gso packets fix for EAGAIN

The function returned OK on EAGAIN and not the correct code.

Reported-by: Joshua Rogers
Closes #18936

4 weeks agoquiche: handle tls fail correctly
Stefan Eissing [Wed, 8 Oct 2025 11:30:12 +0000 (13:30 +0200)] 
quiche: handle tls fail correctly

quiche receive may report a TLS failure after a verified handshake. That
needs to lead to a transfer receive error.

Reported-by: Joshua Rogers
Closes #18934

4 weeks agobuild: drop Heimdal support, update docs, replace with MIT Kerberos in CI
Viktor Szakats [Wed, 8 Oct 2025 10:03:18 +0000 (12:03 +0200)] 
build: drop Heimdal support, update docs, replace with MIT Kerberos in CI

The kerberos5 library Heimdal is one of three GSS libraries curl support.
It has a memory leak triggered by the new test in #18917 and the project
seems mostly abandoned.

Drop support and steer users to the MIT krb5 or GNU GSS libraries.

Co-authored-by: Daniel Stenberg
Ref: #18928
Closes #18928
Closes #18932

4 weeks agocmake/FindGSS: whitespace/formatting
Viktor Szakats [Wed, 8 Oct 2025 23:34:37 +0000 (01:34 +0200)] 
cmake/FindGSS: whitespace/formatting

Sync format more with the rest of the Find modules.

Cherry-picked from #18932
Closes #18957

4 weeks agoGHA/linux-old: sync terminology with other jobs [ci skip]
Viktor Szakats [Wed, 8 Oct 2025 17:07:03 +0000 (19:07 +0200)] 
GHA/linux-old: sync terminology with other jobs [ci skip]

Cherry-picked from #18932

4 weeks agocmake: minor Heimdal flavour detection fix
Viktor Szakats [Wed, 8 Oct 2025 19:40:07 +0000 (21:40 +0200)] 
cmake: minor Heimdal flavour detection fix

Do not detect Heimdal if a single `H` character appears in the vendor
string, require the full name: `Heimdal`.

Cherry-picked from #18932
Closes #18951

4 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 8 Oct 2025 21:35:37 +0000 (23:35 +0200)] 
RELEASE-NOTES: synced

4 weeks agoCURLOPT_COOKIEFILE.md: clarify when the cookies are loaded
Daniel Stenberg [Wed, 8 Oct 2025 05:58:16 +0000 (07:58 +0200)] 
CURLOPT_COOKIEFILE.md: clarify when the cookies are loaded

Closes #18924

4 weeks agohttp: make Content-Length parser more WHATWG
Daniel Stenberg [Wed, 8 Oct 2025 06:33:55 +0000 (08:33 +0200)] 
http: make Content-Length parser more WHATWG

Return error if there is something after the number other than
whitespace and newline.

Allow comma separated numbers and repeated headers as long as the new value is
the same as was set before.

Add test 767 to 771 to verify.

Reported-by: Ignat Loskutov
Fixes #18921
Closes #18925

4 weeks agoapple sectrust: check correct result on old OS versions
Stefan Eissing [Wed, 8 Oct 2025 09:56:09 +0000 (11:56 +0200)] 
apple sectrust: check correct result on old OS versions

On ancient Apple OS versions where SecTrustEvaluateWithError() is not
available, the deprected SecTrustEvaluate() is used. In that code
branch, the code checked the wong variable for the verified result.

Closes #18929

4 weeks agowolfssl: no double get_error() detail
Stefan Eissing [Wed, 8 Oct 2025 12:44:23 +0000 (14:44 +0200)] 
wolfssl: no double get_error() detail

Code was calling wolfSSL_get_error() on code that it had
already retrieved with the same function. Remove that.

Reported-by: Joshua Rogers
Closes #18940

4 weeks agocmake/FindGSS: fix `pkg-config` fallback logic for CMake <3.16
Viktor Szakats [Wed, 8 Oct 2025 16:49:51 +0000 (18:49 +0200)] 
cmake/FindGSS: fix `pkg-config` fallback logic for CMake <3.16

The documented `<prefix>_<moduleName>_VERSION` variables are empty in
all tested versions since 3.7.2 to 4.1.2. Stop using it as a fallback
for <3.16 versions, and replace with the undocumented, but working,
`FindPkgConfig` internal variable `_pkg_check_modules_pkg_name`. It
contains the module name which was found.

In practice it caused that with CMake <3.16 + `pkg-config`, curl always
detected the Heimdal flavor of GSS.

Also: Delete a fallback version detection method, which was already
marked with a question mark in comments, and used the same, always
empty, CMake variables.

Ref: https://cmake.org/cmake/help/v4.1/module/FindPkgConfig.html
Bug: https://github.com/curl/curl/pull/18932#issuecomment-3381807070

Closes #18950

4 weeks agoGHA/linux-old: dump logs on configure failure
Viktor Szakats [Wed, 8 Oct 2025 11:33:19 +0000 (13:33 +0200)] 
GHA/linux-old: dump logs on configure failure

As done in other jobs, but here tailored to old cmake.

The logs generated by ancient CMake aren't super useful though.

Cherry-picked from #18932
Closes #18948

4 weeks agoGHA: bump dependencies
dependabot[bot] [Wed, 8 Oct 2025 12:46:51 +0000 (12:46 +0000)] 
GHA: bump dependencies

- cryptography from 44.0.1 to 46.0.2 in tests/http
- ruff from 0.13.2 to 0.14.0 in .github/scripts
- reuse from 6.0.0 to 6.1.2 in .github/scripts
- github/codeql-action from 3.30.5 to 4.30.7

Closes #18941
Closes #18942
Closes #18943
Closes #18945
Closes #18947

4 weeks agoGHA/dependabot: tweak dir list to avoid a dupe, rename .txt file to avoid the bot
Viktor Szakats [Wed, 8 Oct 2025 12:50:58 +0000 (14:50 +0200)] 
GHA/dependabot: tweak dir list to avoid a dupe, rename .txt file to avoid the bot

It correctly picked all pips, but also picked
`tests/http/requirements.txt` twice and also
`.github/scripts/codespell-ignore.txt`. Try avoid these issues with this
patch.

Follow-up to 6a31e3137a1352aec528d768dee8d5a1c509f451 #18939

Closes #18946

4 weeks agoGHA/dependabot: find more pip deps, tweak commit prefix
Viktor Szakats [Wed, 8 Oct 2025 12:36:22 +0000 (14:36 +0200)] 
GHA/dependabot: find more pip deps, tweak commit prefix

Before this patch the Dependabot updater was only picking up
`tests/requirements.txt`:
https://github.com/curl/curl/network/updates/26616523/jobs

Also prefix commit messages with `GHA:`.

Bug: https://github.com/curl/curl/pull/18761#issuecomment-3381147189
Follow-up to b04137c1c6ed164594279c7d04b5e051634453ea #18761

Closes #18939

4 weeks agoGHA/checksrc: also run on .md file changes
Viktor Szakats [Wed, 8 Oct 2025 11:41:50 +0000 (13:41 +0200)] 
GHA/checksrc: also run on .md file changes

To avoid missing e.g. codespell issue when updating Markdown files only,
as in 82fd9edb0e0313f206b23f90a000164b52412072 #18927

Follow-up to 0b54ce6ffc395148f2c43ce4664ecd9678f822bd

Closes #18935

4 weeks agoINSTALL-CMAKE.md: fix typo in prev
Viktor Szakats [Wed, 8 Oct 2025 11:37:29 +0000 (13:37 +0200)] 
INSTALL-CMAKE.md: fix typo in prev

Not caught in original PR. Fixing it in CI separately.

Follow-up 82fd9edb0e0313f206b23f90a000164b52412072 #18927

4 weeks agoINSTALL-CMAKE.md: document useful build targets
Viktor Szakats [Wed, 8 Oct 2025 09:15:13 +0000 (11:15 +0200)] 
INSTALL-CMAKE.md: document useful build targets

Closes #18927

4 weeks agotests/server: drop pointless memory allocation overrides
Viktor Szakats [Wed, 8 Oct 2025 01:09:23 +0000 (03:09 +0200)] 
tests/server: drop pointless memory allocation overrides

The code was overriding system memory allocation functions to a local
jump table (declared in `curl_setup.h`). And setup that jump table
to call the original system allocation functions.

Also tested fine with cegcc/WinCE. The `_strdup` fallback was possibly
required for an MSVC WinCE toolchain.

Closes #18922

4 weeks agoh3/ngtcp2: close just-opened QUIC stream when submit_request fails
Joshua Rogers [Tue, 7 Oct 2025 05:59:29 +0000 (13:59 +0800)] 
h3/ngtcp2: close just-opened QUIC stream when submit_request fails

Closes #18904

4 weeks agoh3/nghttp3: return NGHTTP3_ERR_CALLBACK_FAILURE from recv_header
Joshua Rogers [Tue, 7 Oct 2025 05:59:09 +0000 (13:59 +0800)] 
h3/nghttp3: return NGHTTP3_ERR_CALLBACK_FAILURE from recv_header

Closes #18904

4 weeks agoopenssl: skip session resumption when verifystatus is set
Joshua Rogers [Tue, 7 Oct 2025 02:31:18 +0000 (10:31 +0800)] 
openssl: skip session resumption when verifystatus is set

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

Closes #18902

4 weeks agoexamples/sessioninfo: cast printf string mask length to int
Viktor Szakats [Tue, 7 Oct 2025 18:30:06 +0000 (20:30 +0200)] 
examples/sessioninfo: cast printf string mask length to int

Found via `-Wformat-signedness`:
```
docs/examples/sessioninfo.c: In function 'wrfu':
docs/examples/sessioninfo.c:75:53: error: field precision specifier '.*' expects argument of type 'int', but argument 4 has type 'unsigned int' [-Werror=format=]
  fprintf(stderr, "Certificate #%u: %.*s", i, dn.size, dn.data);
                                      ^
```
Ref: https://github.com/curl/curl/actions/runs/18320729052/job/52172864438?pr=18343#step:13:30
Ref: https://github.com/curl/curl/actions/runs/18320729095/job/52172886899?pr=18343#step:19:27

Also:
- drop unnecessary parenthesis.
- scope variables.

Ref: #18343
Closes #18918

4 weeks agonotify: use 'notify' in public header and docs
Viktor Szakats [Tue, 7 Oct 2025 10:47:19 +0000 (12:47 +0200)] 
notify: use 'notify' in public header and docs

Closes #18915

4 weeks agocmake: support building some complicated examples, build them in CI
Viktor Szakats [Tue, 7 Oct 2025 10:36:49 +0000 (12:36 +0200)] 
cmake: support building some complicated examples, build them in CI

Build these examples when the necessary dependencies are present:
- cacertinmem, usercertinmem (OpenSSL/fork)
- multi-uv (libuv)
- multithread, threaded-ssl (pthread)
- sessioninfo (GnuTLS)

Indicate the necessary dependency via a `Required:` comment placed in
the source file. A single dependency per source is supported as of now.
The name of the dependency should match the variable used within
the cmake scripts, which in turn matches the macro used in the config
header. E.g. for GnuTLS it's `USE_GNUTLS`.

Also:
- GHA/macos: build examples in two job to test GnuTLS and pthread ones.
- GHA/linux: enable libuv to test it with examples.

Follow-up to 6bb77140322565ca17f5a66aa5d8500d8d469cca #18914
Closes #18909

4 weeks agongtcp2: fix handling of blocked stream data
Stefan Eissing [Tue, 7 Oct 2025 09:30:46 +0000 (11:30 +0200)] 
ngtcp2: fix handling of blocked stream data

The stream blocking might not be the one of the current easy handle.
Look up the stream to be marked as blocking via its stream_id in the
internal hash. Theoretically, this does not have to be one of the h3
streams, so not finding it is not an error.

Fixes #18905
Reported-by: Joshua Rogers
Closes #18906

4 weeks agoosslq: set out idle timeout to 0
Stefan Eissing [Tue, 7 Oct 2025 10:05:08 +0000 (12:05 +0200)] 
osslq: set out idle timeout to 0

Similar to our ngtcp2 backend, set our idle timeout for the connection
to 0, meaning we have no such timeout from our side. The effective idle
timeout is then the one announced by the peer.

Closes #18907

4 weeks agoCURLMOPT_NOTIFYFUNCTION.md: minor language polish
Daniel Stenberg [Tue, 7 Oct 2025 14:18:22 +0000 (16:18 +0200)] 
CURLMOPT_NOTIFYFUNCTION.md: minor language polish

- mention the possibility of new types in the future
- s/a an/an

Closes #18913

4 weeks agomulti: use CURLMNOTIFY_ as notification id prefix
Daniel Stenberg [Tue, 7 Oct 2025 14:00:59 +0000 (16:00 +0200)] 
multi: use CURLMNOTIFY_ as notification id prefix

Since CURLM_ is already used as prefix for multi error codes, it makes
it easier to detect and understand the difference between identifiers -
and allows for scripts on the website and elsewhere to separate them
properly.

Follow-up to 53be8166b2b16d9682
Closes #18912

4 weeks agoexamples: fix build issues in 'complicated' examples
Viktor Szakats [Tue, 7 Oct 2025 11:54:17 +0000 (13:54 +0200)] 
examples: fix build issues in 'complicated' examples

- cacertinmem: build cleanly with BoringSSL/AWS-LC.
- cacertinmem: silence `-Wcast-function-type-strict`.
- multi-uv: fix callback prototypes.
- multithread, threaded-ssl: do not pass const as thread arg.
- sessioninfo: fix suppressing deprecated feature warning.
- usercertinmem: sync formatting with cacertinmem.

Follow-up to 4a6bdd5899005c25ce222dc21dcfd1a779544330 #18908
Cherry-picked from #18909
Closes #18914

4 weeks agomulti: notify rename, remove the last stragglers
Stefan Eissing [Tue, 7 Oct 2025 11:40:05 +0000 (13:40 +0200)] 
multi: notify rename, remove the last stragglers

in the public API.

Follow-up to 357808f4addef44c2c48f17d

Closes #18910

4 weeks agocmake: build the "all" examples source list dynamically
Viktor Szakats [Tue, 7 Oct 2025 12:04:12 +0000 (14:04 +0200)] 
cmake: build the "all" examples source list dynamically

To allow building conditional examples, and to simplify by avoiding
cmake-version dependent code.

Follow-up to fe5225b5eaf3a1a0ce149023d38a9922a114798b #18209
Cherry-picked from #18909
Closes #18911

4 weeks agosocks: handle premature close
Stefan Eissing [Mon, 6 Oct 2025 12:08:07 +0000 (14:08 +0200)] 
socks: handle premature close

When expecting to receive a number of bytes during socks connect,
treat an early connection close as error.

Reported-by: Joshua Rogers
Closes #18883

4 weeks agoexamples/usercertinmem: avoid stripping const
Viktor Szakats [Tue, 7 Oct 2025 10:04:03 +0000 (12:04 +0200)] 
examples/usercertinmem: avoid stripping const

This API started accepting a const somewhere between OpenSSL 1.0.2b and
1.0.2t. It means this example, like the other similar one now works best
with those versions or newer:
```
docs/examples/usercertinmem.c:100:33: error: cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual]
  100 |   bio = BIO_new_mem_buf((char *)mypem, -1);
      |                                 ^
docs/examples/usercertinmem.c:121:34: error: cast from 'const char *' to 'char *' drops const qualifier [-Werror,-Wcast-qual]
  121 |   kbio = BIO_new_mem_buf((char *)mykey, -1);
      |                                  ^
```

Closes #18908

4 weeks agovquic/ngtcp2: compare idle timeout in ms to avoid overflow
Joshua Rogers [Tue, 7 Oct 2025 07:48:36 +0000 (15:48 +0800)] 
vquic/ngtcp2: compare idle timeout in ms to avoid overflow

Closes #18903

4 weeks agovquic: fix idle-timeout checks (ngtcp2 ms<-->ns), 64-bit log & honor 0=no-timeout...
Joshua Rogers [Tue, 7 Oct 2025 05:34:26 +0000 (13:34 +0800)] 
vquic: fix idle-timeout checks (ngtcp2 ms<-->ns), 64-bit log & honor 0=no-timeout (osslquic)

Closes #18903

4 weeks agomulti: add notifications API
Stefan Eissing [Mon, 1 Sep 2025 09:58:16 +0000 (11:58 +0200)] 
multi: add notifications API

Add infrastructure to colled and dispatch notifications for transfers
and the multi handle in general. Applications can register a callback
and en-/disable notification type the are interested in.

Without a callback installed, notifications are not collected. Same when
a notification type has not been enabled.

Memory allocation failures on adding notifications lead to a general
multi failure state and result in CURLM_OUT_OF_MEMORY returned from
curl_multi_perform() and curl_multi_socket*() invocations.

Closes #18432

4 weeks agongtcp2: fix returns when TLS verify failed
Stefan Eissing [Mon, 6 Oct 2025 11:16:55 +0000 (13:16 +0200)] 
ngtcp2: fix returns when TLS verify failed

In both send/recv functions of the ngtcp2 filter, when TLS verification
has failed, jump out by skipping ingress/egress handling.

Reported-by: Joshua Rogers
Closes #18881

4 weeks agoexamples/synctime: make the sscanf not overflow the local buffer
Daniel Stenberg [Mon, 6 Oct 2025 14:19:21 +0000 (16:19 +0200)] 
examples/synctime: make the sscanf not overflow the local buffer

If the incoming Date: header has a funky format.

Bonus: remove bad null terminator assumptions for header

Reported-by: Stanislav Fort
Closes #18890

4 weeks agoRELEASE-NOTES: synced
Daniel Stenberg [Mon, 6 Oct 2025 21:59:33 +0000 (23:59 +0200)] 
RELEASE-NOTES: synced

4 weeks agotelnet: ignore empty suboptions
Daniel Stenberg [Mon, 6 Oct 2025 21:05:10 +0000 (23:05 +0200)] 
telnet: ignore empty suboptions

To avoid printing from en empty buffer

Reported-by: Joshua Rogers
Closes #18899

4 weeks agotftp: return error if it hits an illegal state
Daniel Stenberg [Mon, 6 Oct 2025 16:25:55 +0000 (18:25 +0200)] 
tftp: return error if it hits an illegal state

Reported-by: Joshua Rogers
Closes #18894

4 weeks agotftp: default timeout per block is now 15 seconds
Daniel Stenberg [Mon, 6 Oct 2025 15:32:50 +0000 (17:32 +0200)] 
tftp: default timeout per block is now 15 seconds

Down from the previous (rather ridiculous) 3600.

Reported-by: Joshua Rogers
Closes #18893

4 weeks agotftp: don't pin or check address if recvfrom returns error
Daniel Stenberg [Mon, 6 Oct 2025 15:23:18 +0000 (17:23 +0200)] 
tftp: don't pin or check address if recvfrom returns error

Follow-up to c4f9977c66bbb05a837a7eb0300
Reported-by: Joshua Rogers
Closes #18892

4 weeks agonoproxy: fix the IPV6 network mask pattern match
Daniel Stenberg [Mon, 6 Oct 2025 14:53:27 +0000 (16:53 +0200)] 
noproxy: fix the IPV6 network mask pattern match

It would mismatch if the network prefix length with was not divisible by
8.

Extended test 1614 to verify

Reported-by: Stanislav Fort
Closes #18891

4 weeks agomdlinkcheck: reject URLs containing quotes
Daniel Stenberg [Mon, 6 Oct 2025 14:10:27 +0000 (16:10 +0200)] 
mdlinkcheck: reject URLs containing quotes

Those would be illegal anyway and would make the script misbehave

Reported-by: Stanislav Fort
Closes #18889

4 weeks agotelnet: send failure logged but not returned
Daniel Stenberg [Mon, 6 Oct 2025 13:01:48 +0000 (15:01 +0200)] 
telnet: send failure logged but not returned

Return error correctly when sending fails.

Reported-by: Joshua Rogers
Closes #18887

4 weeks agotelnet: return error if WSAEventSelect fails
Daniel Stenberg [Mon, 6 Oct 2025 12:59:53 +0000 (14:59 +0200)] 
telnet: return error if WSAEventSelect fails

Reported-by: Joshua Rogers
Closes #18886

4 weeks agomanagen: verify the options used in example lines
Daniel Stenberg [Mon, 6 Oct 2025 12:41:14 +0000 (14:41 +0200)] 
managen: verify the options used in example lines

Also fix the --knownhosts typo

Follow-up to aae18c4bdc1a3bf5

Reported-by: Daniel Terhorst-North
URL: https://mas.to/@tastapod/115327102344617386
Closes #18884

4 weeks agopingpong: remove two old leftover debug infof() calls
Daniel Stenberg [Mon, 6 Oct 2025 11:05:01 +0000 (13:05 +0200)] 
pingpong: remove two old leftover debug infof() calls

4 weeks agotest766: verify CURLOPT_SOCKOPTFUNCTION error on accept
Daniel Stenberg [Mon, 6 Oct 2025 10:43:40 +0000 (12:43 +0200)] 
test766: verify CURLOPT_SOCKOPTFUNCTION error on accept

This test does active FTP with a socketopt callback that returns error
for the CURLSOCKTYPE_ACCEPT "purpose" to make sure we test and exercise
this error path - without leaks.

Closes #18879

4 weeks agocurl_osslq: error out properly if BIO_ADDR_rawmake() fails
Daniel Stenberg [Mon, 6 Oct 2025 10:27:36 +0000 (12:27 +0200)] 
curl_osslq: error out properly if BIO_ADDR_rawmake() fails

Reported-by: Joshua Rogers
Closes #18878

4 weeks agolibssh2/sftp_realpath: change state consistently
Daniel Stenberg [Mon, 6 Oct 2025 09:07:47 +0000 (11:07 +0200)] 
libssh2/sftp_realpath: change state consistently

Change the state in this function at a single spot independent of
success or not to simplify.

Reported-by: Joshua Rogers
Closes #18875

4 weeks agolibssh2: fix return code for EAGAIN
Daniel Stenberg [Mon, 6 Oct 2025 09:03:35 +0000 (11:03 +0200)] 
libssh2: fix return code for EAGAIN

In disconnect

Closes #18874

4 weeks agotidy-up: miscellaneous (cont.)
Viktor Szakats [Mon, 29 Sep 2025 10:36:14 +0000 (12:36 +0200)] 
tidy-up: miscellaneous (cont.)

- examples: replace magic numbers with `sizeof()`.
- typos: drop rules no longer needed after excluding tests/data.
- typos: move an exception inline.
- alpha-sort lists.
- fix indentation, whitespace.

Closes #18898

4 weeks agolib: stop overriding system printf symbols
Viktor Szakats [Sat, 4 Oct 2025 10:58:49 +0000 (12:58 +0200)] 
lib: stop overriding system printf symbols

After this patch, the codebase no longer overrides system printf
functions. Instead it explicitly calls either the curl printf functions
`curl_m*printf()` or the system ones using their original names.

Also:
- drop unused `curl_printf.h` includes.
- checksrc: ban system printf functions, allow where necessary.

Follow-up to db98daab05aec251bcb6615d2d38dfebec291736 #18844
Follow-up to 4deea9396bc7dd25c6362fa746a57bf309c74ada #18814

Closes #18866

4 weeks agoREUSE: bump reuse to v6, add more fences to fix issues
Viktor Szakats [Mon, 6 Oct 2025 18:35:38 +0000 (20:35 +0200)] 
REUSE: bump reuse to v6, add more fences to fix issues

Closes #18895
Closes #18897

4 weeks agoGHA/configure-vs-cmake: reduce windows cross-toolchain apt installs
Viktor Szakats [Mon, 6 Oct 2025 18:00:55 +0000 (20:00 +0200)] 
GHA/configure-vs-cmake: reduce windows cross-toolchain apt installs

Download size: 277 MB -> 65 MB (installed: 1293 MB -> 401 MB)

Also as a workaround for Azure Ubuntu mirror slowdown issues:
https://github.com/curl/curl/actions/runs/18289326469/job/52072333582?pr=18866

Follow-up to 0455d8772a1af20ce63c46c5738582aa9b1b8441 #18509

Closes #18896

4 weeks agoldap: tidy-up types, fix error code confusion
Viktor Szakats [Mon, 6 Oct 2025 13:46:29 +0000 (15:46 +0200)] 
ldap: tidy-up types, fix error code confusion

- fix `CURLcode` vs. LDAP result code confusion.
  Return `LDAP_NO_MEMORY` when `Curl_create_sspi_identity()` fails,
  since it can only return `CURLE_OUT_OF_MEMORY` as error.
- use `ULONG` for result code on Windows. Drop casts.
- use portable `curl_ldap_num_t`. Drop casts.
- replace magic number 0 with `LDAP_SUCCESS`.
- compare with `LDAP_SUCCESS` instead of assuming non-zero.
  (where necessary.)
- add/fix `#endif` comments.
- fix indentation.

Closes #18888

4 weeks agotelnet: make bad_option() consider NULL a bad option too
Daniel Stenberg [Mon, 6 Oct 2025 08:56:44 +0000 (10:56 +0200)] 
telnet: make bad_option() consider NULL a bad option too

Follow-up to a72e1552f22
Closes #18873

4 weeks agoftp: remove misleading comments
Daniel Stenberg [Mon, 6 Oct 2025 08:34:22 +0000 (10:34 +0200)] 
ftp: remove misleading comments

They indicated that sockets would not be closed but they are.

Reported-by: Joshua Rogers
Closes #18871

4 weeks agoftp: improve fragile check for first digit > 3
Daniel Stenberg [Mon, 6 Oct 2025 08:20:45 +0000 (10:20 +0200)] 
ftp: improve fragile check for first digit > 3

In a case where rubbish would be sent in the line something that isn't a
digit could be first in line and treated as less than '3'. Prevent this
risk by first doing a check that the byte is a digit.

Reported-by: Joshua Rogers
Closes #18870

4 weeks agoftp: add extra buffer length check
Daniel Stenberg [Mon, 6 Oct 2025 08:11:30 +0000 (10:11 +0200)] 
ftp: add extra buffer length check

This adds an extra check that the buffer really has data enough (at
least 4 bytes) to check for a status code before doing so. It *should*
not be necessary, but this was pointed out by an analyzer and it feels
better to make sure.

Reported-by: Joshua Rogers
Closes #18869

4 weeks agoftp: fix the 213 scanner memchr buffer limit argument
Daniel Stenberg [Mon, 6 Oct 2025 07:54:39 +0000 (09:54 +0200)] 
ftp: fix the 213 scanner memchr buffer limit argument

Reported-by: Joshua Rogers
Closes #18867

4 weeks agocf-socket: check params and remove accept procondition
Stefan Eissing [Mon, 6 Oct 2025 11:45:38 +0000 (13:45 +0200)] 
cf-socket: check params and remove accept procondition

- creating a socket filter with NULL addrinfo fails with
  CURLE_BAD_FUNCTION_ARGUMENT
- remove getsockname use before accept call, serves no purpose
  and did not lead to proper error before

Reported-by: Joshua Rogers
Closes #18882

4 weeks agocf-socket: always check Curl_cf_socket_peek() return code
Daniel Stenberg [Mon, 6 Oct 2025 06:22:39 +0000 (08:22 +0200)] 
cf-socket: always check Curl_cf_socket_peek() return code

Make it trigger a warning if not.

Reported-by: Joshua Rogers
Closes #18862

4 weeks agowindows: use consistent format when showing error codes
Viktor Szakats [Mon, 6 Oct 2025 01:02:24 +0000 (03:02 +0200)] 
windows: use consistent format when showing error codes

For `GetLastError()` and `SECURITY_STATUS`:
0x-prefixed, 8-digit, lowercase, hex: 0x1234abcd

Also: say `GetLastError()` instead of `errno` in one message.

Closes #18877

4 weeks agokrb5_sspi: the chlg argument is NOT optional
Daniel Stenberg [Mon, 6 Oct 2025 07:44:45 +0000 (09:44 +0200)] 
krb5_sspi: the chlg argument is NOT optional

Fix the comment, add assert.

Reported-by: Joshua Rogers
Closes #18865

4 weeks agolibssh2: clarify that sshp->path is always at least one byte
Daniel Stenberg [Mon, 6 Oct 2025 07:38:30 +0000 (09:38 +0200)] 
libssh2: clarify that sshp->path is always at least one byte

Reported-by: Joshua Rogers
Closes #18864

4 weeks agolibssh2: bail out on chgrp and chown number parsing errors
Daniel Stenberg [Mon, 6 Oct 2025 07:02:09 +0000 (09:02 +0200)] 
libssh2: bail out on chgrp and chown number parsing errors

Reported-by: Joshua Rogers
Closes #18863

4 weeks agotest1711: send a >64K mail with SMTP
Daniel Stenberg [Mon, 6 Oct 2025 05:51:48 +0000 (07:51 +0200)] 
test1711: send a >64K mail with SMTP

A failed attempt to reproduce #18798

Closes #18861

4 weeks agotool_getparam: add --knownhosts
Daniel Stenberg [Sun, 5 Oct 2025 21:19:13 +0000 (23:19 +0200)] 
tool_getparam: add --knownhosts

To allow users to specify a known hosts file that is not the default
one: ~/.ssh/known_hosts

URL: https://github.com/curl/curl/discussions/18784
Closes #18859

4 weeks agoquiche: fix possible leaks on teardown
Stefan Eissing [Mon, 6 Oct 2025 11:05:14 +0000 (13:05 +0200)] 
quiche: fix possible leaks on teardown

When the close of the quiche filter was never called, the destroy function
did not release all allicated resources.

When closing a quiche filter, set the connected flag to FALSE.

Reported-by: Joshua Rogers
Closes #18880

4 weeks agowindows: use native error code types more
Viktor Szakats [Mon, 6 Oct 2025 00:33:49 +0000 (02:33 +0200)] 
windows: use native error code types more

- curlx_get_winapi_error: accept DWORD (was: int), move casts one level
  up the callstack.

- sspi: bump some types to `SECURITY_STATUS` (int -> LONG).

- digest_sspi: drop unnecessary cast.

Closes #18868