mirror of
https://github.com/nmap/nmap.git
synced 2026-10-20 19:01:56 +00:00
Fix to allow cpe port table entry to be nil when calling set_port_version
This commit is contained in:
parent
9a67069869
commit
9b9aceac92
1 changed files with 7 additions and 5 deletions
|
|
@ -594,13 +594,15 @@ static int l_set_port_version (lua_State *L)
|
|||
luaL_argerror(L, 2, "invalid value for port.version.service_tunnel");
|
||||
|
||||
lua_getfield(L, 4, "cpe");
|
||||
if (!lua_istable(L, -1))
|
||||
if (lua_isnil(L, -1))
|
||||
;
|
||||
else if(lua_istable(L, -1))
|
||||
for (lua_pushnil(L); lua_next(L, -2); lua_pop(L, 1)) {
|
||||
cpe.push_back(lua_tostring(L, -1));
|
||||
}
|
||||
else
|
||||
luaL_error(L, "port.version 'cpe' field must be a table");
|
||||
|
||||
for (lua_pushnil(L); lua_next(L, -2); lua_pop(L, 1)) {
|
||||
cpe.push_back(lua_tostring(L, -1));
|
||||
}
|
||||
|
||||
if (o.servicescan)
|
||||
target->ports.setServiceProbeResults(p->portno, p->proto,
|
||||
probestate, name, tunnel, product,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue