Release 2.2.? ????????????????
Security fixes:
#81 Pre-10.7/Lion macOS: Support entropy from arc4random
- #82 Windows: Fix DLL hijacking vulnerability
+ #82 Windows: Fix DLL hijacking vulnerability using
+ Steve Holme's LoadLibrary wrapper for/of cURL
Bug fixes:
#85 Fix a dangling pointer issue related to realloc
#ifdef _WIN32
typedef BOOLEAN (APIENTRY *RTLGENRANDOM_FUNC)(PVOID, ULONG);
+HMODULE Curl_load_library(LPCTSTR filename); /* see loadlibrary.c */
/* Obtain entropy on Windows XP / Windows Server 2003 and later.
* Hint on RtlGenRandom and the following article from libsodium.
static int
writeRandomBytes_RtlGenRandom(void * target, size_t count) {
int success = 0; /* full count bytes written? */
- const LPCTSTR file_name = TEXT("ADVAPI32.DLL");
- HMODULE advapi32 = LoadLibraryEx(file_name, 0, LOAD_LIBRARY_SEARCH_SYSTEM32);
-
- if (! advapi32) {
- /* Try again without LOAD_LIBRARY_SEARCH_SYSTEM32 if unsupported */
- advapi32 = LoadLibraryEx(file_name, 0, 0);
- }
+ const HMODULE advapi32 = Curl_load_library(TEXT("ADVAPI32.DLL"));
if (advapi32) {
const RTLGENRANDOM_FUNC RtlGenRandom