]> git.ipfire.org Git - thirdparty/curl.git/log
thirdparty/curl.git
8 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

8 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

8 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

8 weeks agoopenssl: call SSL_get_error() with proper error
Daniel Stenberg [Mon, 6 Oct 2025 08:39:29 +0000 (10:39 +0200)] 
openssl: call SSL_get_error() with proper error

The error function should be called with the return code from the
previous call to SSL_shutdown() as argument.

Closes #18872

8 weeks agosrc: stop overriding system printf symbols
Viktor Szakats [Sat, 4 Oct 2025 10:24:57 +0000 (12:24 +0200)] 
src: stop overriding system printf symbols

Also:
- tool_operate: use the socket printf mask, drop cast.

Follow-up to 4deea9396bc7dd25c6362fa746a57bf309c74ada #18814

Closes #18844

8 weeks agocurlx: move Curl_strerror, use in src and tests, ban `strerror` globally
Viktor Szakats [Sat, 4 Oct 2025 01:10:37 +0000 (03:10 +0200)] 
curlx: move Curl_strerror, use in src and tests, ban `strerror` globally

Also:
- tests/server: replace local `sstrerror()` with `curlx_strerror()`.
- tests/server: show the error code next to the string, where missing.
- curlx: use `curl_msnprintf()` when building for src and tests.
  (units was already using it.)
- lib: drop unused includes found along the way.
- curlx_strerror(): avoid compiler warning (and another similar one):
  ```
  In file included from servers.c:14:
  ../../lib/../../lib/curlx/strerr.c: In function ‘curlx_strerror’:
  ../../lib/../../lib/curlx/strerr.c:328:32: error: ‘snprintf’ output may be truncated before the last format character [-Werror=format-truncation=]
    328 |       SNPRINTF(buf, buflen, "%s", msg);
        |                                ^
  ../../lib/../../lib/curlx/strerr.c:47:18: note: ‘snprintf’ output 1 or more bytes (assuming 2) into a destination of size 1
     47 | #define SNPRINTF snprintf
        |                  ^
  ../../lib/../../lib/curlx/strerr.c:328:7: note: in expansion of macro ‘SNPRINTF’
    328 |       SNPRINTF(buf, buflen, "%s", msg);
        |       ^~~~~~~~
  ```

Follow-up to 45438c8d6f8e70385d66c029568524e9e803c539 #18823

Closes #18840

8 weeks agotests/server: replace banned functions with `curlx_str_hex`
Viktor Szakats [Fri, 3 Oct 2025 22:39:11 +0000 (00:39 +0200)] 
tests/server: replace banned functions with `curlx_str_hex`

Replace an `strtol()` and `strtoul()` call, both used in hex mode, with
`curlx_str_hex()`.

Follow-up to 45438c8d6f8e70385d66c029568524e9e803c539 #18823

Closes #18837

2 months agounit1323: sync time types and printf masks, drop casts
Viktor Szakats [Sun, 5 Oct 2025 22:10:13 +0000 (00:10 +0200)] 
unit1323: sync time types and printf masks, drop casts

Closes #18860

2 months agotool_filetime: replace cast with the fitting printf mask (Windows)
Viktor Szakats [Sun, 5 Oct 2025 18:36:21 +0000 (20:36 +0200)] 
tool_filetime: replace cast with the fitting printf mask (Windows)

Follow-up to d25b0503795f1fbf557632ce870298f52f2a78c1 #2204

Closes #18858

2 months agourl: make Curl_init_userdefined return void
Daniel Stenberg [Sun, 5 Oct 2025 12:07:39 +0000 (14:07 +0200)] 
url: make Curl_init_userdefined return void

It cannot actually return an error, so the parent function does not need
to check for error and have an exit path that cannot be reached.

Pointed out by CodeSonar

Closes #18855

2 months agostrerror: drop workaround for SalfordC win32 header bug
Viktor Szakats [Sun, 5 Oct 2025 16:36:06 +0000 (18:36 +0200)] 
strerror: drop workaround for SalfordC win32 header bug

Follow-up to ccf43ce91dd9a56f30a4029377126e4c83c7f08a #15957

Closes #18857

2 months agoGHA/http3-linux: cleanup cache entry name after prev
Viktor Szakats [Sun, 5 Oct 2025 09:08:40 +0000 (11:08 +0200)] 
GHA/http3-linux: cleanup cache entry name after prev

To avoid duplicate `no-deprecated` in the cache entry name.

Follow-up to c96bf36557ea2302e4cb838ee1e4bb9827fecee7 #18833

Closes #18853

2 months agotelnet: print DISPlay LOCation in printsub without mutating buffer
Joshua Rogers [Sun, 5 Oct 2025 03:07:54 +0000 (11:07 +0800)] 
telnet: print DISPlay LOCation in printsub without mutating buffer

Closes #18852

2 months agotelnet: use pointer[0] for "unknown" option instead of pointer[i]
Joshua Rogers [Sun, 5 Oct 2025 02:57:29 +0000 (10:57 +0800)] 
telnet: use pointer[0] for "unknown" option instead of pointer[i]

i is taken from pointer[length-2] (often the IAC byte) before we do
length -= 2, so using pointer[i] indexes an arbitrary/stale byte
unrelated to the option code. pointer[0] is the suboption’s option code
per the telnet SB format, so printing pointer[0] yields correct, stable
diagnostics.

Closes #18851

2 months agocpool: make bundle->dest an array; fix UB
Joshua Rogers [Sun, 5 Oct 2025 02:38:14 +0000 (10:38 +0800)] 
cpool: make bundle->dest an array; fix UB

Replace `char *dest[1]` with a proper `char dest[1]` array in
cpool_bundle. This removes undefined behavior from memcpy (writing past
the declared object) while keeping the same key semantics: dest_len is
strlen+1 (includes NUL), and hash add/delete calls remain unchanged.

Closes #18850

