From 546fccfca8890d7a3130961ac138b5a205a64afb Mon Sep 17 00:00:00 2001 From: Christopher Jeffrey Date: Mon, 19 Dec 2016 04:08:35 -0800 Subject: [PATCH] ip: speed up ipv6 parsing. --- lib/utils/ip.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/utils/ip.js b/lib/utils/ip.js index d53a879f..f92fadd7 100644 --- a/lib/utils/ip.js +++ b/lib/utils/ip.js @@ -124,6 +124,8 @@ IP.version = function version(str) { */ IP.isV4Format = function(str) { + if (str.length < 7) + return false; return ipv4Regex.test(str); };