aboutsummaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2017-05-01failf: use private buffer, don't clobber receive bufferDaniel Stenberg
2017-05-01pingpong: use the set buffer sizeDaniel Stenberg
2017-05-01http2: use the correct set buffer sizeDaniel Stenberg
2017-05-01http: don't clobber the receive buffer for timecondDaniel Stenberg
2017-05-01buffer_size: make sure it always has the correct sizeDaniel Stenberg
Removes the need for CURL_BUFSIZE
2017-05-01file: use private buffer for C-L outputDaniel Stenberg
... instead of clobbering the download buffer.
2017-05-01CURLOPT_BUFFERSIZE: 1024 bytes is now the minimum sizeDaniel Stenberg
The buffer is needed to receive FTP, HTTP CONNECT responses etc so already at this size things risk breaking and smaller is certainly not wise.
2017-05-01ftp: use private buffer for temp storage, not receive bufferDaniel Stenberg
2017-05-01http: use private user:password output bufferDaniel Stenberg
Don't clobber the receive buffer.
2017-05-01curl_setup: Ensure no more than one IDN lib is enabledJay Satiro
Prior to this change it was possible for libcurl to be built with both Windows' native IDN lib (normaliz) and libidn2 enabled. It appears that doesn't offer any benefit --and could cause a bug-- since libcurl's IDN handling is written to use either one but not both. Bug: https://github.com/curl/curl/issues/1441#issuecomment-297689856 Reported-by: Gisle Vanem
2017-04-30http2: declare TU-local variables staticMarcel Raad
This fixes the following clang warnings: http2.c:184:27: error: no previous extern declaration for non-static variable 'Curl_handler_http2' [-Werror,-Wmissing-variable-declarations] http2.c:204:27: error: no previous extern declaration for non-static variable 'Curl_handler_http2_ssl' [-Werror,-Wmissing-variable-declarations]
2017-04-29curl_rtmp: fix missing-variable-declarations warningsMarcel Raad
clang complains: curl_rtmp.c:61:27: error: no previous extern declaration for non-static variable 'Curl_handler_rtmp' [-Werror,-Wmissing-variable-declarations] curl_rtmp.c:81:27: error: no previous extern declaration for non-static variable 'Curl_handler_rtmpt' [-Werror,-Wmissing-variable-declarations] curl_rtmp.c:101:27: error: no previous extern declaration for non-static variable 'Curl_handler_rtmpe' [-Werror,-Wmissing-variable-declarations] curl_rtmp.c:121:27: error: no previous extern declaration for non-static variable 'Curl_handler_rtmpte' [-Werror,-Wmissing-variable-declarations] curl_rtmp.c:141:27: error: no previous extern declaration for non-static variable 'Curl_handler_rtmps' [-Werror,-Wmissing-variable-declarations] curl_rtmp.c:161:27: error: no previous extern declaration for non-static variable 'Curl_handler_rtmpts' [-Werror,-Wmissing-variable-declarations] Fix this by including the header file.
2017-04-29url: fixed a memory leak on OOM while setting CURLOPT_BUFFERSIZEDan Fandrich
2017-04-27http-proxy: removed unused argument in CURL_DISABLE_PROXY caseDan Fandrich
Missed in commit 55c3c02e
2017-04-26lib: remove unused codeMarcel Raad
This fixes the following clang warnings: macro is not used [-Wunused-macros] will never be executed [-Wunreachable-code] Closes https://github.com/curl/curl/pull/1448
2017-04-26http-proxy: remove unused argument from Curl_proxyCONNECT()Daniel Stenberg
2017-04-26url: declare get_protocol_family() staticMartin Kepplinger
get_protocol_family() is not defined static even though there is a static local forward declaration. Let's simply make the definition match it's declaration. Bug: https://curl.haxx.se/mail/lib-2017-04/0127.html
2017-04-25nss: load libnssckbi.so if no other trust is specifiedKamil Dudka
The module contains a more comprehensive set of trust information than supported by nss-pem, because libnssckbi.so also includes information about distrusted certificates. Reviewed-by: Kai Engert Closes #1414
2017-04-25nss: factorize out nss_{un,}load_module to separate fncsKamil Dudka
No change of behavior is intended by this commit.
2017-04-25nss: do not leak PKCS #11 slot while loading a keyKamil Dudka
It could prevent nss-pem from being unloaded later on. Bug: https://bugzilla.redhat.com/1444860
2017-04-25transfer: remove 'uploadbuf' pointer and cleanup readwrite_upload()Daniel Stenberg
The data->req.uploadbuf struct member served no good purpose, instead we use ->state.uploadbuffer directly. It makes it clearer in the code which buffer that's being used. Removed the 'SingleRequest *' argument from the readwrite_upload() proto as it can be derived from the Curl_easy struct. Also made the code in the readwrite_upload() function use the 'k->' shortcut to all references to struct fields in 'data->req', which previously was made with a mix of both.
2017-04-25if2ip: fix -Wcast-align warningMarcel Raad
Follow-up to 119037325de02579f5c58256ca2ed2a0aa592c86, which fixed the warning in the HAVE_GETIFADDRS block, but not in the HAVE_IOCTL_SIOCGIFADDR block.
2017-04-24nss: adapt to the new Curl_llist APIKamil Dudka
This commit fixes compilation failure caused by cbae73e1dd95946597ea74ccb580c30f78e3fa73.
2017-04-24llist: fix a comment after cbae73e1dd9Daniel Stenberg
Pointed-it-by: Kevin Ji URL: https://github.com/curl/curl/commit/cbae73e1dd95946597ea74ccb580c30f78e3fa73#commitcomment-21872622
2017-04-22schannel: Don't treat encrypted partial record as pending dataJay Satiro
- Track when the cached encrypted data contains only a partial record that can't be decrypted without more data (SEC_E_INCOMPLETE_MESSAGE). - Change Curl_schannel_data_pending to return false in such a case. Other SSL libraries have pending data functions that behave similarly. Ref: https://github.com/curl/curl/pull/1387 Closes https://github.com/curl/curl/pull/1392
2017-04-22multi: clarify condition in curl_multi_waitAlan Jenkins
`if(nfds || extra_nfds) {` is followed by `malloc(nfds * ...)`. If `extra_fs` could be non-zero when `nfds` was zero, then we have `malloc(0)` which is allowed to return `NULL`. But, malloc returning NULL can be confusing. In this code, the next line would treat the NULL as an allocation failure. It turns out, if `nfds` is zero then `extra_nfds` must also be zero. The final value of `nfds` includes `extra_nfds`. So the test for `extra_nfds` is redundant. It can only confuse the reader. Closes #1439
2017-04-22lib: fix maybe-uninitialized warningsMarcel Raad
With -Og, GCC complains: easy.c:628:7: error: ‘mcode’ may be used uninitialized in this function [-Werror=maybe-uninitialized] ../lib/strcase.h:35:29: error: ‘tok_buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized] vauth/digest.c:208:9: note: ‘tok_buf’ was declared here ../lib/strcase.h:35:29: error: ‘tok_buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized] vauth/digest.c:566:15: note: ‘tok_buf’ was declared here Fix this by initializing the variables.
2017-04-22gnutls: removed some code when --disable-verbose is configuredDan Fandrich
This reduces the binary size and fixes a compile warning.
2017-04-22llist: no longer uses mallocDaniel Stenberg
The 'list element' struct now has to be within the data that is being added to the list. Removes 16.6% (tiny) mallocs from a simple HTTP transfer. (96 => 80) Also removed return codes since the llist functions can't fail now. Test 1300 updated accordingly. Closes #1435
2017-04-21mbedtls: enable NTLM (& SMB) even if MD4 support is unavailableDan Fandrich
In that case, use libcurl's internal MD4 routine. This fixes tests 1013 and 1014 which were failing due to configure assuming NTLM and SMB were always available whenever mbed TLS was in use (which is now true).
2017-04-20openssl: fix memory leak in servercertDaniel Stenberg
... when failing to get the server certificate.
2017-04-18nss: fix MinGW compiler warningsMarcel Raad
This fixes 3 warnings issued by MinGW: 1. PR_ImportTCPSocket actually has a paramter of type PROsfd instead of PRInt32, which is 64 bits on Windows. Fixed this by including the corresponding header file instead of redeclaring the function, which is supported even though it is in the private include folder. [1] 2. In 64-bit mode, size_t is 64 bits while CK_ULONG is 32 bits, so an explicit narrowing cast is needed. 3. Curl_timeleft returns time_t instead of long since commit 21aa32d30dbf319f2d336e0cb68d3a3235869fbb. [1] https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSPR/Reference/PR_ImportTCPSocket Closes https://github.com/curl/curl/pull/1393
2017-04-18TLS: Fix switching off SSL session id when client cert is usedJay Satiro
Move the sessionid flag to ssl_primary_config so that ssl and proxy_ssl will each have their own sessionid flag. Regression since HTTPS-Proxy support was added in cb4e2be. Prior to that this issue had been fixed in 247d890, CVE-2016-5419. Bug: https://github.com/curl/curl/issues/1341 Reported-by: lijian996@users.noreply.github.com The new incarnation of this bug is called CVE-2017-7468 and is documented here: https://curl.haxx.se/docs/adv_20170419.html
2017-04-17openssl: don't try to print nonexistant peer private keysDavid Benjamin
X.509 certificates carry public keys, not private keys. Fields corresponding to the private half of the key will always be NULL. Closes #1425
2017-04-17openssl: fix thread-safety bugs in error-handlingDavid Benjamin
ERR_error_string with NULL parameter is not thread-safe. The library writes the string into some static buffer. Two threads doing this at once may clobber each other and run into problems. Switch to ERR_error_string_n which avoids this problem and is explicitly bounds-checked. Also clean up some remnants of OpenSSL 0.9.5 around here. A number of comments (fixed buffer size, explaining that ERR_error_string_n was added in a particular version) date to when ossl_strerror tried to support pre-ERR_error_string_n OpenSSLs. Closes #1424
2017-04-17openssl: make SSL_ERROR_to_str more future-proofDavid Benjamin
Rather than making assumptions about the values, use a switch-case. Closes #1424
2017-04-17code: fix typos and style in commentsDaniel Gustafsson
A few random typos, and minor whitespace cleanups, found in comments while reading code. Closes #1423
2017-04-17.gitattributes: force shell scripts to LFMarcel Raad
Bash on Linux errors out on CR characters. This makes tests 1221 and 1222 pass on Linux with a CRLF checkout. Ref: https://github.com/curl/curl/pull/1344#issuecomment-289243166 Closes https://github.com/curl/curl/pull/1422
2017-04-15http2: fix handle leak in error pathLarry Stefani
Add missing newhandle free call in push_promise(). Closes #1416
2017-04-15mbedtls: fix memory leak in error pathLarry Stefani
Add missing our_ssl_sessionid free call in mbed_connect_step3(). Closes #1417
2017-04-11Curl_expire_latest: ignore already expired timersDaniel Stenberg
If the existing timer is still in there but has expired, the new timer should be added. Reported-by: Rainer Canavan Bug: https://curl.haxx.se/mail/lib-2017-04/0030.html Closes #1407
2017-04-11polarssl: unbreak build with versions < 1.3.8Marcel Raad
ssl_session_init was only introduced in version 1.3.8, the penultimate version. The function only contains a memset, so replace it with that. Suggested-by: Jay Satiro Fixes https://github.com/curl/curl/issues/1401
2017-04-11poll: prefer <poll.h> over <sys/poll.h>Marcel Raad
The POSIX standard location is <poll.h>. Using <sys/poll.h> results in warning spam when using the musl standard library. Closes https://github.com/curl/curl/pull/1406
2017-04-10openssl: fix this statement may fall through [-Wimplicit-fallthrough=]Alexis La Goutte
Closes #1402
2017-04-10nss: load CA certificates even with --insecureKamil Dudka
... because they may include an intermediate certificate for a client certificate and the intermediate certificate needs to be presented to the server, no matter if we verify the peer or not. Reported-by: thraidh Closes #851
2017-04-08vtls: fix unreferenced variable warningsMarcel Raad
... by moving the variables into the correct #ifdef block.
2017-04-07schannel: fix compiler warningsMarcel Raad
When UNICODE is not defined, the Curl_convert_UTF8_to_tchar macro maps directly to its argument. As it is declared as a pointer to const and InitializeSecurityContext expects a pointer to non-const, both MSVC and MinGW issue a warning about implicitly casting away the const. Fix this by declaring the variables as pointers to non-const. Closes https://github.com/curl/curl/pull/1394
2017-04-07sspi: print out InitializeSecurityContext() error messageIsaac Boukris
Reported-by: Carsten (talksinmath) Fixes #1384 Closes #1395
2017-04-06gtls: fix compiler warningMarcel Raad
Curl_timeleft returns time_t instead of long since commit 21aa32d30dbf319f2d336e0cb68d3a3235869fbb.
2017-04-06low_speed_limit: improved function for longer time periodsDaniel Stenberg
Previously, periods of fast speed between periods of slow speed would not count and could still erroneously trigger a timeout. Reported-by: Paul Harris Fixes #1345 Closes #1390