2 months agoGHA: remove the hacktoberfest label action
Daniel Stenberg [Sat, 4 Oct 2025 21:17:32 +0000 (23:17 +0200)] 
GHA: remove the hacktoberfest label action

No one cares about hacktoberfest anymore.

Closes #18849

2 months agochecksrc: fix possible endless loops/errors in the banned function logic
Viktor Szakats [Sat, 4 Oct 2025 11:04:29 +0000 (13:04 +0200)] 
checksrc: fix possible endless loops/errors in the banned function logic

By quoting the search expression to be replaced. This avoid the issue
when the code leading up to a banned function contained regex characters
that the script did not explicitly handle, e.g. `+`.

Assisted-by: Daniel Stenberg
Ref: https://perldoc.perl.org/functions/quotemeta
Follow-up to dd37d6970cfd8b4cf47ebd469f03772813b92c23 #18775

Closes #18845

2 months agounit1664: drop casts, expand masks to full values
Viktor Szakats [Sat, 4 Oct 2025 00:53:02 +0000 (02:53 +0200)] 
unit1664: drop casts, expand masks to full values

Follow-up to 4deea9396bc7dd25c6362fa746a57bf309c74ada #18814

Closes #18838

2 months agoGHA: drop quictls 3.3.0 builds in favor of openssl 3.5+
Viktor Szakats [Fri, 3 Oct 2025 14:40:28 +0000 (16:40 +0200)] 
GHA: drop quictls 3.3.0 builds in favor of openssl 3.5+

- http3-linux: move local nghttpx (nghttp2) build to openssl (from
  quictls). Also tried LibreSSL, but it made some HTTP/2 tests fails.

- http3-linux: drop quictls ngtcp2 build.

- http3-linux: build local openssl with `no-deprecated`.
  (previously tested in the quictls local build.)

