mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Don't crash when the HTTP request for getting the server status message fails.
Same thing as 82d9c3a57879, more or less.
This commit is contained in:
@ -668,7 +668,7 @@ static void HttpRequestGet(HINTERNET hConnect)
|
||||
const wchar *path = BuildTypeServerStatusPath();
|
||||
HINTERNET hRequest = 0;
|
||||
char data[256] = {0};
|
||||
DWORD bytesRead;
|
||||
DWORD bytesRead = 0;
|
||||
|
||||
hRequest = WinHttpOpenRequest(
|
||||
hConnect,
|
||||
@ -693,11 +693,13 @@ static void HttpRequestGet(HINTERNET hConnect)
|
||||
if(b)
|
||||
{
|
||||
DWORD err = GetLastError();
|
||||
WinHttpReceiveResponse(hRequest, 0);
|
||||
WinHttpReadData(hRequest, data, arrsize(data)-1, &bytesRead);
|
||||
if (WinHttpReceiveResponse(hRequest, 0)
|
||||
&& WinHttpReadData(hRequest, data, arrsize(data) - 1, &bytesRead))
|
||||
{
|
||||
data[bytesRead] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(bytesRead)
|
||||
SetStatusText(data);
|
||||
WinHttpCloseHandle(hRequest);
|
||||
|
Reference in New Issue
Block a user