mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2024-11-28 01:14:20 +01:00
The string buffer lengths in a URL_COMPONENTS structure are in TCHARs, so
these should be sizeof(z) / sizeof(z[0]) to avoid a buffer overrun. Caught by Dmitry Titov, r=me. git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@229 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
parent
feff0b300f
commit
bbd9b47291
@ -83,11 +83,11 @@ bool HTTPUpload::SendRequest(const wstring &url,
|
||||
memset(&components, 0, sizeof(components));
|
||||
components.dwStructSize = sizeof(components);
|
||||
components.lpszScheme = scheme;
|
||||
components.dwSchemeLength = sizeof(scheme);
|
||||
components.dwSchemeLength = sizeof(scheme) / sizeof(scheme[0]);
|
||||
components.lpszHostName = host;
|
||||
components.dwHostNameLength = sizeof(host);
|
||||
components.dwHostNameLength = sizeof(host) / sizeof(host[0]);
|
||||
components.lpszUrlPath = path;
|
||||
components.dwUrlPathLength = sizeof(path);
|
||||
components.dwUrlPathLength = sizeof(path) / sizeof(path[0]);
|
||||
if (!InternetCrackUrl(url.c_str(), static_cast<DWORD>(url.size()),
|
||||
0, &components)) {
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user