- http3-linux: explicitly disable LDAP in cmake openssl jobs.
  cmake builds auto-detect OpenLDAP (autotools don't), and when enabled,
  linking curl fails because system `libsasl.so` requires MD5 openssl
  functions, which are missing from openssl no-deprecated builds.

- macos: move options tested in quictls jobs to other ones.

- linux: drop unused quictls local build. (it was used for msh3.)
  Follow-up to 91138b014d960d2ef6ce9cd0ca237d0220b2458d #17729

- renovate: drop quictls bump detection.

Closes #18833

2 months agoexamples: fix two build issues surfaced with WinCE
Viktor Szakats [Sat, 4 Oct 2025 02:33:49 +0000 (04:33 +0200)] 
examples: fix two build issues surfaced with WinCE

Both may apply to rare non-WinCE Windows builds too.

- fix gcc 4.4.0 preprocessor error:
  ```
  docs/examples/http2-upload.c:43:8: error: "_MSC_VER" is not defined
  ```
  Ref: https://github.com/curl/curl/actions/runs/18238150607/job/51935502616

- fix wrong header order:
  Inlcude `windows.h` after `winsock2.h` via `curl/curl.h`.

Regressions from 45438c8d6f8e70385d66c029568524e9e803c539 #18823

Closes #18843

2 months agoexamples: drop unused `curl/mprintf.h` includes
Viktor Szakats [Sat, 4 Oct 2025 02:51:19 +0000 (04:51 +0200)] 
examples: drop unused `curl/mprintf.h` includes

Follow-up to 45438c8d6f8e70385d66c029568524e9e803c539 #18823

Closes #18842

2 months agoopenssl: fix build for v1.0.2
Viktor Szakats [Sat, 4 Oct 2025 02:12:17 +0000 (04:12 +0200)] 
openssl: fix build for v1.0.2

```
lib/vtls/openssl.c: In function 'asn1_object_dump':
lib/vtls/openssl.c:299:42: error: passing argument 3 of 'i2t_ASN1_OBJECT' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  299 |   int i = i2t_ASN1_OBJECT(buf, (int)len, a);
      |                                          ^
In file included from /home/runner/djgpp/include/openssl/objects.h:965,
                 from /home/runner/djgpp/include/openssl/evp.h:94,
                 from /home/runner/djgpp/include/openssl/x509.h:73,
                 from /home/runner/djgpp/include/openssl/ssl.h:156,
                 from lib/curl_ntlm_core.c:71,
                 from bld/lib/CMakeFiles/libcurl_static.dir/Unity/unity_0_c.c:88:
/home/runner/djgpp/include/openssl/asn1.h:921:58: note: expected 'ASN1_OBJECT *' {aka 'struct asn1_object_st *'} but argument is of type 'const ASN1_OBJECT *' {aka 'const struct asn1_object_st *'}
  921 | int i2t_ASN1_OBJECT(char *buf, int buf_len, ASN1_OBJECT *a);
      |                                             ~~~~~~~~~~~~~^
```
Ref: https://github.com/curl/curl/actions/runs/18236773678/job/51931937131?pr=18039

Follow-up to bb46d42407cd0503a9c499b4646af594a4db4947 #18647

Closes #18841

2 months agolib: drop unused include and duplicate guards
Viktor Szakats [Sat, 4 Oct 2025 01:11:09 +0000 (03:11 +0200)] 
lib: drop unused include and duplicate guards

Closes #18839

2 months agotests: stop overriding system printf symbols
Viktor Szakats [Thu, 2 Oct 2025 14:01:15 +0000 (16:01 +0200)] 
tests: stop overriding system printf symbols

To make the source code match the functions called at runtime.
And to avoid the preprocessor trick that may introduces build issues.

Before this patch, libtests, tunits and units were calling a mixture
of curl and system printf calls, then transformed them all to curl
printf calls by including `curl_printf.h`.

Changes made:
- tests: stop including `curl_printf.h`.
- libtest: switch a couple of outlier system printf calls to curl
  printf.
- unit: use more curl printf to avoid casts and show whole values.
- unit: switch remaining calls to curl printf explicitly.
- tunit: switch to call curl printf explicitly.
- libtest, tunit, unit: ban system printf.
- unit1307, unit1607, unit1609, unit1652, unit1655, unit3214: bump
  types/masks to avoid casts.

After this patch:
- libtests, tunits, units: use exclusively curl printf.
  (as before, but explicitly, without relying on redefinitions.)
- servers: is unchanged (it can only use system printf).

Closes #18814

2 months agochecksrc: reduce directory-specific exceptions
Viktor Szakats [Thu, 2 Oct 2025 19:33:48 +0000 (21:33 +0200)] 
checksrc: reduce directory-specific exceptions

By making them defaults, then fixing and/or reshuffling remaining
exceptions as necessary.

- checksrc: ban by default: `snprintf`, `vsnprintf`, `sscanf`, `strtol`.
- examples: replace `strtol` with `atoi` to avoid a checksrc exception.
- tests/libtest: replace `strtol` with `atol`.
- tests/server: replace most `strtol` with `atol`.
- tests/server: replace most `strtoul` with `atol`/`atoi`.
- tests/server: drop no longer used `util_ultous`.
- fix typo in checksrc rules: `vsnprint` -> `vsnprintf`.
- update local exceptions.

Also:
- examples: ban curl printf functions. They're discouraged in user code.
- examples: replace curl printf with system printf.
  Add `snprintf` workaround for <VS2015.
- examples/synctime: fix `-Wfloat-equal`.
- examples/synctime: exclude for non-Windows and non-UWP Windows.
- examples/synctime: build by default.

Closes #18823

2 months agochecksrc: fix to handle `)` predecing a banned function
Viktor Szakats [Fri, 3 Oct 2025 01:12:39 +0000 (03:12 +0200)] 
checksrc: fix to handle `)` predecing a banned function

Fixing:
```
Unmatched ) in regex; marked by <-- HERE in m/  \*buffer_len = \(ssize_t) <-- HERE
  strtol\(/ at /home/runner/work/curl/curl/scripts/checksrc.pl line 916, <$R> line 380.
```
Ref: https://github.com/curl/curl/actions/runs/18209824275/job/51848079550#step:3:5

Also add a test case.

Follow-up to 684f4cdd3ef0cc41c547fce0e45d8a059a3058b3 #18779
Cherry-picked from #18823
Closes #18836

2 months agoGHA: update dependency google/boringssl to v0.20251002.0
renovate[bot] [Fri, 3 Oct 2025 15:54:06 +0000 (15:54 +0000)] 
GHA: update dependency google/boringssl to v0.20251002.0

Closes #18834

2 months agoMakefile.example: fix option order [ci skip]
Viktor Szakats [Fri, 3 Oct 2025 19:15:33 +0000 (21:15 +0200)] 
Makefile.example: fix option order [ci skip]

The `ld` linker is sensitive to this, and did not find libcurl symbol
with the order before this patch. Seen with mingw-w64 gcc.

Follow-up to f6ddc1fc1e25ff8ea866f90942719af898d0ef0c #18554

Closes #18835

2 months agodoh: inherit new custom ssl flags
Stefan Eissing [Fri, 3 Oct 2025 12:15:04 +0000 (14:15 +0200)] 
doh: inherit new custom ssl flags

The new custom_* flags in the SSL config need to be inherited when
setting up the doh easy handle, so that defaults apply the same way as
for the original easy handle.

Closes #18831

2 months agoGHA: show full versions next to pinned actions
Viktor Szakats [Fri, 3 Oct 2025 12:27:28 +0000 (14:27 +0200)] 
GHA: show full versions next to pinned actions

Also quotes to a configuration entry.

Follow-up to 2e5993ab0812fd1a983738f6d6efbc7bb0806144 #18827

Closes #18832

2 months agoprogress: expand to use 6 characters per size
Daniel Stenberg [Fri, 3 Oct 2025 08:51:46 +0000 (10:51 +0200)] 
progress: expand to use 6 characters per size

Previously the progress meter used a maximum of five digits+letter in
the progress meter output: up to 99999 bytes and then 9999k, 9999M etc.
The output then used two spaces after the size between the next field in
the display.

This new approach uses one letter more with only one space in between
the fields. It makes it possible to show up to 999999 bytes and then
99999k, 99999M etc. The function uses a single decimal when outputting a
value less than 1000 in any unit. Like 999.9M.

Closes #18828

2 months agoGHA: update actions/upload-artifact action to v4.6.2
renovate[bot] [Fri, 3 Oct 2025 11:55:38 +0000 (11:55 +0000)] 
GHA: update actions/upload-artifact action to v4.6.2

Closes #18830

2 months agoGHA/checksrc: pass zizmor a GH token, fix warnings found
Viktor Szakats [Fri, 3 Oct 2025 09:43:10 +0000 (11:43 +0200)] 
GHA/checksrc: pass zizmor a GH token, fix warnings found

For a complete, online, check.

After this patch the check takes 30s, up from a fraction of a second.

Also bump CodeQL actions to their latest version.

Closes #18827

2 months agotool_progress: fix < 10000 output
Daniel Stenberg [Fri, 3 Oct 2025 08:18:27 +0000 (10:18 +0200)] 
tool_progress: fix < 10000 output

Follow-up to e49698925c7f90e

Closes #18826

2 months agodocs/cmdline-opts: drop double quotes from GLOBBING and URL examples
Daniel Stenberg [Fri, 3 Oct 2025 10:38:40 +0000 (12:38 +0200)] 
docs/cmdline-opts: drop double quotes from GLOBBING and URL examples

It looks easier on the eye without them

Closes #18829

2 months agovquic: handling of io improvements
Stefan Eissing [Thu, 2 Oct 2025 12:20:05 +0000 (14:20 +0200)] 
vquic: handling of io improvements

- better tracing of what system call is used and how often
- ngtcp2: combine vquic_send into larger chunks
- ngtcp2: define own PMTU values and enable MTU probing
- ngtcp2: trace interesting remote transport parameters

Closes #18812

2 months agossl: support Apple SecTrust configurations
Stefan Eissing [Wed, 24 Sep 2025 08:19:46 +0000 (10:19 +0200)] 
ssl: support Apple SecTrust configurations

- configure/cmake support for enabling the option
- supported in OpenSSL and GnuTLS backends
- when configured, Apple SecTrust is the default trust store
  for peer verification. When one of the CURLOPT_* for adding
  certificates is used, that default does not apply.
- add documentation of build options and SSL use

Closes #18703

2 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 3 Oct 2025 06:30:55 +0000 (08:30 +0200)] 
RELEASE-NOTES: synced

