1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-16 14:35:03 -05:00
Commit Graph

27405 Commits

Author SHA1 Message Date
Andrea Pappacoda
4f3828d5a2
cmake: remove libssh2 feature checks
libssh2 features are detected based on version since commit
9dbbba9976

Closes #7343
2021-07-05 22:44:00 +02:00
Daniel Stenberg
e41feede34
test1116: hyper doesn't pass through "surprise-trailers"
Closes #7344
2021-07-05 22:39:42 +02:00
Daniel Stenberg
cffbccd096
socks4: scan for the IPv4 address in resolve results
Follow-up to 84d2839740 which changed the resolving to always resolve
both address families, but since SOCKS4 only supports IPv4 it should
scan for and use the first available IPv4 address.

Reported-by: shithappens2016 on github
Fixes #7345
Closes #7346
2021-07-05 22:38:13 +02:00
Jay Satiro
2b311d369d proto.d: fix formatting for paragraphs after margin changes
Closes https://github.com/curl/curl/pull/7341
2021-07-05 02:55:36 -04:00
Jay Satiro
d352a1bb2b pinnedpubkey.d: fix formatting for version support lists
Closes https://github.com/curl/curl/pull/7340
2021-07-05 02:54:54 -04:00
Daniel Stenberg
0a0bc4a077
TODO: "Support in-memory certs/ca certs/keys" done
Has been suppored for a while now with the *BLOB options.
2021-07-02 10:19:21 +02:00
Daniel Stenberg
a37fc62e8b
examples: safer and more proper read callback logic
The same callback code is used in:

 imap-append.c
 smtp-authzid.c
 smtp-mail.c
 smtp-multi.c
 smtp-ssl.c
 smtp-tls.c

It should not assume that it can copy full lines into the buffer as it
will encourage sloppy coding practices. Instead use byte-wise logic and
check/acknowledge the buffer size appropriately.

Reported-by: Harry Sintonen
Fixes #7330
Closes #7331
2021-07-01 14:27:12 +02:00
Daniel Stenberg
07fa74d34a
test1519: adjusted to work with hyper
Closes #7333
2021-07-01 14:26:06 +02:00
Daniel Stenberg
a80f8ea182
test1518: adjusted to work with hyper
... by making sure the stdout output doesn't look like HTTP headers.

Closes #7333
2021-07-01 14:25:57 +02:00
Daniel Stenberg
7f11282d5f
test1514: add a CRLF to the response to make it correct
Makes hyper accept it fine instead returning HYPERE_UNEXPECTED_EOF on
us.

Closes #7334
2021-07-01 14:19:55 +02:00
Daniel Stenberg
e081048c44
formdata: avoid "Argument cannot be negative" warning
... when converting a curl_off_t to size_t, by using
CURL_ZERO_TERMINATED before passing the argument to the function.

Detected by Coverity CID 1486590.

Closes #7328
Assisted-by: Daniel Gustafsson
2021-07-01 14:15:16 +02:00
Daniel Stenberg
1ff1d9e179
lib: more %u for port and int for %*s fixes
Detected by Coverity

Closes #7329
2021-07-01 09:12:58 +02:00
Daniel Stenberg
6a40e6f8be
doh: (void)-prefix call to curl_easy_setopt 2021-07-01 00:06:27 +02:00
Daniel Stenberg
78fc6522c2
lib: fix type of len passed to *printf's %*s
... it needs to be 'int'. Detected by Coverity CID 1486611 (etc)

Closes #7326
2021-06-30 23:53:58 +02:00
Daniel Stenberg
d696ee00ee
lib: use %u instead of %ld for port number printf
Follow-up to 764c6bd3bf which changed the type of some port number
fields. Detected by Coverity (CID 1486624) etc.

Closes #7325
2021-06-30 23:25:35 +02:00
Daniel Stenberg
63c7668182
version: turn version number functions into returning void
... as we never use the return codes from them.

Reviewed-by: Daniel Gustafsson
Closes #7319
2021-06-30 23:23:34 +02:00
Daniel Stenberg
5372ee37d3
mqtt: extend the error message for no topic
... and mention that it needs URL encoding.

Reported-by: Peter Körner
Fixes #7316
Closes #7317
2021-06-30 15:02:24 +02:00
Daniel Stenberg
e6caaa41b0
formdata: correct typecast in curl_mime_data call
Coverity pointed out it the mismatch. CID 1486590

Closes #7327
2021-06-30 15:00:00 +02:00
Daniel Stenberg
81cc2e48da
url: (void)-prefix a curl_url_get() call
Coverity (CID 1486645) pointed out a use of curl_url_get() in the
parse_proxy function where the return code wasn't checked. A
(void)-prefix makes the intention obvious.

Closes #7320
2021-06-30 14:58:47 +02:00
Daniel Stenberg
8feeafc61a
glob: pass an 'int' as len when using printf's %*s
Detected by Coverity CID 1486629.

