From b254d727a639153f7c622750555413a7a0669aad Mon Sep 17 00:00:00 2001 From: "vegorov@chromium.org" Date: Fri, 4 Feb 2011 10:38:49 +0000 Subject: [PATCH] Fix compliance bug in decodeURI/decodeURIComponent. Review URL: http://codereview.chromium.org/6349105 git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@6630 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/uri.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/uri.js b/src/uri.js index 3adab83d87..179fa92863 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(); -