Commit Graph

37434 Commits

Author SHA1 Message Date
Stuart Henderson
c257831471 CHANGES: fix typo in filename
Closes #20137
2026-01-01 12:20:10 +01:00
Daniel Stenberg
c7b26b6679 tool_paramhlp: simplify number parsing
Closes #20134
2026-01-01 12:15:34 +01:00
Viktor Szakats
1ca678472f tests: drop redundant parenthesis from two macro expressions
Closes #20136
2025-12-31 18:49:53 +01:00
Viktor Szakats
e4f4eeb0c5 libssh: fix indent
Closes #20135
2025-12-31 18:49:53 +01:00
Daniel Stenberg
0c278cd586 tool_paramhlp: remove a malloc+free from proto2num()
Closes #20120
2025-12-31 17:59:30 +01:00
Daniel Stenberg
bfa5857c44 test1664: extend with more tests for curlx_str_quotedword
Closes #20123
2025-12-31 17:06:09 +01:00
Viktor Szakats
258521e170 hostip.h: drop redundant setjmp.h include
Already included directly via `hostip.c`, and other header users do not
use it.

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

Cherry-picked from #20106

Closes #20132
2025-12-31 17:00:57 +01:00
Viktor Szakats
352f3f140c tests: include headers only when used
Cherry-picked from #20106

Closes #20131
2025-12-31 17:00:56 +01:00
Viktor Szakats
7ad830bb58 openssl: stop checking for OPENSSL_NO_SHA* macros
Macros have been deleted upstream and never defined in OpenSSL 1.1.0+:
474e469bbd

BoringSSL deleted the last internals uses in 2014:
457112e197

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

Follow-up to 69c89bf3d3 #18330

Closes #20130
2025-12-31 17:00:03 +01:00
Viktor Szakats
0d0ac29cdd openssl: stop checking for OPENSSL_NO_TLSEXT macro
The macro has been deleted upstream and never defined in OpenSSL 1.1.0+:
e481f9b90b

BoringSSL and LibreSSL deleted the last uses in 2014:
6dbd73db5d
7b2f3298f7

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

Follow-up to 69c89bf3d3 #18330

Closes #20129
2025-12-31 16:55:52 +01:00
Viktor Szakats
c7b25e6e82 lib: drop unused or duplicate curlx/timeval.h includes
Note: This patch doesn't aim to add `timeval.h` includes missing from
local headers using `curltime` type. They remain relying on `urldata.h`
being included first. This patch also doesn't delete existing, used
includes already present in local headers (as internal users may rely
on them).

Ref: #20106
Closes #20126
2025-12-31 15:59:19 +01:00
Viktor Szakats
def95e3bbc openssl: fix building against no-ocsp openssl with Apple SecTrust
(Not tested in CI. Regression in 8.17.0.)

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

Follow-up to b4630ed8fa #19308

Closes #20128
2025-12-31 15:51:02 +01:00
Viktor Szakats
be675eeb6d openssl: fix building against no-dsa openssl
(Not tested in CI. Regression within this release cycle.)

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

Follow-up to 833efb437d #19471

Closes #20127
2025-12-31 15:51:01 +01:00
renovate[bot]
ba7e729ffd Dockerfile: update debian:bookworm-slim Docker digest to d5d3f9c
Closes #20115
2025-12-31 12:22:53 +01:00
Yedaya Katsman
660600c747 badwords: add fist -> first, fix fallouts
There are still `curl_fistrgs` in packages/OS400/curl.inc.in but
I'm not sure what that's supposed to be exactly.

Closes #20066
2025-12-31 12:21:42 +01:00
Viktor Szakats
8c02407bef tool_doswin: add debug envs to test filename sanitization failure modes
- `CURL_FN_SANITIZE_BAD=<any-value>` to simulate
  `SANITIZE_ERR_INVALID_PATH`.

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

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

Cherry-picked from #20116
Closes #20125
2025-12-31 12:16:11 +01:00
Daniel Stenberg
37d871af01 tool_getparam: use memdup0() instead of malloc + copy
Closes #20118
2025-12-30 23:53:24 +01:00
trxvorr
f81e7197c1 digest: fix OWS and escaped quote handling
The migration to the strparse API introduced regressions in Digest
authentication parsing where Optional Whitespace (OWS) after commas was
not skipped, and escaped quotes in values were not correctly parsed.

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

