summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-03 22:39:08 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-11-03 22:39:08 +0000
commit8592b371914e0f8b48af46371567bb18f575e2a4 (patch)
tree378b75f918ecfa43445e772e4898aec6cb450458
parent92e04982398b395d79a53b2ae944a56e39711bfe (diff)
downloadchromium_src-8592b371914e0f8b48af46371567bb18f575e2a4.zip
chromium_src-8592b371914e0f8b48af46371567bb18f575e2a4.tar.gz
chromium_src-8592b371914e0f8b48af46371567bb18f575e2a4.tar.bz2
Add a length DCHECK() on GURL size to IPC param traits.
If there is a case of a too long GURL being pickled, this will catch it at its source rather than a harder to debug failure on the other end of the pipe. (This doesn't yet fix the bug.) BUG=102287 TEST=Mouse-overing the link in the bug's test.html should trigger the DCHECK(). Review URL: http://codereview.chromium.org/8417053 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@108562 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--content/public/common/common_param_traits.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/content/public/common/common_param_traits.cc b/content/public/common/common_param_traits.cc
index 95b0d94..22bb7a9 100644
--- a/content/public/common/common_param_traits.cc
+++ b/content/public/common/common_param_traits.cc
@@ -50,6 +50,7 @@ struct SkBitmap_Data {
namespace IPC {
void ParamTraits<GURL>::Write(Message* m, const GURL& p) {
+ DCHECK(p.possibly_invalid_spec().length() <= content::kMaxURLChars);
m->WriteString(p.possibly_invalid_spec());
// TODO(brettw) bug 684583: Add encoding for query params.
}