From d2d591ce0cd4d6b0dd4546626e757f3360e55711 Mon Sep 17 00:00:00 2001 From: nnposter Date: Mon, 27 Oct 2025 01:19:40 +0000 Subject: [PATCH] Avoid a crash when the IP contains a colon but no hextets --- nselib/ipOps.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/nselib/ipOps.lua b/nselib/ipOps.lua index 498652825..dbfd54622 100644 --- a/nselib/ipOps.lua +++ b/nselib/ipOps.lua @@ -381,6 +381,9 @@ expand_ip = function( ip, family ) for hdt in string.gmatch( ip, "[%.z%x]+" ) do hexadectets[#hexadectets+1] = hdt end + if #hexadectets == 0 then + return nil, ( err4:gsub( "IPv4", "IPv6" ) ) + end -- deal with IPv4in6 (last hexadectet only) local t = {}