Closes #7324
2021-06-30 14:05:56 +02:00
Daniel Stenberg
97fa671a73
vtls: use free() not curl_free()
curl_free() is provided for users of the API to free returned data,
there's no need to use it internally.

Closes #7318
2021-06-30 13:50:18 +02:00
Daniel Stenberg
8ccc066b45
zuul: use the new rustls directory name
Follow-up to 6d972c8b1c which missed updating this directory name.

Also no longer call it crustls in the docs and bump to rusttls-ffi 0.7.1

Closes #7311
2021-06-30 08:19:31 +02:00
Jay Satiro
ca8893468f http: fix crash in rate-limited upload
- Don't set the size of the piece of data to send to the rate limit if
  that limit is larger than the buffer size that will hold the piece.

Prior to this change if CURLOPT_MAX_SEND_SPEED_LARGE
(curl tool: --limit-rate) was set then it was possible that a temporary
buffer used for uploading could be written to out of bounds. A likely
scenario for this would be a non-trivial amount of post data combined
with a rate limit larger than CURLOPT_UPLOAD_BUFFERSIZE (default 64k).

The bug was introduced in 24e469f which is in releases since 7.76.0.

perl -e "print '0' x 200000" > tmp
curl --limit-rate 128k -d @tmp httpbin.org/post

Reported-by: Richard Marion

Fixes https://github.com/curl/curl/issues/7308
Closes https://github.com/curl/curl/pull/7315
2021-06-29 15:18:08 -04:00
Daniel Stenberg
2631722319
copyright: add boiler-plate headers to CI config files
And whitelist .zuul.ignore

Closes #7314
2021-06-29 17:44:03 +02:00
Daniel Stenberg
b7ca0cfec0
CI: remove travis details
Rename still used leftovers to "zuul" as that's now the CI using them.

Closes #7313
2021-06-29 17:42:57 +02:00
Daniel Stenberg
d7112b576e
RELEASE-NOTES: synced 2021-06-29 17:34:00 +02:00
Daniel Stenberg
4aed7a1923
openssl: avoid static variable for seed flag
Avoid the race condition risk by instead storing the "seeded" flag in
the multi handle. Modern OpenSSL versions handle the seeding itself so
doing the seeding once per multi-handle instead of once per process is
less of an issue.

Reported-by: Gerrit Renker
Fixes #7296
Closes #7306
2021-06-29 14:18:15 +02:00
Daniel Stenberg
b5a434f7f0
configure: inhibit the implicit-fallthrough warning on gcc-12
... since it no longer acknowledges the comment markup we use for that
purpose.

Reported-by: Younes El-karama
Fixes #7295
Closes #7307
2021-06-29 11:58:25 +02:00
Andrei Rybak
278b46751e misc: fix typos in comments which repeat a word
Fix typos in code comments which repeat various words.  In trivial
cases, just delete the repeated word.  Reword the affected sentence in
"lib/url.c" for it to make sense.

Closes #7303
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
2021-06-28 12:41:56 +02:00
Daniel Stenberg
ca60a4398f
lib677: make it survive torture testing
Follow-up to a5ab72d5ed

Closes #7300
2021-06-27 23:20:18 +02:00
Tommy Chiang
68d651f6b6
docs/BINDINGS: fix outdated links
* luacurl page is now not accessible, fix it with wayback machine page
* Scheme one seems not providing https now, change it back to http one

Closes #7301
2021-06-27 23:13:30 +02:00
Jacob Hoffman-Andrews
6d972c8b1c
curstls: bump crustls version and use new URL
crustls moved to https://github.com/rustls/rustls-ffi. This also bumps
the expected version to 0.7.0.

Closes #7297
2021-06-27 00:00:29 +02:00
Daniel Stenberg
f090c94b50
RELEASE-NOTES: synced 2021-06-24 16:02:20 +02:00
Daniel Stenberg
42db4ccee2
examples: length-limit two sscanf() uses of %s
Reported-by: Jishan Shaikh
Fixes #7293
Closes #7294
2021-06-24 15:57:09 +02:00
Richard Whitehouse
0842175fa4
multi: alter transfer timeout ordering
- Check whether a connection has succeded before checking whether it's
  timed out.

  This means if we've connected quickly, but subsequently been
  descheduled, we allow the connection to succeed. Note, if we timeout,
  but between checking the timeout, and connecting to the server the
  connection succeeds, we will allow it to go ahead. This is viewed as
  an acceptable trade off.

- Add additional failf logging around failed connection attempts to
  propogate the cause up to the caller.

Co-Authored-by: Martin Howarth
Closes #7178
2021-06-24 15:51:39 +02:00
Daniel Stenberg
a5ab72d5ed
test677: IMAP CONNECT_ONLY, custom command and then exit
Adjusted ftpserver.pl to add support for the IMAP IDLE command

