1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00
Commit Graph

7900 Commits

Author SHA1 Message Date
Patrick Monnerat
a390329f60 if2ip: dummy scope parameter for Curl_if2ip() call in SIOCGIFADDR-enabled code. 2014-12-18 11:05:18 +01:00
Kyle J. McKay
14c3601583 parseurlandfillconn(): fix improper non-numeric scope_id stripping.
Fixes SF bug 1149: http://sourceforge.net/p/curl/bugs/1449/
2014-12-17 15:52:07 +01:00
Patrick Monnerat
9081014c2c IPV6: address scope != scope id
There was a confusion between these: this commit tries to disambiguate them.
- Scope can be computed from the address itself.
- Scope id is scope dependent: it is currently defined as 1-based local
  interface index for link-local scoped addresses, and as a site index(?) for
  (obsolete) site-local addresses. Linux only supports it for link-local
  addresses.
The URL parser properly parses a scope id as an interface index, but stores it
in a field named "scope": confusion. The field has been renamed into "scope_id".
Curl_if2ip() used the scope id as it was a scope. This caused failures
to bind to an interface.
Scope is now computed from the addresses and Curl_if2ip() matches them.
If redundantly specified in the URL, scope id is check for mismatch with
the interface index.

This commit should fix SF bug #1451.
2014-12-16 13:52:06 +01:00
Patrick Monnerat
759d049ae8 connect: singleipconnect(): properly try other address families after failure 2014-12-16 13:52:06 +01:00
Daniel Stenberg
1befebc950 SFTP: work-around servers that return zero size on STAT
Bug: http://curl.haxx.se/mail/lib-2014-12/0103.html
Pathed-by: Marc Renault
2014-12-16 09:49:17 +01:00
Nick Zitzmann
93227ddca5 darwinssl: fix incorrect usage of aprintf()
Commit b13923f changed an snprintf() to use aprintf(), but the API usage
wasn't correct, and was causing a crash to occur. This fixes it.
2014-12-15 00:56:09 -06:00
Steve Holme
cedf996073 copyright: Updated the copyright year following recent updates 2014-12-14 22:39:27 +00:00
Marc Hoersken
8676ce68e3 lib: Fixed multiple code analysis warnings if SAL are available
warning C28252: Inconsistent annotation for function:
parameter has another annotation on this instance
2014-12-14 22:16:23 +01:00
Steve Holme
91669584cf smb.c: Fixed code analysis warning
smb.c:320: warning C6297: Arithmetic overflow: 32-bit value is shifted,
           then cast to 64-bit value. Result may not be an expected
           value
2014-12-14 21:01:09 +00:00
Steve Holme
b9950e3b33 smb: Use HAVE_PROCESS_H for process.h inclusion
Rather than testing against _WIN32 use the preferred HAVE_PROCESS_H
pre-processor define when including process.h.
2014-12-14 16:42:08 +00:00
Daniel Stenberg
b13923f0f7 darwinssl: aprintf() to allocate the session key
... to avoid using a fixed memory size that risks being too large or too
small.
2014-12-14 17:34:02 +01:00
Marc Hoersken
212e3e26bc curl_schannel: Improvements to memory re-allocation strategy
- do not grow memory by doubling its size
- do not leak previously allocated memory if reallocation fails
- replace while-loop with a single check to make sure
  that the requested amount of data fits into the buffer

