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

Unified Diff: url/url_canon_relative.cc

Issue 23902014: Fix OOB read when parsing protocol-relative URLs (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/url_canon_relative.cc
diff --git a/url/url_canon_relative.cc b/url/url_canon_relative.cc
index 30956a633f7b3ee79ca3a74292ec77026c73a609..84317f8009488b40ebcf5052167dba91d6ef5519 100644
--- a/url/url_canon_relative.cc
+++ b/url/url_canon_relative.cc
@@ -372,9 +372,8 @@ bool DoResolveRelativeHost(const char* base_url,
// Parse the relative URL, just like we would for anything following a
// scheme.
url_parse::Parsed relative_parsed; // Everything but the scheme is valid.
- url_parse::ParseAfterScheme(&relative_url[relative_component.begin],
- relative_component.len, relative_component.begin,
- &relative_parsed);
+ url_parse::ParseAfterScheme(relative_url, relative_component.end(),
+ relative_component.begin, &relative_parsed);
// Now we can just use the replacement function to replace all the necessary
// parts of the old URL with the new one.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698