Add OpenSSL-QUIC as an item to get removed

2 months agoRELEASE-NOTES: synced
Daniel Stenberg [Fri, 3 Oct 2025 06:26:56 +0000 (08:26 +0200)] 
RELEASE-NOTES: synced

2 months agoDEPRECATE.md: remove OpenSSL 1.1.1 support already in December 2025
Daniel Stenberg [Thu, 2 Oct 2025 21:00:24 +0000 (23:00 +0200)] 
DEPRECATE.md: remove OpenSSL 1.1.1 support already in December 2025

No sponsors == remove it

Closes #18822

2 months agoDEPRECATE.md: We remove the OpenSSL-QUIC backend in March 2026
Daniel Stenberg [Thu, 2 Oct 2025 20:50:25 +0000 (22:50 +0200)] 
DEPRECATE.md: We remove the OpenSSL-QUIC backend in March 2026

URL: https://curl.se/mail/lib-2025-10/0000.html

Closes #18820

2 months agotime-cond.md: refer to the singular curl_getdate man page
Daniel Stenberg [Thu, 2 Oct 2025 15:07:05 +0000 (17:07 +0200)] 
time-cond.md: refer to the singular curl_getdate man page

Closes #18816

2 months agotcp-nodelay.md: expand the documentation
Daniel Stenberg [Thu, 2 Oct 2025 12:41:41 +0000 (14:41 +0200)] 
tcp-nodelay.md: expand the documentation

Instead of referring to another document.

Closes #18811

2 months agocmdline-opts/_PROGRESS.md: explain the suffixes
Daniel Stenberg [Thu, 2 Oct 2025 15:17:22 +0000 (17:17 +0200)] 
cmdline-opts/_PROGRESS.md: explain the suffixes

Closes #18817

2 months agoip-happy: prevent event-based stall on retry
Stefan Eissing [Thu, 2 Oct 2025 14:39:37 +0000 (16:39 +0200)] 
ip-happy: prevent event-based stall on retry

When delaying an IP happy eyeball restart, set an actual timer or the
connection will stall when running event based.

Closes #18815

2 months agoGHA/macos: drop macos-13 runner image from combo jobs
Viktor Szakats [Thu, 2 Oct 2025 17:10:35 +0000 (19:10 +0200)] 
GHA/macos: drop macos-13 runner image from combo jobs

- replace with macos-14.
- refresh tables, exceptions.
- apply a pending TODO.

Closes #18818

2 months agovtls_scache: fix race condition
Jay Satiro [Thu, 2 Oct 2025 13:46:36 +0000 (09:46 -0400)] 
vtls_scache: fix race condition

- Lock before counting the cache sessions.

Prior to this change when taking a session a trace command counted the
sessions but not under lock, which caused a race condition.

Reported by: Viktor Szakats

Fixes https://github.com/curl/curl/issues/18806
Closes https://github.com/curl/curl/pull/18813

2 months agoINTERNALS: specify minimum version for Heimdal: 7.1.0
Viktor Szakats [Thu, 2 Oct 2025 11:39:35 +0000 (13:39 +0200)] 
INTERNALS: specify minimum version for Heimdal: 7.1.0

Released on 2016-Dec-19, it's the first "revamped" stable version, and
the earliest available as a source tarball at the official repository:
https://github.com/heimdal/heimdal/releases/tag/heimdal-7.1.0

It's also the first version hosted by Homebrew. It builds fine locally
with curl, and also builds in CI with old linux: 7.1.0+dfsg-13+deb9u4.

Closes #18809

2 months agorenovate: adjust commit message prefixes, try making CodeQL and AWS-LC updates monthly
Viktor Szakats [Sat, 27 Sep 2025 14:32:22 +0000 (16:32 +0200)] 
renovate: adjust commit message prefixes, try making CodeQL and AWS-LC updates monthly

Also:
- enable pip bumps in Dependabot.
- reduce dependabot to check monthly (was: weekly)
  Dependabot acts as a backup for mend/renovate.

Closes #18761

2 months agocmake: drop exclamation in comment looking like a name
Viktor Szakats [Thu, 2 Oct 2025 12:37:14 +0000 (14:37 +0200)] 
cmake: drop exclamation in comment looking like a name

Ref: https://github.com/curl/curl/pull/3316#issuecomment-442343555
Follow-up to ea4ba6d9ef21a271bfbccedb0456d09a1ed57173 #18803
Follow-up to 558814e16d84aa202c5ccc0c8108a9d728e77a58

Closes #18810

2 months agoINTERNALS: drop Winsock 2.2 from the dependency list
Viktor Szakats [Thu, 2 Oct 2025 11:03:49 +0000 (13:03 +0200)] 
INTERNALS: drop Winsock 2.2 from the dependency list

It's implied by the minimum requirement of Windows XP.
Also Windows CE is soon to be deleted via #17927.

Closes #18808

2 months agoCI: move no-verbose build from Circle CI to existing GHA jobs, with tests
Viktor Szakats [Wed, 1 Oct 2025 20:07:37 +0000 (22:07 +0200)] 
CI: move no-verbose build from Circle CI to existing GHA jobs, with tests

