2017-01-11 10:59:45 -08:00
|
|
|
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
2017-12-05 14:57:14 +01:00
|
|
|
index 7b73b98..72f6171 100644
|
2017-01-11 10:59:45 -08:00
|
|
|
--- a/CMakeLists.txt
|
|
|
|
+++ b/CMakeLists.txt
|
2017-12-05 14:57:14 +01:00
|
|
|
@@ -882,7 +882,9 @@ check_symbol_exists(setsockopt "${CURL_INCLUDES}" HAVE_SETSOCKOPT)
|
|
|
|
check_function_exists(mach_absolute_time HAVE_MACH_ABSOLUTE_TIME)
|
2017-01-11 10:59:45 -08:00
|
|
|
|
2017-08-10 21:43:50 +02:00
|
|
|
# symbol exists in win32, but function does not.
|
2017-01-11 10:59:45 -08:00
|
|
|
-if(WIN32)
|
|
|
|
+if(CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
|
|
|
+ add_definitions(-D_WIN32_WINNT=0x0A00 -DHAVE_STRUCT_POLLFD -D_WINSOCK_DEPRECATED_NO_WARNINGS)
|
|
|
|
+elseif(WIN32)
|
2017-08-10 21:43:50 +02:00
|
|
|
if(ENABLE_INET_PTON)
|
|
|
|
check_function_exists(inet_pton HAVE_INET_PTON)
|
|
|
|
# _WIN32_WINNT_VISTA (0x0600)
|
2017-01-11 10:59:45 -08:00
|
|
|
diff --git a/lib/curl_gethostname.c b/lib/curl_gethostname.c
|
2017-08-10 21:43:50 +02:00
|
|
|
index 8337c72..41867b2 100644
|
2017-01-11 10:59:45 -08:00
|
|
|
--- a/lib/curl_gethostname.c
|
|
|
|
+++ b/lib/curl_gethostname.c
|
|
|
|
@@ -21,6 +21,7 @@
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
#include "curl_setup.h"
|
|
|
|
+#include "curl/curl.h"
|
|
|
|
|
|
|
|
#include "curl_gethostname.h"
|
|
|
|
|
2017-08-10 21:43:50 +02:00
|
|
|
@@ -64,9 +65,10 @@ int Curl_gethostname(char *name, GETHOSTNAME_TYPE_ARG2 namelen)
|
2017-01-11 10:59:45 -08:00
|
|
|
#ifdef DEBUGBUILD
|
|
|
|
|
|
|
|
/* Override host name when environment variable CURL_GETHOSTNAME is set */
|
|
|
|
- const char *force_hostname = getenv("CURL_GETHOSTNAME");
|
2017-01-12 21:25:10 -08:00
|
|
|
+ char *force_hostname = curl_getenv("CURL_GETHOSTNAME");
|
2017-01-11 10:59:45 -08:00
|
|
|
if(force_hostname) {
|
|
|
|
strncpy(name, force_hostname, namelen);
|
2017-01-12 21:25:10 -08:00
|
|
|
+ free(force_hostname);
|
2017-01-11 10:59:45 -08:00
|
|
|
err = 0;
|
2017-01-12 21:25:10 -08:00
|
|
|
}
|
|
|
|
else {
|
2017-01-11 10:59:45 -08:00
|
|
|
diff --git a/lib/curl_ntlm_core.c b/lib/curl_ntlm_core.c
|
2017-12-05 14:57:14 +01:00
|
|
|
index e896276..268f0ea 100644
|
2017-01-11 10:59:45 -08:00
|
|
|
--- a/lib/curl_ntlm_core.c
|
|
|
|
+++ b/lib/curl_ntlm_core.c
|
2017-12-05 14:57:14 +01:00
|
|
|
@@ -743,9 +743,12 @@ CURLcode Curl_ntlm_core_mk_ntlmv2_resp(unsigned char *ntlmv2hash,
|
2017-01-11 10:59:45 -08:00
|
|
|
|
|
|
|
/* Calculate the timestamp */
|
|
|
|
#ifdef DEBUGBUILD
|
|
|
|
- char *force_timestamp = getenv("CURL_FORCETIME");
|
2017-01-12 21:25:10 -08:00
|
|
|
- if(force_timestamp)
|
2017-01-11 10:59:45 -08:00
|
|
|
+ char *force_timestamp = curl_getenv("CURL_FORCETIME");
|
2017-01-12 21:25:10 -08:00
|
|
|
+ if (force_timestamp)
|
|
|
|
+ {
|
2017-01-11 10:59:45 -08:00
|
|
|
tw = CURL_OFF_T_C(11644473600) * 10000000;
|
2017-01-12 21:25:10 -08:00
|
|
|
+ free(force_timestamp);
|
|
|
|
+ }
|
2017-01-11 10:59:45 -08:00
|
|
|
else
|
2017-01-12 21:25:10 -08:00
|
|
|
#endif
|
|
|
|
tw = ((curl_off_t)time(NULL) + CURL_OFF_T_C(11644473600)) * 10000000;
|
2017-01-11 10:59:45 -08:00
|
|
|
diff --git a/lib/ftp.c b/lib/ftp.c
|
2017-12-05 14:57:14 +01:00
|
|
|
index 8042edf..3442df7 100644
|
2017-01-11 10:59:45 -08:00
|
|
|
--- a/lib/ftp.c
|
|
|
|
+++ b/lib/ftp.c
|
2017-12-05 14:57:14 +01:00
|
|
|
@@ -4297,7 +4297,7 @@ CURLcode ftp_parse_url_path(struct connectdata *conn)
|
2017-08-10 21:43:50 +02:00
|
|
|
/* prevpath is "raw" so we convert the input path before we compare the
|
|
|
|
strings */
|
|
|
|
size_t dlen;
|
|
|
|
- char *path;
|
|
|
|
+ char *path = NULL;
|
|
|
|
CURLcode result =
|
|
|
|
Curl_urldecode(conn->data, data->state.path, 0, &path, &dlen, FALSE);
|
|
|
|
if(result) {
|
|
|
|
diff --git a/lib/rand.c b/lib/rand.c
|
2017-12-05 14:57:14 +01:00
|
|
|
index 2670af9..0d18d37 100644
|
2017-08-10 21:43:50 +02:00
|
|
|
--- a/lib/rand.c
|
|
|
|
+++ b/lib/rand.c
|
|
|
|
@@ -44,7 +44,7 @@ static CURLcode randit(struct Curl_easy *data, unsigned int *rnd)
|
2017-01-11 10:59:45 -08:00
|
|
|
static bool seeded = FALSE;
|
|
|
|
|
|
|
|
#ifdef CURLDEBUG
|
|
|
|
- char *force_entropy = getenv("CURL_ENTROPY");
|
|
|
|
+ char *force_entropy = curl_getenv("CURL_ENTROPY");
|
|
|
|
if(force_entropy) {
|
|
|
|
if(!seeded) {
|
2017-08-10 21:43:50 +02:00
|
|
|
unsigned int seed = 0;
|
|
|
|
@@ -58,6 +58,7 @@ static CURLcode randit(struct Curl_easy *data, unsigned int *rnd)
|
2017-01-12 21:25:10 -08:00
|
|
|
else
|
|
|
|
randseed++;
|
2017-08-10 21:43:50 +02:00
|
|
|
*rnd = randseed;
|
2017-01-12 21:25:10 -08:00
|
|
|
+ free(force_entropy);
|
2017-08-10 21:43:50 +02:00
|
|
|
return CURLE_OK;
|
2017-01-12 21:25:10 -08:00
|
|
|
}
|
|
|
|
#endif
|