Skip to content

Commit e97e32a

Browse files
Sync with upstream (excluding workflows)
2 parents 7322388 + 51f5d30 commit e97e32a

19 files changed

Lines changed: 352 additions & 230 deletions

RELEASE-NOTES

Lines changed: 78 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ curl and libcurl 8.18.0
44
Command line options: 273
55
curl_easy_setopt() options: 308
66
Public functions in libcurl: 100
7-
Contributors: 3541
7+
Contributors: 3546
88

99
This release includes the following changes:
1010

@@ -15,63 +15,90 @@ This release includes the following changes:
1515
This release includes the following bugfixes:
1616

1717
o _PROGRESS.md: add the E unit, mention kibibyte [24]
18+
o AmigaOS: increase minimum stack size for tool_main [137]
1819
o asyn-thrdd: release rrname if ares_init_options fails [41]
1920
o autotools: drop autoconf <2.59 compatibility code (zz60-xc-ovr) [70]
21+
o badwords: fix issues found in scripts and other files [142]
22+
o badwords: fix issues found in tests [156]
23+
o build: exclude clang prereleases from compiler warning options [154]
24+
o build: tidy-up MSVC CRT warning suppression macros [140]
2025
o ccsidcurl: make curl_mime_data_ccsid() use the converted size [74]
2126
o cf-https-connect: allocate ctx at first in cf_hc_create() [79]
27+
o cf-socket: limit use of `TCP_KEEP*` to Windows 10.0.16299+ at runtime [157]
2228
o cf-socket: trace ignored errors [97]
2329
o checksrc.pl: detect assign followed by more than one space [26]
2430
o cmake: adjust defaults for target platforms not supporting shared libs [35]
2531
o cmake: disable `CURL_CA_PATH` auto-detection if `USE_APPLE_SECTRUST=ON` [16]
32+
o cmake: honor `CURL_DISABLE_INSTALL` and `CURL_ENABLE_EXPORT_TARGET` [106]
2633
o code: minor indent fixes before closing braces [107]
2734
o config2setopts: bail out if curl_url_get() returns OOM [102]
2835
o config2setopts: exit if curl_url_set() fails on OOM [105]
2936
o conncache: silence `-Wnull-dereference` on gcc 14 RISC-V 64 [17]
3037
o connect: reshuffle Curl_timeleft_ms to avoid 'redundant condition' [100]
3138
o cookie: propagate errors better, cleanup the internal API [118]
39+
o cookie: return error on OOM [131]
3240
o cshutdn: acknowledge FD_SETSIZE for shutdown descriptors [25]
3341
o curl: fix progress meter in parallel mode [15]
42+
o curl_sasl: make Curl_sasl_decode_mech compare case insensitively [160]
43+
o curl_setup.h: document more funcs flagged by `_CRT_SECURE_NO_WARNINGS` [124]
3444
o curl_setup.h: drop stray `#undef stat` (Windows) [103]
3545
o CURLINFO: remove 'get' and 'get the' from each short desc [50]
3646
o CURLINFO_SCHEME/PROTOCOL: they return the "scheme" for a "transfer" [48]
3747
o CURLINFO_TLS_SSL_PTR.md: remove CURLINFO_TLS_SESSION text [49]
3848
o CURLOPT_READFUNCTION.md: clarify the size of the buffer [47]
3949
o CURLOPT_SSH_KEYFUNCTION.md: fix minor indent mistake in example
50+
o digest_sspi: fix a memory leak on error path [149]
4051
o digest_sspi: properly free sspi identity [12]
52+
o DISTROS.md: add OpenBSD [126]
4153
o docs: fix checksrc `EQUALSPACE` warnings [21]
4254
o docs: mention umask need when curl creates files [56]
4355
o examples/crawler: fix variable [92]
4456
o examples/multithread: fix race condition [101]
57+
o examples: make functions/data static where missing [139]
58+
o examples: tidy-up headers and includes [138]
4559
o ftp: refactor a piece of code by merging the repeated part [40]
4660
o ftp: remove #ifdef for define that is always defined [76]
4761
o getinfo: improve perf in debug mode [99]
4862
o gnutls: report accurate error when TLS-SRP is not built-in [18]
4963
o gtls: add return checks and optimize the code [2]
5064
o gtls: skip session resumption when verifystatus is set
65+
o h2/h3: handle methods with spaces [146]
5166
o hostip: don't store negative lookup on OOM [61]
67+
o hsts: propagate and error out correctly on OOM [130]
68+
o http: avoid two strdup()s and do minor simplifications [144]
69+
o http: error on OOM when creating range header [59]
5270
o http: replace atoi use in Curl_http_follow with curlx_str_number [65]
71+
o http: the :authority header should never contain user+password [147]
5372
o INSTALL-CMAKE.md: document static option defaults more [37]
5473
o krb5_sspi: unify a part of error handling [80]
5574
o lib: cleanup for some typos about spaces and code style [3]
5675
o lib: eliminate size_t casts [112]
76+
o lib: error for OOM when extracting URL query [127]
5777
o lib: fix gssapi.h include on IBMi [55]
5878
o lib: refactor the type of funcs which have useless return and checks [1]
59-
o libtests: replace `atoi()` with `curlx_str_number()` [120]
79+
o libssh2: add paths to error messages for quote commands [114]
6080
o libssh2: cleanup ssh_force_knownhost_key_type [64]
6181
o libssh2: replace atoi() in ssh_force_knownhost_key_type [63]
82+
o libssh: properly free sftp_attributes [153]
83+
o libtests: replace `atoi()` with `curlx_str_number()` [120]
6284
o limit-rate: add example using --limit-rate and --max-time together [89]
6385
o m4/sectrust: fix test(1) operator [4]
6486
o mbedtls: fix potential use of uninitialized `nread` [8]
6587
o mk-ca-bundle.pl: default to SHA256 fingerprints with `-t` option [73]
6688
o mk-ca-bundle.pl: use `open()` with argument list to replace backticks [71]
6789
o mqtt: reject overly big messages [39]
6890
o noproxy: replace atoi with curlx_str_number [67]
91+
o openssl: exit properly on OOM when getting certchain [133]
92+
o openssl: fix a potential memory leak of bio_out [150]
93+
o openssl: fix a potential memory leak of params.cert [151]
6994
o openssl: release ssl_session if sess_reuse_cb fails [43]
7095
o openssl: remove code handling default version [28]
7196
o OS400/ccsidcurl: fix curl_easy_setopt_ccsid for non-converted blobs [94]
7297
o OS400/makefile.sh: fix shellcheck warning SC2038 [86]
7398
o osslq: code readability [5]
7499
o progress: show fewer digits [78]
100+
o projects/README.md: Markdown fixes [148]
101+
o pytest fixes and improvements [159]
75102
o pytest: skip H2 tests if feature missing from curl [46]
76103
o rtmp: fix double-free on URL parse errors [27]
77104
o rtmp: precaution for a potential integer truncation [54]
@@ -81,13 +108,15 @@ This release includes the following bugfixes:
81108
o rustls: minor adjustment of sizeof() [38]
82109
o schannel: fix memory leak of cert_store_path on four error paths [23]
83110
o schannel: replace atoi() with curlx_str_number() [119]
111+
o schannel_verify: fix a memory leak of cert_context [152]
84112
o scripts: fix shellcheck SC2046 warnings [90]
85113
o scripts: use end-of-options marker in `find -exec` commands [87]
86114
o setopt: disable CURLOPT_HAPROXY_CLIENT_IP on NULL [30]
87115
o setopt: when setting bad protocols, don't store them [9]
88116
o sftp: fix range downloads in both SSH backends [82]
89117
o socks_sspi: use free() not FreeContextBuffer() [93]
90118
o telnet: replace atoi for BINARY handling with curlx_str_number [66]
119+
o TEST-SUITE.md: correct the man page's path [136]
91120
o test07_22: fix flakiness [95]
92121
o test2045: replace HTML multi-line comment markup with `#` comments [36]
93122
o test363: delete stray character (typo) from a section tag [52]
@@ -96,13 +125,18 @@ This release includes the following bugfixes:
96125
o tests/server: do not fall back to original data file in `test2fopen()` [32]
97126
o tests/server: replace `atoi()` and `atol()` with `curlx_str_number()` [110]
98127
o tftp: release filename if conn_get_remote_addr fails [42]
128+
o tidy-up: move `CURL_UNCONST()` out from macro `curl_unicodefree()` [121]
99129
o tool: consider (some) curl_easy_setopt errors fatal [7]
130+
o tool_cfgable: free ssl-sessions at exit [123]
131+
o tool_getparam: verify that a file exists for some options [134]
100132
o tool_help: add checks to avoid unsigned wrap around [14]
101133
o tool_ipfs: check return codes better [20]
102134
o tool_operate: exit on curl_share_setopt errors [108]
103135
o tool_operate: remove redundant condition [19]
104136
o tool_operate: use curlx_str_number instead of atoi [68]
105137
o tool_paramhlp: refuse --proto remove all protocols [10]
138+
o tool_urlglob: clean up used memory on errors better [44]
139+
o url: if OOM in parse_proxy() return error [132]
106140
o urlapi: fix mem-leaks in curl_url_get error paths [22]
107141
o verify-release: update to avoid shellcheck warning SC2034 [88]
108142
o vquic-tls/gnutls: call Curl_gtls_verifyserver unconditionally [96]
@@ -134,13 +168,14 @@ Planned upcoming removals include:
134168
This release would not have looked like this without help, code, reports and
135169
advice from friends like these:
136170