Bug: http://curl.haxx.se/bug/view.cgi?id=1450
Reported-by: Warren Menzer
2014-12-14 17:27:31 +01:00
Steve Holme
125f655131 asyn-ares: We prefer use of 'CURLcode result' 2014-12-14 16:21:01 +00:00
Marc Hoersken
c98b50753f curl_schannel.c: Data may be available before connection shutdown 2014-12-14 16:40:49 +01:00
Steve Holme
96d3c9363f http2: Use 'CURLcode result' for curl result codes 2014-12-14 13:11:35 +00:00
Steve Holme
4d2c539b6c asyn-thread: We prefer 'CURLcode result' 2014-12-14 12:55:22 +00:00
Steve Holme
35fae251dd smb: Fixed unnecessary initialisation of struct member variables
There is no need to set the 'state' and 'result' member variables to
SMB_REQUESTING (0) and CURLE_OK (0) after the allocation via calloc()
as calloc() initialises the contents to zero.
2014-12-14 12:27:57 +00:00
Steve Holme
52a4d6b8ae ntlm: Fixed return code for bad type-2 Target Info
Use CURLE_BAD_CONTENT_ENCODING for bad type-2 Target Info security
buffers just like we do for bad decodes.
2014-12-14 12:11:04 +00:00
Steve Holme
18f58c437f ntlm: Remove unnecessary casts in readshort_le()
I don't think both of my fix ups from yesterday were needed to fix the
compilation warning, so remove the one that I think is unnecessary and
let the next Android autobuild prove/disprove it.
2014-12-14 11:45:14 +00:00
Steve Holme
2924dd6703 curl_ntlm_msgs.c: Another attempt to fix compilation warning
curl_ntlm_msgs.c:170: warning: conversion to 'short unsigned int' from
                      'int' may alter its value
2014-12-13 14:55:26 +00:00
Steve Holme
bd7d7f4523 smb.c: Fixed line longer than 79 columns 2014-12-13 13:10:05 +00:00
Steve Holme
172963005a curl_ntlm_msgs.c: Fixed compilation warning from commit 783b5c3b11
curl_ntlm_msgs.c:169: warning: conversion to 'short unsigned int' from
                      'int' may alter its value
2014-12-13 12:51:11 +00:00
Guenter Knauf
834608c39d mk-ca-bundle.pl: restored forced run again. 2014-12-13 13:46:45 +01:00
Steve Holme
5f5814ca5e ftp.c: Fixed compilation warning when no verbose string support
ftp.c:819: warning: unused parameter 'lineno'
2014-12-13 12:32:32 +00:00
Steve Holme
2ecce667a6 smb: Added state change functions to assist with debugging
For debugging purposes, and as per other protocols within curl, added
state change functions rather than changing the states directly.
2014-12-13 12:16:36 +00:00
Steve Holme
783b5c3b11 ntlm: Use short integer when decoding 16-bit values 2014-12-13 11:18:00 +00:00
Steve Holme
6291a16b20 smtp.c: Fixed compilation warnings
smtp.c:2357 warning: adding 'size_t' (aka 'unsigned long') to a string
            does not append to the string
smtp.c:2375 warning: adding 'size_t' (aka 'unsigned long') to a string
            does not append to the string
smtp.c:2386 warning: adding 'size_t' (aka 'unsigned long') to a string
            does not append to the string

Used array index notation instead.
2014-12-12 23:03:46 +00:00
Steve Holme
24b30d259c smb: Disable SMB when 64-bit integers are not supported
This fixes compilation issues with compilers that don't support 64-bit
integers through long long or __int64.
2014-12-12 22:34:18 +00:00
Steve Holme
82fdb87b27 ntlm: Disable NTLM v2 when 64-bit integers are not supported
This fixes compilation issues with compilers that don't support 64-bit
integers through long long or __int64 which was introduced in commit
07b66cbfa4.
2014-12-12 22:34:16 +00:00
Steve Holme
97e90d7b89 ntlm: Allow NTLM2Session messages when USE_NTRESPONSES manually defined
Previously USE_NTLM2SESSION would only be defined automatically when
USE_NTRESPONSES wasn't already defined. Separated the two definitions
so that the user can manually set USE_NTRESPONSES themselves but
USE_NTLM2SESSION is defined automatically if they don't define it.
2014-12-12 22:33:57 +00:00
Steve Holme
10be4ec2c3 smtp.c: Fixed line longer than 79 columns 2014-12-12 21:23:11 +00:00
Steve Holme
bd2231104b config-win32.h: Don't enable Windows Crypt API if using OpenSSL
As the OpenSSL and NSS Crypto engines are prefered by the core NTLM
routines, to the Windows Crypt API, don't define USE_WIN32_CRYPT
automatically when either OpenSSL or NSS are in use - doing so would
disable NTLM2Session responses in NTLM type-3 messages.
2014-12-12 19:57:00 +00:00
Steve Holme
8a4ce7d0f5 smtp: Fixed inappropriate free of the scratch buffer
If the scratch buffer was allocated in a previous call to
Curl_smtp_escape_eob(), a new buffer not allocated in the subsequent
call and no action taken by that call, then an attempt would be made to
try and free the buffer which, by now, would be part of the data->state
structure.

