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

Unified Diff: chrome/common/common_param_traits.cc

Issue 523088: Avoid accepting suspiciously long URLs from the renderer. These can take down... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 10 years, 11 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 | « chrome/common/chrome_constants.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/common_param_traits.cc
===================================================================
--- chrome/common/common_param_traits.cc (revision 35371)
+++ chrome/common/common_param_traits.cc (working copy)
@@ -5,6 +5,7 @@
#include "chrome/common/common_param_traits.h"
#include "base/gfx/rect.h"
+#include "chrome/common/chrome_constants.h"
#include "googleurl/src/gurl.h"
#ifndef EXCLUDE_SKIA_DEPENDENCIES
#include "third_party/skia/include/core/SkBitmap.h"
@@ -99,7 +100,7 @@
bool ParamTraits<GURL>::Read(const Message* m, void** iter, GURL* p) {
std::string s;
- if (!m->ReadString(iter, &s)) {
+ if (!m->ReadString(iter, &s) || s.length() > chrome::kMaxURLChars) {
*p = GURL();
return false;
}
« no previous file with comments | « chrome/common/chrome_constants.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698