1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-07 13:11:28 +00:00

Don't substitute nonprinting characters in http-git.

NSE already escapes output everywhere. More importantly, the call to
gsub returns two values, which were being treated as structured output
and unstructured output. The second return value is an integer count of
substitutions, so what you would see in normal output was
|_http-git: 0
while what used to be normal output was going to XML.

Alex Weber noticed that the script was not working.
http://seclists.org/nmap-dev/2012/q4/397
This commit is contained in:
david
2012-12-08 10:22:55 +00:00
parent e78540e9a5
commit 8f3165f7a6

View File

@@ -260,6 +260,6 @@ function action(host, port)
end
-- Replace non-printing characters with asterisks
if #out > 0 then return string.gsub(stdnse.format_output(true, out), "[^%w%p%s]", "*")
if #out > 0 then return stdnse.format_output(true, out)
else return nil end
end