Reported-by: herdiyanitdev on hackerone
Closes #20102
2025-12-30 23:22:26 +01:00
Viktor Szakats
5f5e000278 RELEASE-NOTES: codespell 2025-12-30 17:35:00 +01:00
Daniel Stenberg
d6be42eafa delta: fix grep patterns after white space edits
To make the command line option counter work again

Follow-up to 308c347c8b
2025-12-30 14:04:10 +01:00
Daniel Stenberg
8870fd2b87 RELEASE-NOTES: synced 2025-12-30 14:02:03 +01:00
Viktor Szakats
65993d9c5f libcurl-errors: delete stray double quote
Closes #20117
2025-12-30 12:01:05 +01:00
Jay Satiro
1068d048ec tool_doswin: increase allowable length of path sanitizer
- Use 32767-1 instead of PATH_MAX-1 (260-1) as the maximum allowable
  length of a path in Windows.

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

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

Closes https://github.com/curl/curl/pull/20046
2025-12-30 04:00:50 -05:00
Stefan Eissing
52ac8104e1 ratelimit blocking: fix busy loop
Fix the pollset in perform state to not add sockets for directions
that are blocked. This otherwise will lead to busy loops for a
transfer that cannot be progressed.

Reported-by: Fizn-Ahmd on github
Fixes #20091
Closes #20109
2025-12-29 22:44:34 +01:00
Harry Sintonen
16d5f2a566 libssh: require private key or user-agent for public key auth
Closes #20110
2025-12-29 17:28:22 +01:00
Daniel Stenberg
bc9ab557df telnet: abort on bad suboption sequence
Instead of trying to repair.

Reported-by: Huseyin Tintas

Closes #20108
2025-12-29 10:49:30 +01:00
Daniel Stenberg
7fc78c2c1c urlapi: set uncondtional return code
Curl_parse_login_details() can only return a single return code so
adjust accordingly.

Pointed out by CodeSonar

Closes #20107
2025-12-29 10:17:49 +01:00
Daniel Stenberg
2754e0f3d3 url: return error at once when OOM in netrc handling
Closes #20103
2025-12-29 10:16:48 +01:00
Daniel Stenberg
5c0cdd26d6 strcopy: minor comment edit to avoid matching a grep for strcpy use 2025-12-27 23:25:13 +01:00
Daniel Stenberg
6842d4ec4d curl_quiche: refuse headers with CR, LF or null bytes
Also renamed the struct field to 'h1hdr' from 'scratch' to better say
what its purpose is.

Closes #20101
2025-12-27 16:27:11 +01:00
Daniel Stenberg
0e054134b7 urlapi: return OOM correctly from parse_hostname_login()
Closes #20100
2025-12-27 16:25:55 +01:00
Daniel Stenberg
0ccd16d29a ftp: return from ftp_state_use_port immediately on OOM
Closes #20100
2025-12-27 16:25:52 +01:00
Daniel Stenberg
19ca87d4e2 cf-socket: return OOM error if socket() failes due to OOM
Closes #20100
2025-12-27 16:25:38 +01:00
Viktor Szakats
7032982896 tidy-up: miscellaneous
- asyn-thrdd.c: scope an include.
- apply more clang-format suggestions.
- tidy-up PP guard comments.
- delete empty line from the top of headers.
- add empty line after `curl_setup.h` include where missing.
- fix indent.
- CODE_STYLE.md: add `strcpy`.
  Follow-up to 8636ad55df #20088
- lib1901.c: drop unnecessary line.
  Follow-up to 436e67f65b #20076

Closes #20070
rc-8_18_0-3
2025-12-26 22:06:09 +01:00
Daniel Stenberg
abcb10f3ac ftp: return better on OOM in two places
Found with strict torture testing.

Closes #20099
2025-12-26 10:48:41 +01:00
Daniel Stenberg
a585cc35e5 memdebug: stop tracking send and recv
- they rarely catch any problems
- we have other ways to test different send/recv problems
- the number of such calls vary much more per invoke than others, making
  memdebugging harder