This bug was introduced in commit 4bd860a001.
2014-12-12 19:15:10 +00:00
Steve Holme
f0ecdd04d3 smtp: Fixed dot stuffing when EOL characters were at end of input buffers
Fixed a problem with the CRLF. detection when multiple buffers were
used to upload an email to libcurl and the line ending character(s)
appeared at the end of each buffer. This meant any lines which started
with . would not be escaped into .. and could be interpreted as the end
of transmission string instead.

This only affected libcurl based applications that used a read function
and wasn't reproducible with the curl command-line tool.

Bug: http://curl.haxx.se/bug/view.cgi?id=1456
Assisted-by: Patrick Monnerat
2014-12-12 19:15:08 +00:00
Daniel Stenberg
2f5c70b2b0 telnet: fix "cast increases required alignment of target type" 2014-12-11 09:15:04 +01:00
Daniel Stenberg
f4b5f8cdf0 ntlm_wb_response: fix "statement not reached"
... and I could use a break instead of a goto to end the loop.

Bug: http://curl.haxx.se/mail/lib-2014-12/0089.html
Reported-by: Tor Arntsen
2014-12-10 22:45:19 +01:00
Daniel Stenberg
1cc5194337 Curl_unix2addr: avoid using the variable name 'sun'
I suspect this causes compile failures on Solaris:

Bug: http://curl.haxx.se/mail/lib-2014-12/0081.html
2014-12-10 13:13:31 +01:00
Steve Holme
0da4524a22 url.c: Fixed compilation warning when USE_NTLM is not defined
url.c:3078: warning: variable 'credentialsMatch' set but not used
2014-12-10 11:57:11 +00:00
Steve Holme
664b9baf67 parsedate.c: Fixed compilation warning
parsedate.c:548: warning: 'parsed' may be used uninitialized in this
                 function

As curl_getdate() returns -1 when parsedate() fails we can initialise
parsed to -1.
2014-12-10 11:38:38 +00:00
Daniel Stenberg
086ad79970 ldap: check Curl_client_write() return codes
There might be one or two memory leaks left in the error paths.
2014-12-10 00:41:32 +01:00
Daniel Stenberg
0e8158eabc ldap: rename variables to comply to curl standards 2014-12-10 00:36:31 +01:00
Dan Fandrich
41f1f6e830 cookies: Improved OOM handling in cookies
This fixes the test 506 torture test. The internal cookie API really
ought to be improved to separate cookie parsing errors (which may be
ignored) with OOM errors (which should be fatal).
2014-12-09 23:58:30 +01:00
Daniel Stenberg
fc32b81382 smb: fix unused return code warning 2014-12-09 15:47:28 +01:00
Patrick Monnerat
6ea4ee94f9 Curl_client_write() & al.: chop long data, convert data only once. 2014-12-09 15:43:51 +01:00
Daniel Stenberg
145c263a4b schannel_recv: return the correct code
Bug: http://curl.haxx.se/bug/view.cgi?id=1462
Reported-by: Tae Hyoung Ahn
2014-12-09 11:46:11 +01:00
Daniel Stenberg
680d5fd041 http2: avoid logging neg "failure" if h2 was not requested 2014-12-09 00:09:24 +01:00
Daniel Stenberg
65d141e6da openldap: do not ignore Curl_client_write() return codes 2014-12-08 15:33:14 +01:00
Daniel Stenberg
0d99cdbeed compile: warn on unused return code from Curl_client_write() 2014-12-08 15:31:53 +01:00
Patrick Monnerat
dca257f27e SMB: Fix a data size mismatch that broke SMB on big-endian platforms 2014-12-08 15:30:11 +01:00
Steve Holme
dcd484a238 smb: Fixed Windows autoconf builds following commit eb88d778e7
As Windows based autoconf builds don't yet define USE_WIN32_CRYPTO
either explicitly through --enable-win32-cypto or automatically on
_WIN32 based platforms, subsequent builds broke with the following
error message:

"Can't compile NTLM support without a crypto library."
2014-12-07 20:47:54 +00:00