aboutsummaryrefslogtreecommitdiff
path: root/lib/system_win32.h
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2016-05-29 22:57:40 +0200
committerDaniel Stenberg <daniel@haxx.se>2016-05-30 08:14:27 +0200
commit6df916d751e72fc9a1febc07bb59c4ddd886c043 (patch)
tree4719db7dad6c1a8068988e22f5569a120a602091 /lib/system_win32.h
parentddf25f6b28c944702792b9555d47cdeb8217fece (diff)
downloadgnurl-6df916d751e72fc9a1febc07bb59c4ddd886c043.tar.gz
gnurl-6df916d751e72fc9a1febc07bb59c4ddd886c043.tar.bz2
gnurl-6df916d751e72fc9a1febc07bb59c4ddd886c043.zip
loadlibrary: Only load system DLLs from the system directory
Inspiration provided by: Daniel Stenberg and Ray Satiro Bug: https://curl.haxx.se/docs/adv_20160530.html Ref: Windows DLL hijacking with curl, CVE-2016-4802
Diffstat (limited to 'lib/system_win32.h')
-rw-r--r--lib/system_win32.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/lib/system_win32.h b/lib/system_win32.h
new file mode 100644
index 000000000..dec18899a
--- /dev/null
+++ b/lib/system_win32.h
@@ -0,0 +1,39 @@
+#ifndef HEADER_CURL_SYSTEM_WIN32_H
+#define HEADER_CURL_SYSTEM_WIN32_H
+/***************************************************************************
+ * _ _ ____ _
+ * Project ___| | | | _ \| |
+ * / __| | | | |_) | |
+ * | (__| |_| | _ <| |___
+ * \___|\___/|_| \_\_____|
+ *
+ * Copyright (C) 2016, Steve Holme, <steve_holme@hotmail.com>.
+ *
+ * This software is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at https://curl.haxx.se/docs/copyright.html.
+ *
+ * You may opt to use, copy, modify, merge, publish, distribute and/or sell
+ * copies of the Software, and permit persons to whom the Software is
+ * furnished to do so, under the terms of the COPYING file.
+ *
+ * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
+ * KIND, either express or implied.
+ *
+ ***************************************************************************/
+
+#include "curl_setup.h"
+
+#if defined(WIN32)
+
+#if defined(USE_WINDOWS_SSPI) || (!defined(CURL_DISABLE_TELNET) && \
+ defined(USE_WINSOCK))
+
+/* This is used to dynamically load DLLs */
+HMODULE Curl_load_library(LPCTSTR filename);
+
+#endif /* USE_WINDOWS_SSPI || (!CURL_DISABLE_TELNET && USE_WINSOCK) */
+
+#endif /* WIN32 */
+
+#endif /* HEADER_CURL_SYSTEM_WIN32_H */