1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-31 20:09:02 +00:00

Fix the indexing of Globals - found with the help of strict.lua and Patrick's

check_globals script.

Commented-out two functions which are currently unused:
svcctl_Type_tostr() and svcctl_State_tostr()
and which call currently unavailable functions:
svcctl_Type_str() and svcctl_State_str()

(see http://seclists.org/nmap-dev/2009/q3/0194.html )
This commit is contained in:
jah
2009-07-17 22:38:26 +00:00
parent 5a18633b33
commit dcfa102a1b
3 changed files with 12 additions and 12 deletions

View File

@@ -660,7 +660,7 @@ function srvsvc_netservergetstatistics(smbstate, server)
stdnse.print_debug(2, "MSRPC: Calling NetServerGetStatistics() [%s]", smbstate['ip'])
-- [in] [string,charset(UTF16)] uint16 *server_unc,
arguments = msrpctypes.marshall_unicode_ptr(server_unc, true)
arguments = msrpctypes.marshall_unicode_ptr(server, true)
-- [in] [string,charset(UTF16)] uint16 *service,
arguments = arguments .. msrpctypes.marshall_unicode_ptr(service, true)

View File

@@ -199,7 +199,7 @@ function unicode_to_string(buffer, pos, length, do_null)
pos = pos + 2
end
stdnse.print_debug(4, "MSRPC: Leaving unicode_to_string()", i, count)
stdnse.print_debug(4, "MSRPC: Leaving unicode_to_string()")
return pos, string
end
@@ -910,7 +910,7 @@ function marshall_int16_ptr(int16, pad)
local result
stdnse.print_debug(4, string.format("MSRPC: Entering marshall_int16_ptr()"))
result = marshall_ptr(ALL, marshal_int16, {int16, pad}, int16)
result = marshall_ptr(ALL, marshall_int16, {int16, pad}, int16)
stdnse.print_debug(4, string.format("MSRPC: Leaving marshall_int16_ptr()"))
return result
@@ -928,7 +928,7 @@ function marshall_int8_ptr(int8, pad)
local result
stdnse.print_debug(4, string.format("MSRPC: Entering marshall_int8_ptr()"))
result = marshall_ptr(ALL, marshal_int8, {int8, pad}, int8)
result = marshall_ptr(ALL, marshall_int8, {int8, pad}, int8)
stdnse.print_debug(4, string.format("MSRPC: Leaving marshall_int8_ptr()"))
return result
@@ -4251,7 +4251,7 @@ function unmarshall_svcctl_Type(data, pos)
return pos, str
end
---Convert a <code>svcctl_Type</code> value to a string that can be shown to the user. This is
--[[Convert a <code>svcctl_Type</code> value to a string that can be shown to the user. This is
-- based on the <code>_str</table> table.
--
--@param val The string value (returned by the <code>unmarshall_</code> function) to convert.
@@ -4264,7 +4264,7 @@ function svcctl_Type_tostr(val)
stdnse.print_debug(4, string.format("MSRPC: Leaving svcctl_Type_tostr()"))
return result
end
end]]--
@@ -4305,7 +4305,7 @@ function unmarshall_svcctl_State(data, pos)
return pos, str
end
---Convert a <code>svcctl_State</code> value to a string that can be shown to the user. This is
--[[Convert a <code>svcctl_State</code> value to a string that can be shown to the user. This is
-- based on the <code>_str</table> table.
--
--@param val The string value (returned by the <code>unmarshall_</code> function) to convert.
@@ -4318,7 +4318,7 @@ function svcctl_State_tostr(val)
stdnse.print_debug(4, string.format("MSRPC: Leaving svcctl_State_tostr()"))
return result
end
end]]--
---Unmarshall a SERVICE_STATUS struct, converting it to a table. The structure is as

View File

@@ -1253,7 +1253,7 @@ function start_session_extended(smb, overrides, use_default, log_errors)
-- This loop takes care of the multiple packets that "extended security" requires
repeat
-- Get the new security blob, passing the old security blob as a parameter. If there was no previous security blob, then nil is passed, which creates a new one
status, security_blob, smb['mac_key'] = smbauth.get_security_blob(security_blob, smb['ip'], accounts[i]['username'], accounts[i]['domain'], accounts[i]['hash_type'], overrides, use_defaults)
status, security_blob, smb['mac_key'] = smbauth.get_security_blob(security_blob, smb['ip'], accounts[i]['username'], accounts[i]['domain'], accounts[i]['hash_type'], overrides, use_default)
-- There was an error processing the security blob
if(status == false) then
@@ -1789,9 +1789,9 @@ function write_file(smb, write_data, offset)
end
-- Parse the parameters
local reserved, count_high, remaining, count_low
pos, andx_command, andx_reserved, andx_offset, count_low, remaining, count_high, reserved = bin.unpack("<CCSSSSS", parameters)
if(reserved == nil) then
local count_reserved, count_high, remaining, count_low
pos, andx_command, andx_reserved, andx_offset, count_low, remaining, count_high, count_reserved = bin.unpack("<CCSSSSS", parameters)
if(count_reserved == nil) then
return false, "SMB: ERROR: Ran off the end of SMB packet; likely due to server truncation [28]"
end