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

Unified Diff: src/url_util.cc

Issue 10542140: Fix handling of URLs with no schema. (Closed) Base URL: http://git.chromium.org/external/google-url.git@master
Patch Set: Created 8 years, 6 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 | « src/gurl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/url_util.cc
diff --git a/src/url_util.cc b/src/url_util.cc
index 382cec278499e05bc223207ab8ed8cf16052c070..04c595a3ba9fa6fc9a52b6952a946ced6da09692 100644
--- a/src/url_util.cc
+++ b/src/url_util.cc
@@ -178,8 +178,10 @@ bool DoCanonicalize(const CHAR* in_spec, int in_spec_len,
#endif
url_parse::Component scheme;
- if (!url_parse::ExtractScheme(spec, spec_len, &scheme))
+ if (!url_parse::ExtractScheme(spec, spec_len, &scheme)) {
+ AppendInvalidNarrowString(spec, 0, spec_len, output);
return false;
+ }
// This is the parsed version of the input URL, we have to canonicalize it
// before storing it in our object.
« no previous file with comments | « src/gurl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698