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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user