1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-06 04:31:29 +00:00

Avoid clobbering ignore_404 and severity values in http-enum. Closes #1467

This commit is contained in:
dmiller
2019-05-20 03:43:11 +00:00
parent b1f5943b6f
commit 61e2976e95
2 changed files with 6 additions and 2 deletions

View File

@@ -1,5 +1,9 @@
#Nmap Changelog ($Id$); -*-text-*- #Nmap Changelog ($Id$); -*-text-*-
o [NSE][GH#1467] Avoid clobbering the "severity" and "ignore_404" values of
fingerprints in http-enum. None of the standard fingerprints uses these
fields. [Kostas Milonas]
o [NSE][GH#1077] Fix a crash caused by a double-free of libssh2 session data o [NSE][GH#1077] Fix a crash caused by a double-free of libssh2 session data
when running SSH NSE scripts against non-SSH services. [Seth Randall] when running SSH NSE scripts against non-SSH services. [Seth Randall]

View File

@@ -303,14 +303,14 @@ local function get_fingerprints(fingerprint_file, category)
-- Make sure the severity is an integer between 1 and 4. Default it to 1. -- Make sure the severity is an integer between 1 and 4. Default it to 1.
if(fingerprint.severity and (type(fingerprint.severity) ~= 'number' or fingerprint.severity < 1 or fingerprint.severity > 4)) then if(fingerprint.severity and (type(fingerprint.severity) ~= 'number' or fingerprint.severity < 1 or fingerprint.severity > 4)) then
return bad_prints(mutex, "The 'severity' field has to be an integer between 1 and 4") return bad_prints(mutex, "The 'severity' field has to be an integer between 1 and 4")
else elseif not fingerprint.severity then
fingerprint.severity = 1 fingerprint.severity = 1
end end
-- Make sure ignore_404 is a boolean. Default it to false. -- Make sure ignore_404 is a boolean. Default it to false.
if(fingerprint.ignore_404 and type(fingerprint.ignore_404) ~= 'boolean') then if(fingerprint.ignore_404 and type(fingerprint.ignore_404) ~= 'boolean') then
return bad_prints(mutex, "The 'ignore_404' field has to be a boolean") return bad_prints(mutex, "The 'ignore_404' field has to be a boolean")
else elseif not fingerprint.ignore_404 then
fingerprint.ignore_404 = false fingerprint.ignore_404 = false
end end
end end