137-
Aleksandr Sergeev, Andrew Kirillov, Brad King, Dan Fandrich, Daniel McCarney,
138-
Daniel Stenberg, Fd929c2CE5fA on github, Gisle Vanem, Jiyong Yang,
139-
Juliusz Sosinowicz, Leonardo Taccari, nait-furry, Nick Korepanov,
140-
Patrick Monnerat, pelioro on hackerone, Ray Satiro, renovate[bot],
141-
Samuel Henrique, Stanislav Fort, Stefan Eissing, Thomas Klausner,
142-
Viktor Szakats, Xiaoke Wang
143-
(23 contributors)
171+
Aleksandr Sergeev, Andrew Kirillov, boingball, Brad King, Christian Schmitz,
172+
Dan Fandrich, Daniel McCarney, Daniel Stenberg, Fd929c2CE5fA on github,
173+
Gisle Vanem, Jiyong Yang, Juliusz Sosinowicz, Leonardo Taccari,
174+
letshack9707 on hackerone, Marcel Raad, nait-furry, Nick Korepanov,
175+
Omdahake on github, Patrick Monnerat, pelioro on hackerone, Ray Satiro,
176+
renovate[bot], Samuel Henrique, Stanislav Fort, Stefan Eissing,
177+
Thomas Klausner, Viktor Szakats, Wesley Moore, Xiaoke Wang
178+
(29 contributors)
144179

