mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-17 16:44:27 -04:00
[net] fix an exception in DownloadFile()
* As per the MSDN, HttpOpenRequest's 6th parameter should be a NULL terminated list
This commit is contained in:
parent
5c2d7aa21e
commit
ac9ddca792
2 changed files with 8 additions and 7 deletions
|
@ -246,6 +246,7 @@ DWORD DownloadFile(const char* url, const char* file, HWND hProgressDialog)
|
|||
DWORD dwFlags, dwSize, dwDownloaded, dwTotalSize, dwStatus;
|
||||
FILE* fd = NULL;
|
||||
LONG progress_style;
|
||||
const char* accept_types[] = {"*/*\0", NULL};
|
||||
unsigned char buf[DOWNLOAD_BUFFER_SIZE];
|
||||
char agent[64], hostname[64], urlpath[128];
|
||||
HINTERNET hSession = NULL, hConnection = NULL, hRequest = NULL;
|
||||
|
@ -304,7 +305,7 @@ DWORD DownloadFile(const char* url, const char* file, HWND hProgressDialog)
|
|||
goto out;
|
||||
}
|
||||
|
||||
hRequest = HttpOpenRequestA(hConnection, "GET", UrlParts.lpszUrlPath, NULL, NULL, (const char**)"*/*\0",
|
||||
hRequest = HttpOpenRequestA(hConnection, "GET", UrlParts.lpszUrlPath, NULL, NULL, accept_types,
|
||||
INTERNET_FLAG_HYPERLINK|INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTP|INTERNET_FLAG_IGNORE_REDIRECT_TO_HTTPS|INTERNET_FLAG_NO_COOKIES|
|
||||
INTERNET_FLAG_NO_UI|INTERNET_FLAG_NO_CACHE_WRITE, (DWORD_PTR)NULL);
|
||||
if (hRequest == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue