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

Unified Diff: src/url_canon_ip.cc

Issue 155077: Fix: Make DoCanonicalizeIPv6Address safer by changing loop condition and addi... (Closed) Base URL: http://google-url.googlecode.com/svn/trunk/
Patch Set: Created 11 years, 5 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: src/url_canon_ip.cc
===================================================================
--- src/url_canon_ip.cc (revision 107)
+++ src/url_canon_ip.cc (working copy)
@@ -640,7 +640,9 @@
url_parse::Component contraction_range;
ChooseIPv6ContractionRange(address, &contraction_range);
- for (int i = 0; i < 16;) {
+ for (int i = 0; i <= 14;) {
+ // We check 2 bytes at a time, from bytes (0, 1) to (14, 15), inclusive.
+ DCHECK(i % 2 == 0);
if (i == contraction_range.begin && contraction_range.len > 0) {
// Jump over the contraction.
if (i == 0)
« 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