Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3515)

Unified Diff: chrome/app/client_util.cc

Issue 671010: Merge 37638 - Correct the length of the string saved to the "dr" registry val... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/app/client_util.cc
===================================================================
--- chrome/app/client_util.cc (revision 40935)
+++ chrome/app/client_util.cc (working copy)
@@ -96,8 +96,11 @@
if (::RegCreateKeyExW(HKEY_CURRENT_USER, key_path.c_str(), 0, NULL,
REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL,
&reg_key, NULL) == ERROR_SUCCESS) {
+ // Note that the length here must be in bytes and must account for the
+ // terminating null char.
::RegSetValueExW(reg_key, google_update::kRegDidRunField, 0, REG_SZ,
- reinterpret_cast<const BYTE *>(value), ::lstrlenW(value));
+ reinterpret_cast<const BYTE *>(value),
+ (::lstrlenW(value) + 1) * sizeof(wchar_t));
::RegCloseKey(reg_key);
return true;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698