Adjusted test 660 to sync with the fix
2021-06-24 09:07:40 +02:00
Daniel Stenberg
9accc48850
multi: do not switch off connect_only flag when closing
... as it made protocol specific disconnect commands wrongly get used.

Bug: https://curl.se/mail/lib-2021-06/0024.html
Reported-by: Aleksander Mazur
Closes #7288
2021-06-24 09:07:34 +02:00
Daniel Stenberg
a629506d42
http: make the haproxy support work with unix domain sockets
... it should then pass on "PROXY UNKNOWN" since it doesn't know the
involved IP addresses.

Reported-by: Valentín Gutiérrez
Fixes #7290
Closes #7291
2021-06-24 09:01:49 +02:00
Xiang Xiao
cfaa035a0c
curl.h: include sys/select.h for NuttX RTOS
Closes #7287
2021-06-22 14:35:24 +02:00
Bin Meng
2a73b6a3ab
curl.h: remove the execution bit
The execution bit of curl.h file was wrongly added:

  commit 2621025d6f ("curl.h: <sys/select.h> is supported by VxWorks7")

and should be removed.

Follow-up to 2621025d6f ("curl.h: <sys/select.h> is supported by VxWorks7")
Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
Closes #7286
2021-06-22 12:42:57 +02:00
Bin Lan
2621025d6f
curl.h: <sys/select.h> is supported by VxWorks7
Closes #7285
2021-06-22 08:23:11 +02:00
Bachue Zhou
a8472bb8ea
quiche: use send() instead of sendto() to avoid macOS issue
sendto() always returns "Socket is already connected" error on macos

Closes #7260
2021-06-21 14:54:51 +02:00
Li Xinwei
30e491e5c9
cmake: fix support for UnixSockets feature on Win32
Move the definition of sockaddr_un struct from config-win32.h to
curl_setup.h, so that it could be shared by all build systems.

Add ADDRESS_FAMILY typedef for old mingw, now old mingw can also use
unix sockets.

Also fix the build of tests/server/sws.c on Win32 when USE_UNIX_SOCKETS
is defined.

Closes #7034
2021-06-21 14:52:27 +02:00
Gregory Muchka
62be096085
hostip: (macOS) free returned memory of SCDynamicStoreCopyProxies
From Apples documentation on SCDynamicStoreCopyProxies, "Return Value: A
dictionary of key-value pairs that represent the current internet proxy
settings, or NULL if no proxy settings have been defined or if an error
occurred. You must release the returned value."

Failure to release the returned value of SCDynamicStoreCopyProxies can
result in a memory leak.

Source: https://developer.apple.com/documentation/systemconfiguration/1517088-scdynamicstorecopyproxies

Closes #7265
2021-06-21 14:05:49 +02:00
Daniel Stenberg
47386775ed
RELEASE-NOTES: synced 2021-06-21 10:12:00 +02:00
Jay Satiro
b31d9ccfc2 vtls: fix warning due to function prototype mismatch
b09c8ee changed the function prototype. Caught by Visual Studio.
2021-06-21 01:59:05 -04:00
Jay Satiro
765e060796 curl_multibyte: Remove local encoding fallbacks
- If the UTF-8 to UTF-16 conversion fails in Windows Unicode builds then
  no longer fall back to assuming the string is in a local encoding.

Background:

Some functions in Windows Unicode builds must convert UTF-8 to UTF-16 to
pass to the Windows CRT API wide-character functions since in Windows
UTF-8 is not a valid locale (or at least 99% of the time right now).

Prior to this change if the Unicode encoding conversion failed then
libcurl would assume, for backwards compatibility with applications that
may have written their code for non-Unicode builds, attempt to convert
the string from local encoding to UTF-16.

That type of "best effort" could theoretically cause some type of
security or other problem if a string that was locally encoded was also
valid UTF-8, and therefore an unexpected UTF-8 to UTF-16 conversion
could occur.

Ref: https://github.com/curl/curl/pull/7246

Closes https://github.com/curl/curl/pull/7257
2021-06-21 01:57:16 -04:00
Daniel Stenberg
4331c6dceb
curl_endian: remove the unused Curl_write64_le function
The last usage was removed in cca455a36

Closes #7280
2021-06-20 23:38:32 +02:00
Daniel Stenberg
a6da296867
vtls: only store TIMER_APPCONNECT for non-proxy connect
Introducing a 'isproxy' argument to the connect function so that it
knows wether to store the time stamp or not.

Reported-by: Yongkang Huang
Fixes #7274
Closes #7274
2021-06-19 23:02:16 +02:00
Daniel Stenberg
bfa0309175
gnutls: set the preferred TLS versions in correct order
Regression since 781864bedb (curl 7.77.0)

Reported-by: civodul on github
Assisted-by: Nikos Mavrogiannopoulos
Fixes #7277
Closes #7278
2021-06-18 23:22:21 +02:00