To test it in GHA and catch issues at PR time. Before this patch,
Circle CI caught them after pushing to master (or non-fork PR
branches.) GHA also run runtests, pytests and static analysis on
these builds, after this patch.

- GHA/linux: enable no-verbose in an existing job.
- GHA/linux: enable no-verbose in the H3 scan-build job too.
- GHA/macos: enable no-verbose in one build (= 3 jobs with different
  compilers).
- GHA/codeql: enable no-verbose in the MultiSSL Linux build.
- circleci: delete openssl no-verbose job in favor of the above.

Closes #18797

2 months agomulti_ev: remove unnecessary data check that confuses analysers
Stefan Eissing [Thu, 2 Oct 2025 08:23:42 +0000 (10:23 +0200)] 
multi_ev: remove unnecessary data check that confuses analysers

Closes #18804

2 months agolib: remove personal names from comments
Daniel Stenberg [Thu, 2 Oct 2025 06:30:52 +0000 (08:30 +0200)] 
lib: remove personal names from comments

- it's just too random who got mentioned
- we can't mention all, so better consistently mention none
- make sure they all are mentioned in THANKS
- also remove some unnecessary comment ramblings

Closes #18803

2 months agotool_getparam: always disable "lib-ids" for tracing
Daniel Stenberg [Thu, 2 Oct 2025 08:20:59 +0000 (10:20 +0200)] 
tool_getparam: always disable "lib-ids" for tracing

Since the tool code itself adds the ids (controlled with "ids"), getting
them (also) added by the library adds nothing good. Always disable the
lib-ids even when "--trace-config all" is selected.

Also: change "== Info:" into just "* " to reduce output redundancy.

Ref: #18755
Reported-by: Alice Lee Poetics
Closes #18805

2 months agotool_progress: make max5data() use an algorithm
Daniel Stenberg [Thu, 2 Oct 2025 09:31:52 +0000 (11:31 +0200)] 
tool_progress: make max5data() use an algorithm

Instead of a list of conditions. Makes a unified decimal output when the
value is less than 100. Prepares for > 64 bit data type.

Closes #18807

2 months agopytest: skip specific tests for no-verbose builds
Viktor Szakats [Wed, 1 Oct 2025 21:27:45 +0000 (23:27 +0200)] 
pytest: skip specific tests for no-verbose builds

Detect via curlinfo if curl has verbose strings disabled, and skip
tests that require it.

Also:
- cmake: make pytests depend on curlinfo.

Cherry-picked from #18797
Closes #18801

2 months agoruntests: tag tests that require curl verbose strings
Viktor Szakats [Wed, 1 Oct 2025 20:36:08 +0000 (22:36 +0200)] 
runtests: tag tests that require curl verbose strings

To skip them when curl has verbose strings disabled, instead of failing.

Cherry-picked from #18797
Closes #18800

2 months agolib: fix build error and compiler warnings with verbose strings disabled
Viktor Szakats [Wed, 1 Oct 2025 20:19:01 +0000 (22:19 +0200)] 
lib: fix build error and compiler warnings with verbose strings disabled

- asyn-ares: fix compiler warning:
  ```
  lib/asyn-ares.c:751:17: error: code will never be executed [clang-diagnostic-unreachable-code,-warnings-as-errors]
    751 |     char *csv = ares_get_servers_csv(ares->channel);
        |                 ^~~~~~~~~~~~~~~~~~~~
  ```