- reducing the total number of fallible functions per test is good
- they were not used as intended anyway

Closes #20097
2025-12-26 10:27:27 +01:00
Daniel Stenberg
d4b62bff64 curl_threads: don't do another malloc if the first fails
Closes #20095
2025-12-25 22:14:39 +01:00
Viktor Szakats
685173e881 src: drop unused includes
Also replace some indirect includes with direct ones.

Closes #20096
2025-12-25 18:42:54 +01:00
Daniel Stenberg
ed966832b6 RELEASE-NOTES: synced 2025-12-25 12:13:55 +01:00
Daniel Stenberg
18af4e4e10 cookie: flush better
The cookie flushing (saving to a cookie jar) should only be done if a
transfer has been started. This is now done by checking the
cookies->running field, which is not reset in curl_easy_reset() so the
saving works correctly even after a call to that.

Follow-up to fd6eb8d6e7

Verified by test 1920

Reported-by: Alexander Batischev
Fixes #20090
Closes #20094
2025-12-25 12:05:23 +01:00
Viktor Szakats
e78a466ebd lib: drop unused protocol headers
- drop unused `http.h` includes.
- drop unused `http1.h` include.
- drop unused `http2.h` includes.
- vssh/ssh.h: drop unused `vssh.h` include.
- urldata.h: drop unused protocol includes.
- url: include `smtp.h` directly.
- rtsp.h: include directly where used.
- imap, smtp: drop redundant include, move another from .h to .c.

Verified with an all non-unity CI run.

Closes #20093
2025-12-25 12:00:22 +01:00
Daniel Stenberg
adca486c12 libssh: set both knownhosts options to the same file
Reported-by: Harry Sintonen

Closes #20092
2025-12-25 11:01:41 +01:00
Viktor Szakats
c882439d53 os400sys: replace strcpy() with memcpy()
Source and target are the same size, null-terminator is already present
in the target buffer.

Closes #20089
2025-12-24 23:53:40 +01:00
Daniel Stenberg
ca46112991 curl_ntlm_core: fix DES_* symbols for some wolfSSL builds
Recent wolfSSL with OPENSSL_COEXIST enabled does not provide the DES_*
symbols, so we do.

Reported-by: Daniel Pouzzner
Closes #20083
2025-12-24 22:49:43 +01:00
Daniel Stenberg
76e7d496b6 escape: add a length check in curl_easy_escape
Only accept up to SIZE_MAX/16 input bytes. To avoid overflows, mistakes
and abuse.

Follow-up to 9bfc7f9234

Reported-by: Daniel Santos

Closes #20086
2025-12-24 22:47:26 +01:00
Viktor Szakats
8636ad55df checksrc: ban strcpy
No longer used in the codebase. Replacement is `curlx_strcopy()`, possibly
`memcpy()` or dynbuf.

Also:
- OS400: allow three calls.

Closes #20088
2025-12-24 13:55:25 +01:00
Viktor Szakats
532d134767 build: stop disabling strcpy checks with clang-tidy
Follow-up to 436e67f65b #20076

Closes #20084
2025-12-24 00:02:40 +01:00
Viktor Szakats
436e67f65b tests: replace strcpy() with curlx_strcopy()
Also:
- examples/hsts-preload: apply the same change as it's based on lib1915
  in tests. Make a local clone of `curlx_strcopy()`. Then drop the
  `_CRT_SECURE_NO_WARNINGS` hack, that's no longer necessary.
- curl_setup.h: delete `strcpy()` from the `_CRT_SECURE_NO_WARNINGS`
  list.

Closes #20076
2025-12-23 22:25:39 +01:00
Viktor Szakats
66aec526fc lib547, 555: fix off-by-one null-terminator in read callback
`strcpy()` wrote an unnecessary null-terminator past the available read
buffer.

test551 was also affected because it reuses lib547.

Cherry-picked from #20076
Closes #20082
2025-12-23 19:49:59 +01:00
Daniel Stenberg
7e064d0756 cf-h1-proxy: support folded headers in CONNECT responses
Update test 1941 to verify this

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

Closes #20080
2025-12-23 17:12:14 +01:00