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

Unified Diff: content/public/common/common_param_traits.cc

Issue 11826002: Reject invalid GURLs across IPC. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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 | « content/public/common/OWNERS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/common/common_param_traits.cc
===================================================================
--- content/public/common/common_param_traits.cc (revision 175576)
+++ content/public/common/common_param_traits.cc (working copy)
@@ -58,13 +58,8 @@
// type as GURL. See https://crbug.com/166486 for additional work in
// this area.
if (!p.is_valid()) {
- GURL reconstructed_url(p.possibly_invalid_spec());
- if (reconstructed_url.is_valid()) {
- DLOG(WARNING) << "GURL string " << p.possibly_invalid_spec()
- << " (marked invalid) but parsed as valid.";
- m->WriteString(std::string());
- return;
- }
+ m->WriteString(std::string());
+ return;
}
m->WriteString(p.possibly_invalid_spec());
@@ -78,6 +73,10 @@
return false;
}
*p = GURL(s);
+ if (!s.empty() && !p->is_valid()) {
+ *p = GURL();
+ return false;
+ }
return true;
}
« no previous file with comments | « content/public/common/OWNERS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698