145180
References to bug reports and discussions on issues:
146181

@@ -185,6 +220,7 @@ References to bug reports and discussions on issues:
185220
[41] = https://curl.se/bug/?i=19410
186221
[42] = https://curl.se/bug/?i=19409
187222
[43] = https://curl.se/bug/?i=19405
223+
[44] = https://curl.se/bug/?i=19614
188224
[45] = https://curl.se/bug/?i=19544
189225
[46] = https://curl.se/bug/?i=19412
190226
[47] = https://curl.se/bug/?i=19402
@@ -197,6 +233,7 @@ References to bug reports and discussions on issues:
197233
[54] = https://curl.se/bug/?i=19399
198234
[55] = https://curl.se/bug/?i=19336
199235
[56] = https://curl.se/bug/?i=19396
236+
[59] = https://curl.se/bug/?i=19630
200237
[60] = https://curl.se/bug/?i=18330
201238
[61] = https://curl.se/bug/?i=19484
202239
[62] = https://curl.se/bug/?i=17931
@@ -237,11 +274,43 @@ References to bug reports and discussions on issues:
237274
[102] = https://curl.se/bug/?i=19518
238275
[103] = https://curl.se/bug/?i=19519
239276
[105] = https://curl.se/bug/?i=19517
277+
[106] = https://curl.se/bug/?i=19144
240278
[107] = https://curl.se/bug/?i=19512
241279
[108] = https://curl.se/bug/?i=19513
242280
[110] = https://curl.se/bug/?i=19510
243281
[111] = https://curl.se/bug/?i=19509
244282
[112] = https://curl.se/bug/?i=19495
283+
[114] = https://curl.se/bug/?i=19605
245284
[118] = https://curl.se/bug/?i=19493
246285
[119] = https://curl.se/bug/?i=19483
247286
[120] = https://curl.se/bug/?i=19506
287+
[121] = https://curl.se/bug/?i=19606
288+
[123] = https://curl.se/bug/?i=19602
289+
[124] = https://curl.se/bug/?i=19597
290+
[126] = https://curl.se/bug/?i=19596
291+
[127] = https://curl.se/bug/?i=19594
292+
[130] = https://curl.se/bug/?i=19593
293+
[131] = https://curl.se/bug/?i=19591
294+
[132] = https://curl.se/bug/?i=19590
295+
[133] = https://curl.se/bug/?i=19471
296+
[134] = https://curl.se/bug/?i=19583
297+
[136] = https://curl.se/bug/?i=19586
298+
[137] = https://curl.se/bug/?i=19578
299+
[138] = https://curl.se/bug/?i=19580
300+
[139] = https://curl.se/bug/?i=19579
301+
[140] = https://curl.se/bug/?i=19175
302+
[142] = https://curl.se/bug/?i=19572
303+
[144] = https://curl.se/bug/?i=19571
304+
[146] = https://curl.se/bug/?i=19543
305+
[147] = https://curl.se/bug/?i=19568
306+
[148] = https://curl.se/bug/?i=19569
307+
[149] = https://curl.se/bug/?i=19567
308+
[150] = https://curl.se/bug/?i=19561
309+
[151] = https://curl.se/bug/?i=19560
310+
[152] = https://curl.se/bug/?i=19556
311+
[153] = https://curl.se/bug/?i=19564
312+
[154] = https://curl.se/bug/?i=19566
313+
[156] = https://curl.se/bug/?i=19541
314+
[157] = https://curl.se/bug/?i=19520
315+
[159] = https://curl.se/bug/?i=19540
316+
[160] = https://curl.se/bug/?i=19535

