From bbd9b472916ce10b16f59d4e56c9ed7959f9d95e Mon Sep 17 00:00:00 2001 From: mmentovai Date: Tue, 13 Nov 2007 22:17:14 +0000 Subject: [PATCH] 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 --- src/common/windows/http_upload.cc | 6 +++--- 1 file 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(url.size()), 0, &components)) { return false;