diff options
author | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-30 15:59:45 +0000 |
---|---|---|
committer | robertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-01-30 15:59:45 +0000 |
commit | 203c687f8e5a3d66e6ffd899e72a20951999a2d8 (patch) | |
tree | b33989abc0f4c025149b0946d0cf18c4d87e34e0 /chrome/app/client_util.cc | |
parent | 09632b8ef15c821addcc2340035e15a42a0119f3 (diff) | |
download | chromium_src-203c687f8e5a3d66e6ffd899e72a20951999a2d8.zip chromium_src-203c687f8e5a3d66e6ffd899e72a20951999a2d8.tar.gz chromium_src-203c687f8e5a3d66e6ffd899e72a20951999a2d8.tar.bz2 |
Correct the length of the string saved to the "dr" registry value used for Omaha active user reporting.
BUG=33457
TEST=The dr value of "1" is written with length 4 bytes.
Review URL: http://codereview.chromium.org/548204
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37638 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/client_util.cc')
-rw-r--r-- | chrome/app/client_util.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/chrome/app/client_util.cc b/chrome/app/client_util.cc index 993f468..fae039f 100644 --- a/chrome/app/client_util.cc +++ b/chrome/app/client_util.cc @@ -96,8 +96,11 @@ bool SetDidRunState(const wchar_t* guid, const wchar_t* value) { if (::RegCreateKeyExW(HKEY_CURRENT_USER, key_path.c_str(), 0, NULL, REG_OPTION_NON_VOLATILE, KEY_WRITE, NULL, ®_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; } |