summaryrefslogtreecommitdiff
path: root/lib/url.js
diff options
context:
space:
mode:
authorBrian White <mscdex@mscdex.net>2016-02-23 14:38:23 -0500
committerRoman Reiss <me@silverwind.io>2016-02-27 14:45:20 +0100
commit8b16ba3bbf381249552c2a038233141e4abbe731 (patch)
treecdd265effc697176de46f5e27e394dac42ad153f /lib/url.js
parent3a331b66f8000f2a38e9e98810a4a92a6b3a641d (diff)
downloadandroid-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.js2
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;
}