Reviewers: Lasse Reichstein,

Description:
Fix compliance bug in decodeURI/decodeURIComponent.

Please review this at http://codereview.chromium.org/6349105/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/uri.js


Index: src/uri.js
diff --git a/src/uri.js b/src/uri.js
index 3adab83d87358d9065c4ba16340444db4250eee6..179fa9286340bdfc183d0131324e10b0b6228311 100644
--- a/src/uri.js
+++ b/src/uri.js
@@ -205,7 +205,7 @@ function Decode(uri, reserved) {
         octets[0] = cc;
if (k + 3 * (n - 1) >= uriLength) throw new $URIError("URI malformed");
         for (var i = 1; i < n; i++) {
-          k++;
+          if (uri.charAt(++k) != '%') throw new $URIError("URI malformed");
octets[i] = URIHexCharsToCharCode(uri.charAt(++k), uri.charAt(++k));
         }
         index = URIDecodeOctets(octets, result, index);
@@ -412,4 +412,3 @@ function SetupURI() {
 }

 SetupURI();
-


--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to