- curl_trc: fix missing symbol:
  ```
  /usr/bin/ld: ../lib/.libs/libcurl.so: undefined reference to `Curl_trc_timer'
  collect2: error: ld returned 1 exit status
  ```
  Ref: https://app.circleci.com/pipelines/github/curl/curl/15446/workflows/67afa113-9c49-4249-9180-f6f01fc7dfdd/jobs/149177
  Ref: https://github.com/curl/curl/actions/runs/18174250400/job/51736249444#step:33:623
  Follow-up to b02238975768d0bcbf8c7ef00eaaee3ec379f4ff #18768

- multi: fix `-Wunreachable-code`:
  ```
  lib/multi.c:1107:28: error: code will never be executed [-Werror,-Wunreachable-code]
   1107 |     size_t timeout_count = Curl_llist_count(&data->state.timeoutlist);
        |                            ^~~~~~~~~~~~~~~~
  lib/multi.c:3054:35: error: code will never be executed [-Werror,-Wunreachable-code]
   3054 |       struct Curl_llist_node *e = Curl_llist_head(&data->state.timeoutlist);
        |                                   ^~~~~~~~~~~~~~~
  lib/multi.c:3380:7: error: code will never be executed [-Werror,-Wunreachable-code]
   3380 |       Curl_llist_head(&data->state.timeoutlist);
        |       ^~~~~~~~~~~~~~~
  ```

Cherry-picked from #18797
Closes #18799

2 months agoGHA/linux: add HTTP/3 c-ares scan-build and asan jobs
Viktor Szakats [Tue, 23 Sep 2025 08:17:29 +0000 (10:17 +0200)] 
GHA/linux: add HTTP/3 c-ares scan-build and asan jobs

They use Linuxbrew instead of locally built components.

Linuxbrew limitations compared to the locally built components in
GHA/http3-linux:
- libngtcp2 currently supports OpenSSL only.
- wolfssl can't coexist with openssl.
- somewhat tricky configuration with autotools.

Upside is easy of use, always the latest versions (may be downside),
and availability of almost all packages.

Closes #18693

2 months agoGHA: update dependency openssl/openssl to v3.6.0
renovate[bot] [Wed, 1 Oct 2025 19:54:31 +0000 (19:54 +0000)] 
GHA: update dependency openssl/openssl to v3.6.0

Closes #18796

2 months agoGHA/macos: also update LibreSSL source tarball URL
Viktor Szakats [Wed, 1 Oct 2025 19:53:04 +0000 (21:53 +0200)] 
GHA/macos: also update LibreSSL source tarball URL

Follow-up to 150567b0d25b519873800ac883ae43833e8f6aca #18792

2 months agoopenssl-quic: ignore unexpected streams opened by server
Stefan Eissing [Wed, 1 Oct 2025 09:23:27 +0000 (11:23 +0200)] 
openssl-quic: ignore unexpected streams opened by server

HTTP/3 defines "reserved stream types" that are intended to be ignored
by a receiver. This is part of the "greasing" effort that flexes parts
of the protocol that are needed for future extensions.

curl's OpenSSL-QUIC implementation treated all unexpected streams as
an error. Which seems the right thing to do *but* for these reserved types.
However OpenSSL does not expose this type and thus, curl needs to silently
discard all unexpected streams opened by the server to allow interop
with servers that flex the GREASE parts.

Fixes #18780
Reported-by: Pocs Norbert
Closes #18791

2 months agocf-socket: tweak a memcpy() to read better
Daniel Stenberg [Fri, 26 Sep 2025 12:10:30 +0000 (14:10 +0200)] 
cf-socket: tweak a memcpy() to read better

By checking the size of the actual buffer and using that as memcpy
target instead of another union member, this helps readers and static
code analyzers to determine that this is not a buffer overflow.

Ref: #18677
Closes #18787

2 months agoform.md: drop reference to MANUAL
Daniel Stenberg [Wed, 1 Oct 2025 09:26:16 +0000 (11:26 +0200)] 
form.md: drop reference to MANUAL

Since it isn't linked and users might not understand what it refers to.

Ref: #18755
Closes #18790

2 months agotool_getparam: warn if provided header looks malformed
Daniel Stenberg [Wed, 1 Oct 2025 11:33:22 +0000 (13:33 +0200)] 
tool_getparam: warn if provided header looks malformed

URL: https://fosstodon.org/@galdor/115298664084113519
Closes #18793

2 months agotidy-up: LibreSSL Git repository URLs and local CI builds
Viktor Szakats [Wed, 1 Oct 2025 10:12:30 +0000 (12:12 +0200)] 
tidy-up: LibreSSL Git repository URLs and local CI builds

Also:
- point the source tarball to a working URL.
  The GitHub release page misses the official source tarball for 4.1.1.
- GHA/linux: switch LibreSSL build to cmake (syncing with http3-linux.)
- GHA/macos: drop no longer needed LibreSSL build workaround.

Closes #18792

2 months agoGHA: update dependency libressl/portable to v4.1.1
renovate[bot] [Wed, 1 Oct 2025 01:37:23 +0000 (01:37 +0000)] 
GHA: update dependency libressl/portable to v4.1.1

Closes #18785
Closes #18786

2 months agowcurl: import v2025.09.27
Samuel Henrique [Sat, 27 Sep 2025 08:42:08 +0000 (09:42 +0100)] 
wcurl: import v2025.09.27

Closes #18754

2 months agoRELEASE-NOTES: synced
Daniel Stenberg [Wed, 1 Oct 2025 07:12:10 +0000 (09:12 +0200)] 
RELEASE-NOTES: synced

2 months agotypos.toml: exclude more from typo checks
Daniel Stenberg [Wed, 1 Oct 2025 06:19:35 +0000 (08:19 +0200)] 
typos.toml: exclude more from typo checks

- exclude visual studio project templates
- exclude test cases
- allow 'proxys' which is used for "secure proxy" in test code
- allow Tru64 and secur32

Closes #18789

2 months agoTODO: fix a typo
Daniel Stenberg [Wed, 1 Oct 2025 06:16:45 +0000 (08:16 +0200)] 
TODO: fix a typo

Closes #18788

2 months agoip-happy: do not set unnecessary timeout
Stefan Eissing [Mon, 29 Sep 2025 14:38:55 +0000 (16:38 +0200)] 
ip-happy: do not set unnecessary timeout

When attempts on all addresses have been started, do no longer set any
EXPIRE_HAPPY_EYEBALLS timeouts.

Fixes #18767
Reported-by: Johannes Schindelin
Closes #18768

2 months agoasyn-thrdd resolver: clear timeout when done
Stefan Eissing [Mon, 29 Sep 2025 14:44:35 +0000 (16:44 +0200)] 
asyn-thrdd resolver: clear timeout when done

When the async threaded resolver thread returned, clear the
started EXPIRE_ASYNC_NAME timeout.

Closes #18769

2 months agotidy-up: `fcntl.h` includes
Viktor Szakats [Tue, 30 Sep 2025 16:17:52 +0000 (18:17 +0200)] 
tidy-up: `fcntl.h` includes

- drop from source files without obvious users.
- include in `curlx/fopen.h` also for Windows.

Follow-up to 9678ff5b1bfea1c847aee4f9edf023e8f01c9293 #18776

Closes #18782

2 months agoGHA: update dependency openssl/openssl to v3.5.4
renovate[bot] [Tue, 30 Sep 2025 14:31:06 +0000 (14:31 +0000)] 
GHA: update dependency openssl/openssl to v3.5.4

Closes #18781

2 months agobuild: avoid overriding system `open` and `stat` symbols
Viktor Szakats [Mon, 29 Sep 2025 23:27:10 +0000 (01:27 +0200)] 
build: avoid overriding system `open` and `stat` symbols

Replace them by `curlx_open()` and `curlx_stat()`.

To make it obvious in the source code what is being executed.

Also:
- tests/server: stop overriding `open()` for test servers.
  This is critical for the call made from the signal handler.
  For other calls, it's an option to use `curlx_open()`, but
  doesn't look important enough to do it, following the path
  taken with `fopen()`.

Follow-up to 10bac43b873fe45869e15b36aac1c1e5bc89b6e0 #18774
Follow-up to 20142f5d06f7120ba94cbcc25c998e8d81aec85b #18634
Follow-up to bf7375ecc50e857760b0d0a668c436e208a400bd #18503

Closes #18776

2 months agochecksrc: catch banned functions when preceded by `(`
Viktor Szakats [Tue, 30 Sep 2025 10:47:01 +0000 (12:47 +0200)] 
checksrc: catch banned functions when preceded by `(`

Also add a test case.

Closes #18779

2 months agoexamples: fix two more cases of `stat()` TOCTOU
Viktor Szakats [Tue, 30 Sep 2025 09:41:11 +0000 (11:41 +0200)] 
examples: fix two more cases of `stat()` TOCTOU

Also:
- ftpupload: bump an intermediate variable size.

Follow-up to f13250edf11312ab8c0425cf39b182a31b53c6f7 #18605

Closes #18778

2 months agoDockerfile: update debian:bookworm-slim digest to 7e49091
renovate[bot] [Tue, 30 Sep 2025 01:14:11 +0000 (01:14 +0000)] 
Dockerfile: update debian:bookworm-slim digest to 7e49091

Closes #18777

2 months agochecksrc: fix possible endless loop when detecting `BANNEDFUNC`
Viktor Szakats [Mon, 29 Sep 2025 23:46:33 +0000 (01:46 +0200)] 
checksrc: fix possible endless loop when detecting `BANNEDFUNC`

If the source line had square brackets before the match, the stripping
of the banned function left the original line intact, and repeated the
check on it forever. E.g. with banned function `open` in `lib518.c`:
```c
t518_testfd[0] = open(DEV_NULL, O_RDONLY);
```

Closes #18775

2 months agobuild: avoid overriding system symbols for fopen functions
Viktor Szakats [Sun, 14 Sep 2025 13:34:18 +0000 (15:34 +0200)] 
build: avoid overriding system symbols for fopen functions

By introducing wrappers for them in the curlx namespace:
`curlx_fopen()`, `curlx_fdopen()`, `curlx_fclose()`.

The undefine/redefine/`(function)()` methods broke on systems
implementing these functions as macros. E.g. AIX 32-bit's `fopen()`.

Also:
- rename `lib/fopen.*` to `lib/curl_fopen.*` (for `Curl_fopen()`)
  to make room for the newly added `curlx/fopen.h`.
- curlx: move file-related functions from `multibyte.c` to `fopen.c`.
- tests/server: stop using the curl-specific `fopen()` implementation
  on Windows. Unicode isn't used by runtests, and it isn't critical to
  run tests on longs path. It can be re-enabled if this becomes
  necessary, or if the wrapper receives a feature that's critical for
  test servers.

Reported-by: Andrew Kirillov
Bug: https://github.com/curl/curl/issues/18510#issuecomment-3274393640

Follow-up to bf7375ecc50e857760b0d0a668c436e208a400bd #18503
Follow-up to 9863599d69b79d290928a89bf9160f4e4e023d4e #18502
Follow-up to 3bb5e58c105d7be450b667858d1b8e7ae3ded555 #17827

Closes #18634

2 months agotests/server: drop unsafe `open()` override in signal handler (Windows)
Viktor Szakats [Mon, 29 Sep 2025 20:48:55 +0000 (22:48 +0200)] 
tests/server: drop unsafe `open()` override in signal handler (Windows)

Turns out the signal handler on Windows still wasn't signal safe after
the previous round of fix. There is an `open()` call made from there,
and `open` happens to be unconditionally overridden via `curl_setup.h`
on Windows, to its local implementation (`curlx_win32_open()`), which
does memory allocations and potentially other things that are not signal
safe.

This is a temporary fix, till avoiding the override of system symbols
`open` and `stat` on Windows.

FTR this did not fix the CI 2304 errors, diskspace fail or job hangs due
to 0xC0000142 fork failure (it's rare all three occurs in the same run):
https://github.com/curl/curl/actions/runs/18110523584?pr=18774

Ref: #18634
Follow-up e95f509c66abdd88ae02e3243cdc217f19c4a330 #16852
Closes #18774

2 months agocmake: use more `COMPILER_OPTIONS`, `LINK_OPTIONS` / `LINK_FLAGS`
Viktor Szakats [Sun, 28 Sep 2025 00:34:13 +0000 (02:34 +0200)] 
cmake: use more `COMPILER_OPTIONS`, `LINK_OPTIONS` / `LINK_FLAGS`

- replace `COMPILE_FLAGS` with `COMPILE_OPTIONS` that superceded it.

  Follow-up to 6140dfcf3e7845f11dee755de6865379aa96dab7
  https://cmake.org/cmake/help/v4.1/prop_sf/COMPILE_FLAGS.html

- replace `target_link_libraries()` with `LINK_FLAGS` property for
  CMake <=3.12, because we are passing linker options (not libs).

  Follow-up to 91720b620e802748d2e1629f43e29b76736542f9 #18468
  Follow-up to 548873921cde197aa1d40216c594c76738031374 #17670
  Follow-up to 95aea798dbd785c4daee2b2e24f2c8c94f3e3cf4 #5843
  https://cmake.org/cmake/help/v3.7/command/target_link_libraries.html
  https://cmake.org/cmake/help/v3.7/prop_tgt/LINK_FLAGS.html

- replace `target_link_options()` with `LINK_OPTIONS` propery for
  CMake 3.13+, to use the modern style.

  Follow-up to 91720b620e802748d2e1629f43e29b76736542f9 #18468
  Follow-up to 548873921cde197aa1d40216c594c76738031374 #17670
  https://cmake.org/cmake/help/v3.13/command/target_link_options.html
  https://cmake.org/cmake/help/v3.13/prop_tgt/LINK_OPTIONS.html

Also:

- fix to append to, not override, previously set linker options when
  using `CURL_LIBCURL_VERSIONED_SYMBOLS=ON`. Before this patch, it was
  overwriting linker options when using `CURL_CODE_COVERAGE=ON`.

  Follow-up to 91720b620e802748d2e1629f43e29b76736542f9 #18468

Closes #18762

2 months agoGHA/linux-old: make one cmake v3.7.2 job verbose
Viktor Szakats [Sun, 28 Sep 2025 09:54:57 +0000 (11:54 +0200)] 
GHA/linux-old: make one cmake v3.7.2 job verbose

To show the details in cmake builds using the oldest supported version.
Use a legacy method. `--verbose` became supported later, in 3.14.

Closes #18764

2 months agoCI: make pip use `tests/requirements.txt` in Circle CI
Viktor Szakats [Sat, 27 Sep 2025 22:32:49 +0000 (00:32 +0200)] 
CI: make pip use `tests/requirements.txt` in Circle CI

Also sync `pip` options with those used in GHA.

Closes #18760

2 months agoci: use `--enable-option-checking=fatal` in autotools jobs
Viktor Szakats [Sat, 27 Sep 2025 21:51:46 +0000 (23:51 +0200)] 
ci: use `--enable-option-checking=fatal` in autotools jobs

To avoid typos and non-existing options passed to `./configure` in CI
builds.

Also delete obsolete option `--enable-test-bundles` from Circle CI jobs.

Closes #18759

2 months agoGHA/windows: tidy up Cygwin jobs
Viktor Szakats [Sat, 27 Sep 2025 15:58:29 +0000 (17:58 +0200)] 
GHA/windows: tidy up Cygwin jobs

- drop unnecessary installed packages.
- sync built type name with other jobs.

Closes #18758

2 months agoGHA: update dependency awslabs/aws-lc to v1.61.4
renovate[bot] [Fri, 26 Sep 2025 21:53:21 +0000 (21:53 +0000)] 
GHA: update dependency awslabs/aws-lc to v1.61.4

Closes #18752

2 months agoGHA/linux: tidy up AWS-LC local build
Viktor Szakats [Sat, 27 Sep 2025 11:02:12 +0000 (13:02 +0200)] 
GHA/linux: tidy up AWS-LC local build

To sync with other builds and to use `-B` to avoid a cmake warning and
future breakage.

Closes #18757

2 months agotidy-up: miscellaneous
Viktor Szakats [Tue, 16 Sep 2025 17:28:27 +0000 (19:28 +0200)] 
tidy-up: miscellaneous

- GHA/checkdocs: rename `spellcheck` job to `pyspelling` to say
  the exact tool used.
- GHA/checkdocs: restore a comment.
- GHA/linux: add `-B .` to a cmake configure to avoid warning, and
  future breakage.
- autotools: use correct casing for `Schannel`.
- doh: update RFC URL.
- drop redundant parenthesis.
- fix indentation, whitespace.

Closes #18756

2 months agoperlcheck: parallelize
Viktor Szakats [Fri, 26 Sep 2025 18:57:16 +0000 (20:57 +0200)] 
perlcheck: parallelize

Follow-up to 34b1e146e42f2dbac5c89414a2a0458a8729a255 #18745

Closes #18750

2 months agocf-ip-happy: mention unix domain path, not port number
Daniel Stenberg [Fri, 26 Sep 2025 14:30:34 +0000 (16:30 +0200)] 
cf-ip-happy: mention unix domain path, not port number

In the connect error message if a unix domain socket was used.

Reported-by: kuchara on github
Ref: #18748
Closes #18749

2 months agoperlcheck: add script, run in CI, fix fallouts
Viktor Szakats [Wed, 24 Sep 2025 23:54:28 +0000 (01:54 +0200)] 
perlcheck: add script, run in CI, fix fallouts

Add script to run all Perl sources through `perl -c` to ensure no
issues, and run this script via GHA/checksrc in CI.

Fallouts:
- fix two repeated declarations.
- move `shell_quote()` from `testutil.pm` to `pathhelp.pm`, to
  avoid circular dependency in `globalconfig.pm`.

Closes #18745

2 months agoopenldap: check ber_sockbuf_add_io() return code
Daniel Stenberg [Fri, 26 Sep 2025 11:53:04 +0000 (13:53 +0200)] 
openldap: check ber_sockbuf_add_io() return code

The man page says nothing about what the return code means but Howard
Chu tells me it is 0 on success, -1 on fail.

Help-by: Howard Chu
Closes #18747

2 months agotool_progress: handle possible integer overflows
Daniel Stenberg [Fri, 26 Sep 2025 07:43:19 +0000 (09:43 +0200)] 
tool_progress: handle possible integer overflows

The progress meters max out at 2^63 bytes.

Reported-by: BobodevMm on github
Fixes #18744
Closes #18746

2 months agohttp: handle user-defined connection headers
Stefan Eissing [Mon, 22 Sep 2025 13:48:07 +0000 (15:48 +0200)] 
http: handle user-defined connection headers

When there is more than one user-supplied 'Connection: ' header, add
values that curl needs internally to the first one and emit all
subsequent ones thereafter.

Fixes #18662
Reported-by: Evgeny Grin (Karlson2k)
Closes #18686

2 months agoRELEASE-NOTES: synced
Daniel Stenberg [Thu, 25 Sep 2025 21:35:31 +0000 (23:35 +0200)] 
RELEASE-NOTES: synced

2 months agoopenssl: fail the transfer if ossl_certchain() fails
Daniel Stenberg [Sat, 20 Sep 2025 20:32:23 +0000 (22:32 +0200)] 
openssl: fail the transfer if ossl_certchain() fails

Since it would indicate errors to the degree that continuing would just
risk hiding the earlier errors or make things weird.

Inspired by a report in Joshua's sarif data

Closes #18646

2 months agoGHA: update dependency ruff and github/codeql-action
renovate[bot] [Thu, 25 Sep 2025 15:03:08 +0000 (15:03 +0000)] 
GHA: update dependency ruff and github/codeql-action

- update github/codeql-action digest to 303c0ae
- update dependency ruff to v0.13.2

Closes #18716
Closes #18734