From 8b16ba3bbf381249552c2a038233141e4abbe731 Mon Sep 17 00:00:00 2001 From: Brian White Date: Tue, 23 Feb 2016 14:38:23 -0500 Subject: 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 Reviewed-By: Roman Reiss Reviewed-By: Rod Vagg Reviewed-By: Evan Lucas --- lib/url.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/url.js') 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; } -- cgit v1.2.3