diff options
author | mmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2007-11-13 22:17:14 +0000 |
---|---|---|
committer | mmentovai <mmentovai@4c0a9323-5329-0410-9bdc-e9ce6186880e> | 2007-11-13 22:17:14 +0000 |
commit | bbd9b472916ce10b16f59d4e56c9ed7959f9d95e (patch) | |
tree | e215f76860542e2e3c3241de3c9b2cea52ca0f98 /src/common | |
parent | Issue 221 - HTTPUpload::SendRequest should provide error code or error descri... (diff) | |
download | breakpad-bbd9b472916ce10b16f59d4e56c9ed7959f9d95e.tar.xz |
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
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/windows/http_upload.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/common/windows/http_upload.cc b/src/common/windows/http_upload.cc index d93f4cfd..2f9ffa92 100644 --- a/src/common/windows/http_upload.cc +++ b/src/common/windows/http_upload.cc @@ -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; |