diff options
author | Brian White <mscdex@mscdex.net> | 2016-02-23 14:38:23 -0500 |
---|---|---|
committer | Roman Reiss <me@silverwind.io> | 2016-02-27 14:45:20 +0100 |
commit | 8b16ba3bbf381249552c2a038233141e4abbe731 (patch) | |
tree | cdd265effc697176de46f5e27e394dac42ad153f /lib/url.js | |
parent | 3a331b66f8000f2a38e9e98810a4a92a6b3a641d (diff) | |
download | android-node-v8-8b16ba3bbf381249552c2a038233141e4abbe731.tar.gz android-node-v8-8b16ba3bbf381249552c2a038233141e4abbe731.tar.bz2 android-node-v8-8b16ba3bbf381249552c2a038233141e4abbe731.zip |
url: fix off-by-one error with parse()
Fixes: https://github.com/nodejs/node/issues/5393
PR-URL: https://github.com/nodejs/node/pull/5394
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Roman Reiss <me@silverwind.io>
Reviewed-By: Rod Vagg <rod@vagg.org>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Diffstat (limited to 'lib/url.js')
-rw-r--r-- | lib/url.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/url.js b/lib/url.js index 6ffec081f6..7db23bf48a 100644 --- a/lib/url.js +++ b/lib/url.js @@ -413,7 +413,7 @@ function validateHostname(self, rest, hostname) { } // Invalid host character self.hostname = hostname.slice(0, i); - if (i < hostname.length - 1) + if (i < hostname.length) return '/' + hostname.slice(i) + rest; break; } |