summaryrefslogtreecommitdiffstats
path: root/chrome/common/visitedlink_common.cc
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-17 02:40:55 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-17 02:40:55 +0000
commit8f70cf2540642898489ff84fb59d99805d5a9b0e (patch)
treea866f6ffb5c27e259f6836f5a4ee51f9ebfbff08 /chrome/common/visitedlink_common.cc
parent1f73dcad1fe1d80cd9d5a1afb60ad5d56dc52619 (diff)
downloadchromium_src-8f70cf2540642898489ff84fb59d99805d5a9b0e.zip
chromium_src-8f70cf2540642898489ff84fb59d99805d5a9b0e.tar.gz
chromium_src-8f70cf2540642898489ff84fb59d99805d5a9b0e.tar.bz2
Fix bug in history salt computation
Since the salt is stored on disk, also increase the db version number. This will cause a rebuild of the history database. I added the following warning to clang to make sure we don't make this mistake anywhere else in the codebase: /Volumes/MacintoshHD2/src/chrome-git/src/chrome/browser/visitedlink/visitedlink_master.cc:968:30: error: argument to 'sizeof' in 'memcpy' call is the same expression as the source; did you mean to provide an explicit length? [-Werror,-Wsizeof-pointer-memaccess] memcpy(salt_, salt, sizeof(salt)); ~~~~ ^~~~ /Volumes/MacintoshHD2/src/chrome-git/src/chrome/browser/visitedlink/visitedlink_master.cc:964:17: note: declared here const uint8 salt[LINK_SALT_LENGTH]) ^ /Volumes/MacintoshHD2/src/chrome-git/src/chrome/common/visitedlink_common.cc:84:31: error: sizeof on array function parameter will return size of 'const uint8 *' (aka 'const unsigned char *') instead of 'const uint8 [8]' [-Werror,-Wsizeof-array-argument] MD5Update(&ctx, salt, sizeof(salt)); ^ /Volumes/MacintoshHD2/src/chrome-git/src/chrome/common/visitedlink_common.cc:79:17: note: declared here const uint8 salt[LINK_SALT_LENGTH]) { ^ BUG=25629 TEST=none Review URL: http://codereview.chromium.org/7068017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@89443 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/visitedlink_common.cc')
-rw-r--r--chrome/common/visitedlink_common.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/chrome/common/visitedlink_common.cc b/chrome/common/visitedlink_common.cc
index 9cd1e84..92a6743 100644
--- a/chrome/common/visitedlink_common.cc
+++ b/chrome/common/visitedlink_common.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -81,7 +81,7 @@ VisitedLinkCommon::Fingerprint VisitedLinkCommon::ComputeURLFingerprint(
MD5Context ctx;
MD5Init(&ctx);
- MD5Update(&ctx, salt, sizeof(salt));
+ MD5Update(&ctx, salt, LINK_SALT_LENGTH * sizeof(uint8));
MD5Update(&ctx, canonical_url, url_len * sizeof(char));
MD5Digest digest;