docs/INTERNALS.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,19 @@ versions of libs and build tools.
2424

2525
We aim to support these or later versions.
2626

27-
- OpenSSL 3.0.0
28-
- LibreSSL 2.9.1
29-
- GnuTLS 3.1.10
30-
- mbedTLS 3.2.0
31-
- zlib 1.2.5.2
32-
- libssh2 1.9.0
33-
- c-ares 1.6.0
34-
- libssh 0.9.0
35-
- libidn2 2.0.0
36-
- wolfSSL 3.4.6
37-
- OpenLDAP 2.0
38-
- MIT Kerberos 1.3
39-
- nghttp2 1.15.0
27+
- OpenSSL 3.0.0 (2021-09-07)
28+
- LibreSSL 2.9.1 (2019-04-22)
29+
- GnuTLS 3.1.10 (2013-03-22)
30+
- mbedTLS 3.2.0 (2022-07-11)
31+
- zlib 1.2.5.2 (2011-12-11)
32+
- libssh2 1.9.0 (2019-06-20)
33+
- c-ares 1.6.0 (2008-12-09)
34+
- libssh 0.9.0 (2019-06-28)
35+
- libidn2 2.0.0 (2017-03-29)
36+
- wolfSSL 3.4.6 (2017-09-22)
37+
- OpenLDAP 2.0 (2000-08-01)
38+
- MIT Kerberos 1.3 (2003-07-31)
39+
- nghttp2 1.15.0 (2016-09-25)
4040

4141
## Build tools
4242

lib/altsvc.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,8 @@ static struct altsvc *altsvc_create(struct Curl_str *srchost,
136136
size_t srcport,
137137
size_t dstport)
138138
{
139-
enum alpnid dstalpnid =
140-
Curl_alpn2alpnid(curlx_str(dstalpn), curlx_strlen(dstalpn));
141-
enum alpnid srcalpnid =
142-
Curl_alpn2alpnid(curlx_str(srcalpn), curlx_strlen(srcalpn));
139+
enum alpnid dstalpnid = Curl_str2alpnid(dstalpn);
140+
enum alpnid srcalpnid = Curl_str2alpnid(srcalpn);
143141
if(!srcalpnid || !dstalpnid)
144142
return NULL;
145143
return altsvc_createid(curlx_str(srchost), curlx_strlen(srchost),
@@ -545,8 +543,7 @@ CURLcode Curl_altsvc_parse(struct Curl_easy *data,
545543
do {
546544
if(!curlx_str_single(&p, '=')) {
547545
/* [protocol]="[host][:port], [protocol]="[host][:port]" */
548-
enum alpnid dstalpnid =
549-
Curl_alpn2alpnid(curlx_str(&alpn), curlx_strlen(&alpn));
546+
enum alpnid dstalpnid = Curl_str2alpnid(&alpn);
550547
if(!curlx_str_single(&p, '\"')) {
551548
struct Curl_str dsthost;
552549
curl_off_t port = 0;

lib/cf-h2-proxy.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
#include "multiif.h"
4343
#include "sendf.h"
4444
#include "select.h"
45+
#include "curlx/warnless.h"
4546
#include "cf-h2-proxy.h"
4647

4748
/* The last 2 #include files should be in this order */
@@ -408,32 +409,30 @@ static CURLcode proxy_h2_nw_out_flush(struct Curl_cfilter *cf,
408409
* This function returns 0 if it succeeds, or -1 and error code will
409410
* be assigned to *err.
410411
*/
411-
static int proxy_h2_process_pending_input(struct Curl_cfilter *cf,
412-
struct Curl_easy *data,
413-
CURLcode *err)
412+
static CURLcode proxy_h2_process_pending_input(struct Curl_cfilter *cf,
413+
struct Curl_easy *data)
414414
{
415415
struct cf_h2_proxy_ctx *ctx = cf->ctx;
416416
const unsigned char *buf;
417-
size_t blen;
417+
size_t blen, nread;
418418
ssize_t rv;
419419

420420
while(Curl_bufq_peek(&ctx->inbufq, &buf, &blen)) {
421421

422422
rv = nghttp2_session_mem_recv(ctx->h2, (const uint8_t *)buf, blen);
423423
CURL_TRC_CF(data, cf, "[0] %zu bytes to nghttp2 -> %zd", blen, rv);
424-
if(rv < 0) {
424+
if(!curlx_sztouz(rv, &nread)) {
425425
failf(data,
426426
"process_pending_input: nghttp2_session_mem_recv() returned "
427427
"%zd:%s", rv, nghttp2_strerror((int)rv));
428-
*err = CURLE_RECV_ERROR;
429-
return -1;
428+
return CURLE_RECV_ERROR;
430429
}
431-
else if(!rv) {
430+
else if(!nread) {
432431
/* nghttp2 does not want to process more, but has no error. This
433432
* probably cannot happen, but be safe. */
434433
break;
435434
}
436-
Curl_bufq_skip(&ctx->inbufq, (size_t)rv);
435+
Curl_bufq_skip(&ctx->inbufq, nread);
437436
if(Curl_bufq_is_empty(&ctx->inbufq)) {
438437
CURL_TRC_CF(data, cf, "[0] all data in connection buffer processed");
439438
break;
@@ -443,8 +442,7 @@ static int proxy_h2_process_pending_input(struct Curl_cfilter *cf,
443442
"in connection buffer", Curl_bufq_len(&ctx->inbufq));
444443
}
445444
}
446-
447-
return 0;
445+
return CURLE_OK;
448446
}
449447

450448
static CURLcode proxy_h2_progress_ingress(struct Curl_cfilter *cf,
@@ -458,7 +456,8 @@ static CURLcode proxy_h2_progress_ingress(struct Curl_cfilter *cf,
458456
if(!Curl_bufq_is_empty(&ctx->inbufq)) {
459457
CURL_TRC_CF(data, cf, "[0] process %zu bytes in connection buffer",
460458
Curl_bufq_len(&ctx->inbufq));
461-
if(proxy_h2_process_pending_input(cf, data, &result) < 0)
459+
result = proxy_h2_process_pending_input(cf, data);
460+
if(result)
462461
return result;
463462
}
464463

@@ -484,7 +483,8 @@ static CURLcode proxy_h2_progress_ingress(struct Curl_cfilter *cf,
484483
break;
485484
}
486485

487-
if(proxy_h2_process_pending_input(cf, data, &result))
486+
result = proxy_h2_process_pending_input(cf, data);
487+
if(result)
488488
return result;
489489
}
490490

@@ -1483,7 +1483,7 @@ static bool proxy_h2_connisalive(struct Curl_cfilter *cf,
14831483
*input_pending = FALSE;
14841484
result = Curl_cf_recv_bufq(cf->next, data, &ctx->inbufq, 0, &nread);
14851485
if(!result) {
1486-
if(proxy_h2_process_pending_input(cf, data, &result) < 0)
1486+
if(proxy_h2_process_pending_input(cf, data))
14871487
/* immediate error, considered dead */
14881488
alive = FALSE;
14891489
else {

0 commit comments

Comments
 (0)